import java.util.*;

import static java.lang.System.out;

/**
 * Created by Vince on 2017-01-14.
 */
public class levelone {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        long mem[] = new long[(2 * T)];
        for (int i = 0; i < (2 * T); i++)
            mem[i] = sc.nextInt();


        for (int i = 0; i < (2 * T); i = i + 2) {
            out.printf(String.valueOf((mem[i] + mem[i + 1]))+" "+
                    String.valueOf((mem[i] - mem[i + 1]))+" "+
                    String.valueOf((mem[i] * mem[i + 1])) + "\n");
        }
    }
}