// Arup Guha
// 8/31/2013
// Solution to 2013 UCF Locals Problem: Bulk

import java.util.*;
import java.io.*;

public class bulk {

	public static void main(String[] args) throws Exception {

		Scanner stdin = new Scanner(new File("bulk.in"));
		int numCases = stdin.nextInt();

		// Process each case, -2 for each except the first.
		for (int loop=0; loop<numCases; loop++) {
			int quantity = stdin.nextInt();
			int price = stdin.nextInt();
			System.out.println(quantity+" "+price);
			System.out.println(quantity*(price-2)+2);
		}

		stdin.close();
	}
}