#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int a, b, c;
map<int, int> m;
map<int, int> m_f;
int i;
while ( scanf_s("%d %d %d", &a,&b,&c) != EOF) {//// 请问:while循环怎么退出????
m[a] = c;
m[b] = c;
m_f[a] = 1;
}
auto it2 = --m.end();
++m.end();
for (auto it = m.begin(); it != it2;) {
int a = it->first;
int b = it->second;
auto itTmp = ++it;
int key = itTmp->first;
if (m_f.count(key) > 0) {//key为范围尾端
cout << a << ' ' << ' ' << key - 1 << ' ' << b << endl;
}
else {
if (m_f.count(a) <= 0 && m_f.count(key) > 0) {
a += 1;
key -= 1;
}
cout << a << ' ' << key << ' ' << m[key] << ' ' << b << endl;
}
}
return 0;
}
#C++工程师#