import java.io.*; class IntWithNsd { public IntWithNsd( int val ) { value = val; } public int getValue() { return value; } public int nsd ( int v ) { int z = value; int y = v; while ( y != 0 ) { int t = y; y = z % y; z = t; } return z; } private int value; } class NsdProg { public static void main (String args[]) { System.out.println(" vstup dvou celych cisel:"); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); try { IntWithNsd x = new IntWithNsd(Integer.parseInt(in.readLine())); int y = Integer.parseInt(in.readLine()); System.out.print(" nsd z " + x.getValue() + " a " + y + " je "); System.out.println(x.nsd(y)); } catch ( Exception e) { System.out.println(e); System.exit(1); } } }