#include
#include
main()
{
int a,b,c,r;
scanf("%d %d %d",&a,&b,&c);
while(b!=0)
{
r=a%b;
a=b;
b=r;
}
while(c!=0)
{
r=a%c;
a=c;
c=r;
}
printf("%d\n",a);
getch();
}
#include
main()
{
int a,b,c,r;
scanf("%d %d %d",&a,&b,&c);
while(b!=0)
{
r=a%b;
a=b;
b=r;
}
while(c!=0)
{
r=a%c;
a=c;
c=r;
}
printf("%d\n",a);
getch();
}