P7175 [COCI 2014/2015 #4] PŠENICA
Description
Every year on Saint Lucy’s Day, Mirko and Slavko plant Christmas wheat. The stalks grow at different speeds, and after some time the wheat becomes quite messy. They decide to fix this by playing the following game, which repeatedly proceeds in turns as follows:
- Mirko chooses a stalk with the minimum height and changes its height to the second minimum value.
- Slavko chooses a stalk with the maximum height and changes its height to the second maximum value.
- If the number of distinct remaining heights is at least $3$, the game continues; otherwise it ends, and the player who is to move next is the loser.
Given the heights of the wheat stalks, Mirko moves first. Determine the winner of the game and the minimum and maximum heights after the game ends.
Input Format
The first line contains an integer $n$, the number of wheat stalks.
The second line contains $n$ space-separated integers $h_i$, the height of each wheat stalk.
Output Format
On the first line, output the winner’s name (`Mirko` or `Slavko`).
On the second line, output the heights of the shortest and the tallest stalk when the game ends.
Explanation/Hint
#### Sample 1 Explanation
At the beginning, Mirko cannot make a move, so Slavko is the winner.
#### Constraints
- For $50\%$ of the testdata, $1 \le n \le 500$.
- For $80\%$ of the testdata, $1 \le n \le 3 \times 10^3$.
- For $100\%$ of the testdata, $1 \le n \le 10^5$.
For all valid $h_i$, $1 \le h_i \le 10^5$.
#### Note
**This problem is translated from [COCI2014-2015 CONTEST #4](https://hsin.hr/coci/archive/2014_2015/contest4_tasks.pdf) _T2 PŠENICA_.**
Translated by ChatGPT 5