#include<stdio.h>

int nwd(int a,int b)
{int temp;
 while(b)
 {temp=b;
     b=a%b;
     a=temp;
 }
 return a; 
}
void main()
{ int a,b;
  scanf("%d",&a);
  scanf("%d",&b);
  printf("nwd(%d,%d)=%d",a,b,nwd(a,b));
}

