The Men (M), Elves (E) and the Dwarves (D) are fighting for the Iron Throne. The three houses are fighting to capture the throne.
The Zth battle goes on for Z days before a winner emerges. Interestingly, the battles follow a pattern.
If the battle number Z is divisible by 3 it is fought between M and E,
If the remainder of the division with 3 is 1 it is fought between E and D and
If the remainder of a division with 3 is 2 it is fought between D and M.
Given a day number Y, you will have to say which two houses are fighting on the Yth day.
The first line will contain an integer Y.
You will have to report which of the two houses are fighting on the Yth day
(i.e. you will have to print one of the three battles (ME, ED, DM))