# -*- coding:utf-8 -*- import math if __name__ == "__main__": n = input() for i in xrange(n): a,b = map(int,raw_input().split()) z = int(b * math.log10(a)) temp = b*math.log10(a) - z s = "%.16f" % (10 ** (temp + 1e-20)) # s = str(round(pow(a,temp),1) + 1e-20) print s[0],s[2],z