Codeforces Round #365 (Div. 2) A

Source: Internet
Author: User

Description

Mishka is a little polar bear. As known, little Bears loves spending their free time playing dice for chocolates. Once in a wonderful sunny morning, walking around blocks of ice, Mishka met her friend Chris, and they started playing the Game.

Rules of the game was very simple:at first number of rounds n is defined. In every round all of the players throws a cubical dice with distinct numbers from 1 to 6 written on its faces. P Layer, whose value after throwing the dice is greater, wins the round. If player dice values is equal, no one of them is a winner.

In average, player, who won most of the rounds, is the winner of the game. In case if both players won the same number of rounds, the result of the game is draw.

Mishka is still very little and can ' t count wins and losses, so she asked-to-watch their game and determine its result . Please help her!

Input

The first line of the input contains a single integer n n (1≤ n ≤100)-the number of game rounds.

The next n lines contains rounds description. i-th of them contains pair of integers mi and Ci ( C12>1≤ mi, ci ≤6)-values on Dice Upper face after Mishka ' s and Chris ' throws in I-th round respectively.

Output

If Mishka is the winner of the game, print "Mishka" (without quotes) in the-line.

If Chris is the winner of the game, print "Chris" (without quotes) on the only line.

If The result of the game is draw, print ' friendship is magic! ^^ ' (without quotes) in the -line.

Examples input
3
3 5
2 1
4 2
Output
Mishka
input
2
6 1
1 6
Output
Friendship is magic! ^^
input
3
1 5
3 3
2 2
Output
Chris
Note

In the first sample case Mishka loses the first round, but wins second and third rounds and thus she's the winner of the Game.

In the second sample case Mishka wins the first round, Chris wins the second round, and the game ends with draw with score 1:1.

In the third sample case Chris wins the first round, but there is no winner of the next of the rounds. The winner of the game is Chris.

Test instructions: Two people toss the dice, who won more times?

Solution: Simulation

#include <bits/stdc++.h>using namespace std; #define INF (1<<31) -1int a,b;int n,m;int Sum1,sum2,sum3;int    Main () {cin>>n;        for (int i=1;i<=n;i++) {cin>>a>>b;        if (a>b) {sum1++;        } else if (a==b) {sum2++;        } else {sum3++;        }} if (n%2==0) {if (sum1>sum3) {cout<< "Mishka" <<endl;        } else if (sum1==sum3) {cout<< "Friendship is magic! ^^" <<endl;        } else {cout<< "Chris" <<endl;        }} else {if (sum1>sum3) {cout<< "Mishka" <<endl;        } else if (sum1==sum3) {cout<< "Friendship is magic! ^^" <<endl;        } else {cout<< "Chris" <<endl; }} return 0;}

  

Codeforces Round #365 (Div. 2) A

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.