
public class gcd
{
   public static void main(String[] args)
   {
      int A, B, GCD;

      A = 28; 
      B = 36;

      while ( A != 0 && B != 0 )
      {
         if ( A >= B )
            A = A - B;
         else
            B = B - A;
      }

      if ( A > 0 )
         GCD = A;
      else
         GCD = B;

      System.out.println(GCD);
   }
}
