#include <fstream>
#include <iostream>
using namespace std;
bool isCorrect(int day, int month, int *dates)
{
if (month < 0 || month > 11)
return false;
if (day < 0 || day > dates[month]-1)
return false;
return true;
}
int main()
{
int dates[12] = {31,29,31,30,31,30,31,31,30,31,30,31};
bool wins[31][12];
int day = 0;
int month = 0;
ifstream in("dategame.in");
in >> day >> month;
in.close();
for (int i = 11; i >= 0; --i