include Math gets.to_i.times{ a,b = gets.split.map(&:to_i) tmp = b * log10(a) z = tmp.floor tmp = ((10 ** (tmp - z)) * 10).floor x,y = tmp / 10,tmp % 10 puts "#{x} #{y} #{z}" }