#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

struct info {
	int st;
	int en;
	int val;
};

bool cmp(const info &f1, const info &f2)
{
	return f1.en < f2.en;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n, x, y, z, ans = -1e9;
	cin >> n;
	vector<info> arr(n);
	vector<int> res(n);
	for (int i = 0; i < n; ++i) {
		cin >> x >> y;
		info myinfo = {x, y, y - x};
		arr.push_back(myinfo);
	}
	for (int i = 0; i < n; ++i) cout << arr[i].st << " " << arr[i].en << " " << arr[i].val << endl;
	return 0;
}