import Char main=do l<-getLine;interact$unlines.filter(/=[]).map(l%).lines f l=sum$map((2^).ord)l l%a|f l==f a=a|1>0=[]