public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder out = new StringBuilder();
		int times = Integer.parseInt(in.readLine().trim());
		for (int i = 0; i < times; i++) {
			if (i != 0)
				out.append("\n");
			in.readLine();
			long n = Long.parseLong(in.readLine().trim()), div = 1;
			while ((div * n) <= 9876543210L) {
				if (dif(div) && dif(div * n))
					out.append((div * n) + " / " + div + " = " + n + "\n");
				div++;
			}
		}
		System.out.print(out);
	}