IT | 프로그래밍의 벗 PivotOJ
PivotOJ

IT

시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2002 Regional Competition - SeniorsBOJ 3254

문제

Mirko and Slavko are playing one well-known interesting game. 

Table for that game doesn't have some specific name, so let's called it 'it'. 'It' stands in vertical position and it has 6 rows and 7 columns. The players are throwing their coins in 'it' one after another. When somebody put his coin in some column, coin is falling until the lowest free row. Each coin is taking exactly one position. 

Each player has 21 coins and Mirko is playing first. Mirko has yellow coins, and Slavko has red coins. 

The aim of the game is connect four coins in the sequence in horizontal, vertical or diagonal direction. We called that situation the winning situation. 

When Mirko and Slavko are playing the game, they don't look if the game is (and when is) over, they just play until there are no coins to throw in front of them. Because of that, they decide to write down on the piece of paper all their moves and to let somebody smarter to find out who is the winner of the game. 

Write the program that will decide who won and in which move. In the case that winning situation happened more than once in the game, first of them is making winner. However, the game can finish without the winner. 

입력

Input file consists of 21 lines. 

In i-th line are two integers Mi and Si, separated with space. Number Mi stands for number of column in which Mirko throw his coin in i-th move, and number Si number of column in which Slavko throw his coin in i-th move. 

Columns are denoted with numbers from 1 to N.

출력

In first and only line of input file you must write 'mirko M' or 'slavko M' if Mirko or Slavko won in M-th move or word 'remi' if there are no winner in the game.

예제

예제 1

입력
2 2
5 2
3 7
6 1
4 6
3 1
3 5
3 3
6 3
2 5
4 1
6 2
2 5
7 5
1 7
4 4
4 1
7 6
1 7
7 5
6 4
출력
sk 5

예제 2

입력
1 1
2 4
6 4
5 1
1 2
7 4
3 4
7 7
4 6
3 5
2 4
6 1
7 3
6 3
6 1
6 3
2 5
7 3
2 7
2 5
5 5
출력
ji 7

예제 3

입력
1 2
1 2
1 2
2 1
2 1
2 1
3 4
3 4
3 4
4 3
4 3
4 3
5 6
5 6
5 6
6 5
6 5
6 5
7 7
7 7
7 7
출력
ss
코드를 제출하려면 로그인하세요.