#define x round(n**(1/i)) var i,n:word;s:string;begin repeat readln(s);val(s,n,i);write(s," =");if n=0then write(" 10667507560001^2 ",s:11,"6049421004105281 = 10667507560159^2")else for i:=2to 21do if n=x pow i then write(^`,x,^,i);writeln until n=0end.