Need help!

package com.codegym.task.task14.task1420;
/*
GCD
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
int a = Math.abs(Integer.parseInt(reader.readLine()));
int b = Math.abs(Integer.parseInt(reader.readLine()));
System.out.println(gcd (a,b));
}
catch (NumberFormatException e)
{
e.printStackTrace();
}
}
static int gcd(int x, int y) {
if(y == 0) {
return x;
}
else {
return gcd(y, x%y);
}
}
}