g=getLine main=g>>f f=g>>g>>=print.foldr(gcd.read)0.words>>f