#include <iostream>
using namespace std;

int main(int argc, char** argv) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, a, b;
    long c, d;
    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> a >> b;
        cout << a+b << " " << a-b << " ";
        if(a < 10000 && b < 10000 && a > - 10000 && b > -10000)
            cout << a*b << endl;
        else {
            c = a;
            d = b;
            cout << c*d << endl;
        }
    }
return 0;
}