#include <stdio.h> int main( void ) { unsigned m, n; scanf( "%d%d", &m, &n ); for( ; n!=0; ) { unsigned t = m; m = n; n = t%n; } printf( "%u\n", m ); }