#include <stdio.h>
#include <stdlib.h>
long long euqivalent(long long x, long long y)
{
if(!x || !y) return 0;
while((x %= y) > 1 && (y %= x) > 1);
if(x == 1 || y== 1) { return 1; }
else { return (x > y) ? x : y; }
}
int main(int argc, char *argv[])
{
/* check for args vector here */
printf("%lld", equivalent(atoll(argv[1], atoll[2])));
return 0;
}