#include <iostream>
using namespace std;
int main() {
int left, height, right, coordinate[10001] = {0};
while ( cin >> left >> height >> right ) {
for ( int i = left; i < right; ++i )
if ( height > coordinate[i] )
coordinate[i] = height;
}
for ( int i = 0; i < 10001; ++i ) {
if ( coordinate[0] && 0 == i )
cout << "0 " << coordinate[0] << " ";
if ( coordinate[i + 1] != coordinate[i] )
cout << (i + 1) << " " << coordinate[i + 1] << " ";
}
cout << endl;
return 0;
}