import java.util.*; import java.math.BigDecimal; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i < n; i++) { double a = sc.nextDouble(); double b = sc.nextDouble(); BigDecimal A = new BigDecimal((double)Math.log10(a)); BigDecimal B = new BigDecimal(b); BigDecimal t = B.multiply(A); long z = t.longValue(); BigDecimal Z = new BigDecimal(z); BigDecimal t1 = t.subtract(Z); double t2 = (double)Math.pow(10, t1.doubleValue()); String s = String.valueOf(t2); String x = String.valueOf(s.charAt(0)); String y = String.valueOf(s.charAt(2)); System.out.println(x + " " + y + " " + z); } } }