A year calendar is printed using a monospace font according to the following rules:
All spaces on the printed calendar are represented by the dot character (ASCII 46).
Each month occupies a rectangle of by characters. The name of the month is written in all capital letters starting from the nd character of the first line.
All days of the months are printed in , , or columns, each column being characters wide and characters tall, with one space between columns. The first day of the week is Monday.
a. The months of the year are arranged in three rows separated by horizontal and vertical lines of spaces. Each row contains four months. The margins of the calendar are space on all sides. Therefore, the whole calendar is by characters in size.
Note that January st, was a Monday. Also note that a leap year is divisible by and not by , or divisible by . For example, a part of the printed calendar from October to December may look as follows:

A calendar was printed and then burned, leaving only a small rectangular piece. Your program must determine to which of the years from to this piece could belong.
The first line of the input file contains integers and (2 \leq N, M \leq 10) separated by spaces — the size of the piece. The following lines contain characters each — the piece of calendar.
The output file should contain an ordered list of year numbers, one per line. If the given piece could not belong to any calendar, the output should contain a single integer (zero).
Example 1