407296: GYM102757 A Time Machine

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Time Machinetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

One day, Nobita decided he wanted to go to the future to see who he would be getting married to. Unfortunately, his time machine broke and it sent him to a year that he did not want to go to!

Fortunately, Doraemon gave him a couple of gadgets in case something like this happened. He has an inflatable shelter (very high tech, even has an elevator), and a watch that always tells the correct time. Turns out, the time machine is a little awry but should be good to use by tomorrow. Once Nobita sets up his shelter and gets ready to sleep and wait for the time machine to fix itself, he checks his watch and notes that it's February 28th. He is suddenly curious now if tomorrow is February 29th or March 1st on the Gregorian Calendar.

Given the year that his watch displays, determine tomorrow's date! Remember that a leap year occurs when a year is divisible by 400, or it is divisible by 4 but not 100.

Input

The first line of the input contains $$$n (1 \le n \le 100)$$$, the number of times Nobita traveled into the past. Then, the following $$$n$$$ lines each contain an integer $$$y (1 \le y \le 10000)$$$, a year that Nobita travels to.

Output

For each of the $$$n$$$ years that Nobita traveled to, output either February 29 or March 1 depending on if the year is a leap year or not.

ExampleInput
3
2000
1900
2004
Output
February 29
March 1
February 29

加入题单

上一题 下一题 算法标签: