//大小都不超過10000,
//因此紀錄每個座標位置出現過的最大高度,並依照題意輸出
#include <iostream>
using namespace std;
int high[10000]={0};
int main(){
int L,H,R,mn=10000,mx=0;
while(cin>>L>>H>>R){
mn=min(mn,L);
mx=max(mx,R);
for (int i=L;i<R;i++){
high[i]=max(high[i],H);
}
}
H=-1;
for (int i=mn;i<=mx;i++){
if (H!=high[i]){
H=high[i];
cout<<" "<<i<<" "<<high[i];
}
}
cout<<endl;
}
#include <iostream>
using namespace std;
int high[10000]={0};
int main(){
int L,H,R,mn=10000,mx=0;
while(cin>>L>>H>>R){
mn=min(mn,L);
mx=max(mx,R);
for (int i=L;i<R;i++){
high[i]=max(high[i],H);
}
}
H=-1;
for (int i=mn;i<=mx;i++){
if (H!=high[i]){
H=high[i];
cout<<" "<<i<<" "<<high[i];
}
}
cout<<endl;
}