#include<bits/stdc++.h>
using namespace std;
bool IsRun(int y)
{
return y%400==0||y%4==0&&y%100!=0 ? 1:0;
}
bool IsRight(int year,int month,int day)
{
if(month<1||month>12)return 0;
if(day<1||day>31)return 0;
if((month==4||month==6||month==9||month==11)&&day==31)return 0;
if(month==2)
{
if(day>29)return 0;
if(!IsRun(year)&&day==29)return 0;
}
return 1;
using namespace std;
bool IsRun(int y)
{
return y%400==0||y%4==0&&y%100!=0 ? 1:0;
}
bool IsRight(int year,int month,int day)
{
if(month<1||month>12)return 0;
if(day<1||day>31)return 0;
if((month==4||month==6||month==9||month==11)&&day==31)return 0;
if(month==2)
{
if(day>29)return 0;
if(!IsRun(year)&&day==29)return 0;
}
return 1;