n = gets.to_i n.times do a, b = *gets.split(" ").map(&:to_i) x = (a ** b).to_s xa = x[0].to_i xb = x[1].to_i xx = x.size - 1 p [x, xa, xb, xx] end