#include<bits/stdc++.h>
#define PI acos(-1)
#define ios ios::sync_with_stdio(false)
#define endl '\n'
#define srand srand((unsigned)time(NULL))
using namespace std;
typedef long long int ll;
typedef pair<int,int> PII;
const int maxn=1e5+10;
struct node{
int x,y,z;
node(int fir,int sec,int thi){
x=fir;y=sec;z=thi;
}
node(){}
node operator- () { //重载负运算符
x = -x;
y = -y;
z = -z;
return node(x,y,z);
}
bool operator <(const node& d)const{ // 重载小于运算符( < )
if(x != d.x){
return x<d.x;
}
if(x == d.x && y != d.y){
return y<d.y;
}
if(y==d.y)return z<d.z;
}
bool operator >(const node& d)const{ // 重载大于运算符( > )
if(x != d.x){
return x>d.x;
}
if(x == d.x && y != d.y){
return y>d.y;
}
if(y==d.y)return z>d.z;
}
bool operator ==(const node& d)const{// 重载等于运算符
if(x==d.x&&y==d.y&&z==d.z)return true;
return false;
}
friend ostream &operator<<(ostream &output,const node &D){ //重载输出运算符
output << "first: " << D.x << " second : " << D.y<<" third: "<<D.z;
return output;
}
friend istream &operator>>( istream &input,node &D){ //重载输入运算符
input >> D.x >> D.y>>D.z;
return input;
}
};
int main(){
srand;
int n;cin>>n;
node k;k.x=rand();k.y=rand();k.z=rand();
node a[maxn];
for(int i=1;i<=n;i++){
a[i].x=rand();
a[i].y=rand();
a[i].z=rand();
}
sort(a+1,a+n+1);
//对数组 a 去重
int m=unique(a+1,a+1+n)-(a+1);
for(int i=1;i<=m;i++){
cout<<a[i];cout<<endl;
}
//算法返回一个非递减序列[first, last)中的第一个大于等于值k的位置
int it1=lower_bound(a+1,a+1+m,k)-a;
//算法返回一个非递减序列[first, last)中第一个大于k的位置。
int it2=upper_bound(a+1,a+m+1,k)-a;
return 0;
}