题目链接:http://codeforces.com/problemset/problem/703/A

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 are very simple: at first number of rounds n is defined. In every round each of the players throws a cubical dice with distinct numbers from 1 to 6 written on its faces. Player, whose value after throwing the dice is greater, wins the round. In case if player dice values are 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 two 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 you to watch their game and determine its result. Please help her!

Input

The first line of the input contains 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 (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 only line.

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

If the result of the game is draw, print "Friendship is magic!^^" (without quotes) in the only line.

Examples
input

Copy
3
3 5
2 1
4 2
output

Copy
Mishka
input

Copy
2
6 1
1 6
output

Copy
Friendship is magic!^^
input

Copy
3
1 5
3 3
2 2
output

Copy
Chris
Note

In the first sample case Mishka loses the first round, but wins second and third rounds and thus she is 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 two rounds. The winner of the game is Chris.

简单模拟一下,每次输入谁的分高谁赢,最后比较总的结果

AC代码如下:

 #include <iostream>
using namespace std;
int main()
{
int n,a,b;
cin>>n;
int ans1 = , ans2 = ;
while(n--)
{
cin>>a>>b;
if(a > b)
ans1++;
else if(a < b)
ans2++;
}
if(ans1 > ans2)
cout<<"Mishka"<<endl;
else if(ans1 < ans2)
cout<<"Chris"<<endl;
else
cout<<"Friendship is magic!^^"<<endl;
return ;
}

最新文章

  1. Mathematica(MMA)闪电入门系列 目录与说明
  2. ASP.NET Web API 应用教程(一) ——数据流使用
  3. iOS 状态栏黑色背景白色字体
  4. DataTable或者DataRow转换对象
  5. javaSE基础——常见的dos命令即其他
  6. 【redis】06Redis的高级应用之事务处理、持久化操作、pub_sub、虚拟内存
  7. NSUserDefaults存储自定义对象
  8. JavaWeb_Day10_学习笔记1_response(3、4、5、6、7、8、9)发送状态码、响应、重定向、定时刷新、禁用浏览器缓存、响应字节数据、快捷重定向方法、完成防盗链
  9. 【技巧】DataGridView,ListView重新绑定时保持上次滚动位置
  10. (转)设置 UILabel 和 UITextField 的 Padding 或 Insets (理解UIEdgeInsets)
  11. jvm常用参数设置 good
  12. java web(一):tomcat服务器的安装和简单介绍,与eclipse关联
  13. Integer.parseInt vs Integer.valueOf
  14. ASP.NET C# 如何在程序中控制IIS服务或应用程序池重启?
  15. python+selenium+unittest 实现自动化测试
  16. win10 图标异常 ,重命名后,图标不显示,名字错乱。
  17. 转-使用 CefSharp 在 C# App 中嵌入 Chrome 浏览器
  18. es6从零学习(五):Module的语法
  19. winform 中设置窗体的默认焦点
  20. 基于Photon 的 PUN+ 如何自动实现RPC呼叫的.

热门文章

  1. Unity经典游戏教程之:是男人就下100层
  2. webupload项目中使用
  3. Linux打开网易云的问题
  4. 灰度级分层(一些基本的灰度变换函数)基本原理及Python实现
  5. xpath爬虫实例,爬取图片网站百度盘地址和提取码
  6. axios配置请求头content-type
  7. Myeclipse8.5上基于JAX-WS开发WebService
  8. 洛谷 P4401 [IOI2007]Miners 矿工配餐
  9. T-SQL基础语句
  10. Sqlserver 查询分组 记录