class RRresult
 {private int a,b;         
  public RResult()                   {   set(0,0);   }
  public RRresult(int m,int n)     {   set(m,n);   }
  private void set(int,m,int n)    {   a=m;b=n;     }
  public int geta( )                 {   return a;    }
  public int getb( )                 {   return b;    }
  public int getg( )
    {int u,v,r;
     u=a; v=b; r=u%v;
     while(r!=0)
       {u=v; v=r; r=u%v;  }
         return v;
}

   public void gDisplay( )
      { System.out.println(""+a+"和"+b+"的最大公约数为："+getg( ));}
}


public class ch0315         // 应用程序主类
   { public static void main(String args[])
       {  RResult x=new RResult(48,27);    //服务类RResult实例化x
          RResult y=new RResult(48,28);    //服务类RResult实例化y
          x.getg( );   x.gDisplay( );      //给实例x发消息
          y.getg( );   y.gDisplay( );      //给实例y发消息
       }
   }

