program Project2; {$APPTYPE CONSOLE} uses SysUtils; var m,n: integer; function NSD(var a,b: longint): longint; var l: integer; c: longint; begin while (a<>0)and(b<>0)do if a>b then a:=a-b else b:=b-a; if a<>0 then NSD:=a else NSD:=b; end; begin readln(m,n); writeln(NSD(m,n)); readln(m); end.