//===========================
#include<iostream>
#include<iomanip>
//========================
using namespace std;
class Date{
int year,month,day;
public:
bool isleapyear(){
return(year%4==0&&year%100!=0)||(year%400==0);
}
void print(){
cout<<setfill('0');
cout<<setw(4)<<year<<'-'<<setw(2)<<month<<'-'<<setw(2)<<day<<'\n';
cout<<setfill(' ');
}
void set(int y,int m,int d){
year=y; month=m; day=d;
}
};
//--------------------------
int main(){
Date kk;
int n;cin>>n;
for(int i=1;i<=n;i++){
int y;int m;int d;
cin>>y>>m>>d; // kk.set(1000,8,16);
kk.set(y,m,d);
if(kk.isleapyear()) kk.print();
else cout<<"notleap\n";
}
cout<<"over"<<'\n';
}
//--------------------------
想用类做8个排序算法 有点没有头绪阿