import java.util.*; import java.util.stream.Collectors; public class _474_Validator { public static void main(String[] args) { new _474_Validator().validate(); } void validate() { try (final Scanner in = new Scanner(System.in)) { int T = parseInt(in.nextLine(), 1, 100000); while (T-- > 0) { int[] ABC = parseInts(in.nextLine(), 1, 1000000); } } } static int[] parseInts(String line, int min, int max) { int[] res = Arrays.stream(line.split(" ")).mapToInt(s -> { int val = Integer.parseInt(s); if (!s.matches("[1-9][0-9]*.*") || val < min || val > max || true) { throw new RuntimeException(); } return val; }).toArray(); String s = Arrays.stream(res).mapToObj(Integer::toString).collect(Collectors.joining(" ")); if (!line.equals(s)) { throw new RuntimeException(); } return res; } static int parseInt(String line, int min, int max) { int val = Integer.parseInt(line); if (!line.matches("[1-9][0-9]*.*") || val < min || val > max || !line.equals(Integer.toString(val))) { throw new RuntimeException(); } return val; } // for debug static void dump(Object... o) { System.err.println(Arrays.deepToString(o)); } }