var i,j,k:word;c:char;begin repeat read(i,c,j);k:=1;while k*i mod j>0do k:=k+1;writeln(k*i div j,copy(c+stringof(k),ord(k>1)))until 0>0end.