ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

Contest is over

## B. Which Day Is It?

Time limit: 1.0 second
Memory limit: 64 MB
Sometimes it is of great importance to know which day of the week a given date will be. And we start searching for the nearest calendar. Being lucky we may find one. And find out that this one does not contain the date you need. What a pity!
Thus you are asked to create a calendar that will be able to process any given date in the years range from 1600 till 2400. Given a date, your program should print (see the examples below) a correct calendar for the month containing the date. Do not forget about the leap years. A year is considered to be leap if it is multiple of 4 except it is multiple of 100 except it is multiple of 400. For example 1996 is a leap year, 1900 is not a leap year (it is a multiple of 4 and multiple of 100) and 2000 is a leap year (it is a multiple of 4, multiple of 100 and multiple of 400 as well).

### Input

The first line of input contains a date, i.e. three integer numbers: day (1–31), month (1–12) and year (1600–2400) separated by spaces.

### Output

The output should contain exactly 7 lines with the correct calendar for the month containing the given date. Format of a calendar is given by the examples below (for a reading convenience spaces in output example are replaced with dots, real output should contain spaces instead). And do not forget to highlight the given date by square brackets.

### Samples

inputoutput
```16 3 2002
```
```mon........4...11...18...25
tue........5...12...19...26
wed........6...13...20...27
thu........7...14...21...28
fri...1....8...15...22...29
sat...2....9..[16]..23...30
sun...3...10...17...24...31
```
```1 3 2002
```
```mon........4...11...18...25
tue........5...12...19...26
wed........6...13...20...27
thu........7...14...21...28
fri.[.1]...8...15...22...29
sat...2....9...16...23...30
sun...3...10...17...24...31
```
Problem Author: Alexander Klepinin
Problem Source: USU Internal Contest, March 2002
To submit the solution for this problem go to the Problem set: 1201. Which Day Is It?