#include <bits/stdc++.h>
using namespace std;
int a,b,i;
int main()
{
cin>>a>>b;
int nn=min(a,b);
for (int i=nn; i>=1; i--)
{
if (a%i==0 && b%i==0)
{
cout<<i<<" ";
return 0;
}
}
cout<<1;
}
Program UCLN;
uses crt;
var a,b,x,y,tg: integer;
begin
clrscr;
write('Nhap a: '); readln(a); x:=a;
rite('Nhap b: '); readln(b); y:=b;
while a<>b do if a>b then a:=a-b else b:=b-a;
write('UCLN(',x,'',y,') = ',a);
Readln;
end.