This page is still under construction.

Parts of this page are still being built. What you see may change.

Line Game

Time limit1sMemory limit128 MB

Summary
Two players alternately draw unused axis-parallel lines through marked points on the previous line, and the program names the side with a winning strategy.
Level

Medium7 of 10

Topics
Game theory, Graph
Solved
No attempts yet

Problem

Mirko and Slavko decided to invent a new game.

Before the game starts, the two of them mark NN points on the coordinate plane. They then take turns drawing one line each, and Mirko goes first.

Mirko draws a line parallel to one of the coordinate axes that passes through one of the NN points. From then on, each player draws a line parallel to a coordinate axis that passes through one of the NN points lying on the line the opponent drew on the previous turn. The same line cannot be drawn twice. The player who cannot draw a line loses.

Write a program that determines which player has a winning strategy.

Input

The first line contains NN. (1≤N≤10,0001 \le N \le 10{,}000)

Each of the next NN lines contains the coordinates XX and YY of one marked point. (1≤X,Y≤5001 \le X, Y \le 500)

Output

Print Mirko if Mirko wins, or Slavko if Slavko wins.

Examples2

  1. Example 1

    Input
    3
    1 1
    1 2
    1 3
    
    Expected output
    Mirko
    
  2. Example 2

    Input
    4
    1 1
    1 2
    2 1
    2 2
    
    Expected output
    Slavko