#include <bits/stdc++.h>
#define MAXN 100010
using namespace std;

struct edge{
	int x, y;
} edges[3*MAXN];

vector<int> G[MAXN];
int deg[MAXN];
int cnt_in[MAXN], cnt_out[MAXN];
bool used_edges[3*MAXN];
bool used_vertex[MAXN];

int get_second_end(int v, int edge_id){
	if (v == edges[edge_id].x)
		return edges[edge_id].y;
	else return edges[edge_id].x;
}

void compute_with_vertex(int v, queue<int>& Q){
	random_shuffle(G[v].begin(),G[v].end());
	for (int it = 0; it<G[v].size(); it++){
		int id = G[v][it];
		if (!used_edges[id]){
			used_edges[id] = true;
			int next = get_second_end(v, id);
			if (!used_vertex[next]){
				Q.push(next);
				used_vertex[next] = true;
			}
			if (cnt_in[v] % 2){
				cnt_in[v]++;
				//int x = edges[id].x, y = edges[id].y;
				if (edges[id].x == v){
					swap(edges[id].x, edges[id].y);
				}
				cnt_out[edges[id].x]++;
			}else{
				cnt_out[v]++;
				if (edges[id].x != v){
					swap(edges[id].x, edges[id].y);
				}
				cnt_in[edges[id].y]++;
			}
		}
	}

}

void repair(int n, int start, int finish){
	vector<bool> used(n+1, false);
	vector<int> path(n+1, -1);
	queue<int> Q; Q.push(start);
	used[start]=true;
	bool found = false;
	while (!Q.empty() && !found){
		int v = Q.front(); Q.pop();
		for (auto it = G[v].begin(); it!=G[v].end(); it++){
			int next = get_second_end(v, *it);
			if (!used[next]){
				path[next] = *it;
				used[next] = true;
				if (next == finish){
					found = true; break;
				}
				Q.push(next);
			}
		}
	}
	while (path[finish]!=-1){
		int id = path[finish];
		swap(edges[id].x, edges[id].y);
		finish = get_second_end(finish, id);
	}
}

void find_broken_vertexes(int n, vector<int>& ret){
	for (int i = 1; i<=n; i++)
		if (cnt_in[i]%2) ret.push_back(i);
}

void solve(){
	vector<int> odds(0);
	int simple_even = -1;
	int cnt_simple_even = 0;
	int n, m; cin >> n >> m;
	queue<int> Q;
	for (int i = 0; i<m; i++){
		int x, y; cin >> x >> y;
		edges[i] = {x,y};
		if (x!=y){
			G[x].push_back(i); G[y].push_back(i);
		}else{
			if (!used_vertex[x]) Q.push(x);
			used_vertex[x]=true;
			cnt_in[x]++;
			cnt_out[x]++;
		}
		deg[x]++;
		deg[y]++;
	}

	for (int i = 1; i<=n; i++){
		if (deg[i]%2){
			odds.push_back(i);
		}else{
			if (deg[i]%4){
				simple_even = i;
				cnt_simple_even++;
			}
		}
	}
	for (int i = 0; i<odds.size()/2; i++){
		int x = odds[i*2], y = odds[i*2+1];
		edges[m] = {x,y};
		G[x].push_back(m); G[y].push_back(m); m++;
		deg[x]++; deg[y]++;
		if (deg[x] % 4){
			simple_even = x;
			cnt_simple_even++;
		}
		if (deg[y] % 4){
			simple_even = y;
			cnt_simple_even++;
		}
	}
	if (cnt_simple_even % 2){
		edges[m] = {simple_even, simple_even};
		m++;
		deg[simple_even]+=2;
		cnt_in[simple_even]++;
		cnt_out[simple_even]++;
		if (!used_vertex[simple_even]){
			Q.push(simple_even);
			used_vertex[simple_even] = true;
		}
	}
	cout << m << endl;

	if (Q.empty()){
		used_vertex[1]=true;
		Q.push(1);
	}
	while (!Q.empty()){
		int v = Q.front(); Q.pop();
		compute_with_vertex(v,Q);
	}

	vector<int> broken(0);
	find_broken_vertexes(n,broken);
	for (int i = 0; i<broken.size()/2; i++){
			int s = broken[2*i], t = broken[2*i+1];
			repair(n,s,t);
	}

	for (int i = 0; i<m; i++){
		cout << edges[i].x << ' ' << edges[i].y << endl;
	}

		//cout << broken.size();
}

int main(){
#ifdef NEKROLM
    long long start = clock();
    freopen("input.txt","r", stdin);
    freopen("output.txt","w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    srand(time(NULL));
    solve();
#ifdef NEKROLM
    fflush(stdout);
    printf("\nwork time: %.4f ms\n",float(clock()-start)/CLOCKS_PER_SEC * 1000);
#endif
    return 0;
}


#include <bits/stdc++.h>
#define MAXN 100010
using namespace std;

struct edge{
	int x, y;
} edges[3*MAXN];

set<int> G[MAXN];
int deg[MAXN];
int cnt_in[MAXN], cnt_out[MAXN];
bool used_edges[3*MAXN];
bool used_vertex[MAXN];

int get_second_end(int v, int edge_id){
	if (v == edges[edge_id].x)
		return edges[edge_id].y;
	else return edges[edge_id].x;
}

void compute_with_vertex(int v, queue<int>& Q){
	while (G[v].size()){
		int id = *G[v].begin();
		if (!used_edges[id]){
			used_edges[id] = true;
			int next = get_second_end(v, id);
			if (!used_vertex[next]){
				Q.push(next);
				used_vertex[next] = true;
			}
			if (cnt_in[v] % 2){
				cnt_in[v]++;
				//int x = edges[id].x, y = edges[id].y;
				if (edges[id].x == v){
					swap(edges[id].x, edges[id].y);
				}
				cnt_out[edges[id].x]++;
			}else{
				cnt_out[v]++;
				if (edges[id].x != v){
					swap(edges[id].x, edges[id].y);
				}
				cnt_in[edges[id].y]++;
			}
		}
		G[v].erase(id);
	}
}

void delete_loops(int n, queue<int>& Q){
	for (int i = 1; i<=n; i++){
		vector<int> loops(0);
		for (auto it = G[i].begin(); it!=G[i].end(); it++){
			int id = *it;
			if (edges[id].x == edges[id].y){
				loops.push_back(id);
				cnt_in[i]++;
				cnt_out[i]++;
			}
		}
		for (int j = 0; j<loops.size(); j++)
			G[i].erase(loops[j]);
		if (cnt_in[i]%2){
			used_vertex[i] = true;
			Q.push(i);
		}
	}
}

void solve(){
	vector<int> odds(0);
	int simple_even = -1;
	int cnt_simple_even = 0;
	int n, m; cin >> n >> m;
	for (int i = 0; i<m; i++){
		int x, y; cin >> x >> y;
		edges[i] = {x,y};
		G[x].insert(i); G[y].insert(i);
		deg[x]++;
		deg[y]++;
	}
	for (int i = 1; i<=n; i++){
		if (deg[i]%2){
			odds.push_back(i);
		}else{
			if (deg[i]%4){
				simple_even = i;
				cnt_simple_even++;
			}
		}
	}
	for (int i = 0; i<odds.size()/2; i++){
		int x = odds[i*2], y = odds[i*2+1];
		edges[m] = {x,y};
		G[x].insert(m); G[y].insert(m); m++;
		deg[x]++; deg[y]++;
		if (deg[i] % 4){
			simple_even = x;
			cnt_simple_even++;
		}
		if (deg[i] % 4){
			simple_even = y;
			cnt_simple_even++;
		}
	}
	if (cnt_simple_even % 2){
		edges[m] = {simple_even, simple_even};
		G[simple_even].insert(m); m++;
		deg[simple_even]+=2;
	}
	cout << m << endl;
	queue<int> Q;
	delete_loops(n, Q);
	if (Q.empty()){
		used_vertex[1]=true;
		Q.push(1);
	}
	while (!Q.empty()){
		int v = Q.front(); Q.pop();
		compute_with_vertex(v,Q);
	}
	for (int i = 0; i<m; i++){
		cout << edges[i].x << ' ' << edges[i].y << endl;
	}
}

int main(){
#ifdef NEKROLM
    long long start = clock();
    freopen("input.txt","r", stdin);
    freopen("output.txt","w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    srand(time(NULL));
    solve();
#ifdef NEKROLM
    fflush(stdout);
    printf("\nwork time: %.4f ms\n",float(clock()-start)/CLOCKS_PER_SEC * 1000);
#endif
    return 0;
}


#include <bits/stdc++.h>
#define MAXN 100010
using namespace std;

struct edge{
	int x, y;
} edges[3*MAXN];

set<int> G[MAXN];
int deg[MAXN];
int cnt_in[MAXN], cnt_out[MAXN];
bool used_edges[3*MAXN];
bool used_vertex[MAXN];

int get_second_end(int v, int edge_id){
	if (v == edges[edge_id].x)
		return edges[edge_id].y;
	else return edges[edge_id].x;
}

void compute_with_vertex(int v, queue<int>& Q){
	while (G[v].size()){
		int id = *G[v].begin();
		if (!used_edges[id]){
			used_edges[id] = true;
			int next = get_second_end(v, id);
			if (!used_vertex[next]){
				Q.push(next);
				used_vertex[next] = true;
			}
			if (cnt_in[v] % 2){
				cnt_in[v]++;
				//int x = edges[id].x, y = edges[id].y;
				if (edges[id].x == v){
					swap(edges[id].x, edges[id].y);
				}
				cnt_out[edges[id].x]++;
			}else{
				cnt_out[v]++;
				if (edges[id].x != v){
					swap(edges[id].x, edges[id].y);
				}
				cnt_in[edges[id].y]++;
			}
		}
		G[v].erase(id);
	}
}

void delete_loops(int n, queue<int>& Q){
	for (int i = 1; i<=n; i++){
		vector<int> loops(0);
		for (auto it = G[i].begin(); it!=G[i].end(); it++){
			int id = *it;
			if (edges[id].x == edges[id].y){
				loops.push_back(id);
				cnt_in[i]++;
				cnt_out[i]++;
			}
		}
		for (int j = 0; j<loops.size(); j++)
			G[i].erase(loops[j]);
		if (cnt_in[i]%2){
			used_vertex[i] = true;
			Q.push(i);
		}
	}
}

void solve(){
	vector<int> odds(0);
	int simple_even = -1;
	int cnt_simple_even = 0;
	int n, m; cin >> n >> m;
	for (int i = 0; i<m; i++){
		int x, y; cin >> x >> y;
		edges[i] = {x,y};
		G[x].insert(i); G[y].insert(i);
		deg[x]++;
		deg[y]++;
	}
	for (int i = 1; i<=n; i++){
		if (deg[i]%2){
			odds.push_back(i);
		}else{
			if (deg[i]%4){
				simple_even = i;
				cnt_simple_even++;
			}
		}
	}
	for (int i = 0; i<odds.size()/2; i++){
		int x = odds[i*2], y = odds[i*2+1];
		edges[m] = {x,y};
		G[x].insert(m); G[y].insert(m); m++;
		deg[x]++; deg[y]++;
		if (deg[x] % 4){
			simple_even = x;
			cnt_simple_even++;
		}
		if (deg[y] % 4){
			simple_even = y;
			cnt_simple_even++;
		}
	}
	if (cnt_simple_even % 2){
		edges[m] = {simple_even, simple_even};
		G[simple_even].insert(m); m++;
		deg[simple_even]+=2;
	}
	cout << m << endl;
	queue<int> Q;
	delete_loops(n, Q);
	if (Q.empty()){
		used_vertex[1]=true;
		Q.push(1);
	}
	while (!Q.empty()){
		int v = Q.front(); Q.pop();
		compute_with_vertex(v,Q);
	}
	for (int i = 0; i<m; i++){
		cout << edges[i].x << ' ' << edges[i].y << endl;
	}
}

int main(){
#ifdef NEKROLM
    long long start = clock();
    freopen("input.txt","r", stdin);
    freopen("output.txt","w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    srand(time(NULL));
    solve();
#ifdef NEKROLM
    fflush(stdout);
    printf("\nwork time: %.4f ms\n",float(clock()-start)/CLOCKS_PER_SEC * 1000);
#endif
    return 0;
}


#include <iostream>
#include <list>
#include <vector>
#include <utility>

#define NMAX 100005
using namespace std;

struct muchie
{
    int a,b;
    bool viz;
};

int deg[NMAX];
vector<muchie*> graf[NMAX];

list<int> sol;
list<int>::iterator unde;

void expand(int nod)
{
    while(1)
    {
        while(graf[nod].size() && (*(graf[nod].end()-1))->viz==1)
            graf[nod].pop_back();

        if(graf[nod].size())
        {
            (*(graf[nod].end()-1))->viz=1;
            nod=(*(graf[nod].end()-1))->a+(*(graf[nod].end()-1))->b-nod;
            sol.insert(unde,nod);
        }
        else
            break;
    }
}

vector <int> real_sol;

void euler()
{
    sol.push_back(1);

    for(list<int>::iterator it=sol.begin();it!=sol.end();it++)
    {
        real_sol.push_back(*it);
        it++;
        unde=it;
        it--;
        expand(*it);
    }
}

vector <pair <int, int> > fin;
int main()
{
    ios_base :: sync_with_stdio(false);

    int n=0,m=0,i,a,b;

    cin>>n>>m;

    for(i=0;i<m;i++)
    {
        cin>>a>>b;

        muchie *x;
        x=new muchie;

        x->a=a;
        x->b=b;
        x->viz=0;

        deg[a]++;
        deg[b]++;

        graf[a].push_back(x);
        graf[b].push_back(x);
    }

    int j;
    for (int i = 1; i <= n; i++)
        if (deg[i] & 1) {
            for (j = i + 1; j <= n; j++)
                if (deg[j] & 1) {
                    muchie *x;
                    x=new muchie;

                    x->a=i;
                    x->b=j;
                    x->viz=0;

                    graf[i].push_back(x);
                    graf[j].push_back(x);

                    i = j;
                    m ++;

                    break;
                }
        }

    if (m & 1) {
        muchie *x;
        x=new muchie;

        x->a=1;
        x->b=1;
        x->viz=0;

        graf[1].push_back(x);
        m ++;
    }

    euler();

    for (int i = 1; i < real_sol.size(); i++)
        if (i & 1)
            fin.push_back(make_pair(real_sol[i - 1], real_sol[i]));
        else
            fin.push_back(make_pair(real_sol[i], real_sol[i - 1]));

    cout << fin.size() << '\n';
    for (int i = 0; i < fin.size(); i++)
        cout << fin[i].first << ' ' << fin[i].second << '\n';

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define sz(x) ((int) (x).size())

typedef long long ll;
typedef long double ld;

const int INF = 1000001000;
const ll INFL = 2000000000000001000;
int solve();

int main()
{
    srand(2317);
    cout.precision(10);
    cout.setf(ios::fixed);
    #ifdef LOCAL
    freopen("c.in", "r", stdin);
    #else
    #endif
    int tn = 1;
    for (int i = 0; i < tn; ++i)
        solve();
    #ifdef LOCAL
    cerr << "Time: " << double(clock()) / CLOCKS_PER_SEC << '\n';
    #endif
}

int ex[800001];
vector <int> g[800001];
bool used[800001];
int ptr[800001];

bool order = false;

void dfs(int u)
{
    int &i = ptr[u];
    if (i >= sz(g[u]))
        return;
    if (used[g[u][i]])
    {
        ++i;
        dfs(u);
        return;
    }
    used[g[u][i]] = true;
    int v = ex[g[u][i]] ^ u;
    ++i;
    dfs(v);
    if (order)
        cout << u + 1 << ' ' << v + 1 << '\n';
    else
        cout << v + 1 << ' ' << u + 1 << '\n';
    order ^= 1;
}

int solve()
{
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; ++i)
    {
        int u, v;
        cin >> u >> v;
        --u, --v;
        g[u].push_back(i);
        g[v].push_back(i);
        ex[i] = u ^ v;
    }
    int bad = -1;
    for (int i = 0; i < n; ++i)
    {
        if (sz(g[i]) % 2 == 0)
            continue;
        if (bad == -1)
            bad = i;
        else
        {
            int u = i, v = bad;
            bad = -1;
            ex[m] = u ^ v;
            g[u].push_back(m);
            g[v].push_back(m);
            ++m;
        }
    }
    if (m % 2)
    {
        ex[m] = 0;
        g[0].push_back(m);
        g[0].push_back(m);
        ++m;
    }
    cout << m << '\n';
    dfs(0);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define sz(x) ((int) (x).size())

typedef long long ll;
typedef long double ld;

const int INF = 1000001000;
const ll INFL = 2000000000000001000;
int solve();

int main()
{
    srand(2317);
    cout.precision(10);
    cout.setf(ios::fixed);
    #ifdef LOCAL
    freopen("c.in", "r", stdin);
    #else
    #endif
    int tn = 1;
    for (int i = 0; i < tn; ++i)
        solve();
    #ifdef LOCAL
    cerr << "Time: " << double(clock()) / CLOCKS_PER_SEC << '\n';
    #endif
}

int ex[800001];
vector <int> g[800001];
bool used[800001];

bool order = false;

void dfs(int u)
{
    while (sz(g[u]) > 0 && used[g[u].back()])
        g[u].pop_back();
    if (sz(g[u]) == 0)
        return;
    used[g[u].back()] = true;
    int v = ex[g[u].back()] ^ u;
    dfs(v);
    if (order)
        cout << u + 1 << ' ' << v + 1 << '\n';
    else
        cout << v + 1 << ' ' << u + 1 << '\n';
    order ^= 1;
    dfs(u);
}

int solve()
{
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; ++i)
    {
        int u, v;
        cin >> u >> v;
        --u, --v;
        g[u].push_back(i);
        g[v].push_back(i);
        ex[i] = u ^ v;
    }
    int bad = -1;
    for (int i = 0; i < n; ++i)
    {
        if (sz(g[i]) % 2 == 0)
            continue;
        if (bad == -1)
            bad = i;
        else
        {
            int u = i, v = bad;
            bad = -1;
            ex[m] = u ^ v;
            g[u].push_back(m);
            g[v].push_back(m);
            ++m;
        }
    }
    if (m % 2)
    {
        ex[m] = 0;
        g[0].push_back(m);
        g[0].push_back(m);
        ++m;
    }
    cout << m << '\n';
    dfs(0);
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,xx[500000],m,x,y,k,obr[500000],st[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x,int y) {
    for (st[x];st[x]<ed[x].size();st[x]++) {
        int j=st[x];
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        int pr=ed[x][j].ob;
        if (mar[in]==1) continue;
        mar[in]=1;
        if (pr==0 && y==1) obr[in]=1;
        if (pr==1 && y==0) obr[in]=1;
        dfs(to,1-y);
    }
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=1;i<=k;i+=2) add_edge(a[i],a[i+1]);
    dfs(1,0);
    for (int i=1;i<=v;i++)
    if (obr[i]==1) swap(xx[i],yy[i]);
    for (int i=1;i<=v;i++) ish[xx[i]]++;
    for (int i=1;i<=n;i++)
    if (ish[i]%2==1) {
        v++;
        xx[v]=i;
        yy[v]=i;
    }
    cout << v << "\n";
    for (int i=1;i<=v;i++) cout << xx[i] << " " << yy[i] << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,xx[500000],m,x,y,k,obr[500000],st[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x,int y) {
    for (st[x];st[x]<ed[x].size();st[x]++) {
        int j=st[x];
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        int pr=ed[x][j].ob;
        if (mar[in]==1) continue;
        mar[in]=1;
        if (pr==0 && y==1) obr[in]=1;
        if (pr==1 && y==0) obr[in]=1;
        dfs(to,1-y);
    }
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=2;i<=k;i++) add_edge(a[1],a[i]);
    int root;
    root=(rand()%n)+1;
    dfs(root,0);
    for (int i=1;i<=v;i++)
    if (obr[i]==1) swap(xx[i],yy[i]);
    for (int i=1;i<=v;i++) ish[xx[i]]++;
    for (int i=1;i<=n;i++)
    if (ish[i]%2==1) {
        v++;
        xx[v]=i;
        yy[v]=i;
    }
    cout << v << "\n";
    for (int i=1;i<=v;i++) cout << xx[i] << " " << yy[i] << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,xx[500000],m,x,y,k,obr[500000],st[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x,int y) {
    for (st[x];st[x]<ed[x].size();st[x]++) {
        int j=st[x];
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        int pr=ed[x][j].ob;
        if (mar[in]==1) continue;
        mar[in]=1;
        if (pr==0 && y==1) obr[in]=1;
        if (pr==1 && y==0) obr[in]=1;
        dfs(to,1-y);
    }
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=2;i<=k;i++) add_edge(a[1],a[i]);
    int root;
    if (k>0) root=a[1];
    else root=(rand%n)+1;
    dfs(1,0);
    for (int i=1;i<=v1;i++)
    if (obr[i]==1) swap(xx[i],yy[i]);
    for (int i=1;i<=v;i++) ish[xx[i]]++;
    for (int i=1;i<=n;i++)
    if (ish[i]%2==1) {
        v++;
        xx[v]=i;
        yy[v]=i;
    }
    cout << v << "\n";
    for (int i=1;i<=v;i++) cout << xx[i] << " " << yy[i] << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,xx[500000],m,x,y,k,obr[500000],st[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x,int y) {
    mar[x]=y;
    for (st[x];st[x]<ed[x].size();st[x]++) {
        int j=st[x];
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        int pr=ed[x][j].ob;
        if (mar[in]==1) continue;
        mar[in]=1;
        if (pr==0 && y==1) obr[in]=1;
        if (pr==1 && y==0) obr[in]=1;
        dfs(to,1-y);
    }
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=1;i<=k;i+=2) add_edge(a[i],a[i+1]);
    dfs(1,0);
    for (int i=1;i<=v;i++)
    if (obr[i]==1) swap(xx[i],yy[i]);
    for (int i=1;i<=v;i++) ish[xx[i]]++;
    for (int i=1;i<=n;i++)
    if (ish[i]%2==1) {
        v++;
        xx[v]=i;
        yy[v]=i;
    }
    cout << v << "\n";
    for (int i=1;i<=v;i++) cout << xx[i] << " " << yy[i] << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,xx[500000],m,x,y,k,obr[500000],st[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x,int y) {
    for (st[x];st[x]<ed[x].size();st[x]++) {
        int j=st[x];
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        int pr=ed[x][j].ob;
        if (mar[in]==1) continue;
        mar[in]=1;
        if (pr==0 && y==1) obr[in]=1;
        if (pr==1 && y==0) obr[in]=1;
        dfs(to,1-y);
    }
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=2;i<=k;i++) add_edge(a[1],a[i]);
    dfs(1,0);
    for (int i=1;i<=v;i++)
    if (obr[i]==1) swap(xx[i],yy[i]);
    for (int i=1;i<=v;i++) ish[xx[i]]++;
    for (int i=1;i<=n;i++)
    if (ish[i]%2==1) {
        v++;
        xx[v]=i;
        yy[v]=i;
    }
    cout << v << "\n";
    for (int i=1;i<=v;i++) cout << xx[i] << " " << yy[i] << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,xx[500000],m,x,y,k,obr[500000],ous[500000],st[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x) {
    for (st[x];st[x]<ed[x].size();st[x]++) {
        int j=st[x];
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        int pr=ed[x][j].ob;
        if (mar[in]==1) continue;
        mar[in]=1;
        if (pr==1 && ish[x]%2==1) obr[in]=1;
        if (pr==0 && ish[x]%2==0) obr[in]=1;
        if (obr[in]==1) {
            swap(xx[in],yy[in]);
            obr[in]=0;
        }
        ish[xx[in]]++;
        ous[yy[in]]++;
        dfs(to);
    }
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=2;i<=k;i++) add_edge(a[1],a[i]);
    dfs(1);
    for (int i=1;i<=v;i++)
    if (obr[i]==1) swap(xx[i],yy[i]);
    for (int i=1;i<=n;i++)
    if (ish[i]%2==1) {
        v++;
        xx[v]=i;
        yy[v]=i;
    }
    cout << v << "\n";
    for (int i=1;i<=v;i++) cout << xx[i] << " " << yy[i] << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,t,xx[500000],m,x,y,k,obr[500000],st[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x) {
    for (st[x];st[x]<ed[x].size();st[x]++) {
        int j=st[x];
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        if (mar[in]==1) continue;
        mar[in]=1;
        dfs(to);
    }
    t++;
    xx[t]=x;
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=1;i<=k;i+=2) add_edge(a[i],a[i+1]);
    if (v%2==1) add_edge(1,1);
    dfs(1);
    cout << v << "\n";
    for (int i=1;i<=t-1;i++)
        if (i%2==0) cout << xx[i] << " " << xx[i+1] << "\n";
        else cout << xx[i+1] << " " << xx[i] << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,xx[500000],m,x,y,k,obr[500000],st[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x,int y) {
    for (st[x];st[x]<ed[x].size();st[x]++) {
        int j=st[x];
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        int pr=ed[x][j].ob;
        if (mar[in]==1) continue;
        mar[in]=1;
        if (pr==0 && y==1) obr[in]=1;
        if (pr==1 && y==0) obr[in]=1;
        dfs(to,1-y);
    }
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=2;i<=k;i++) add_edge(a[1],a[i]);
    int root;
    if (k>0) root=a[1];
    else root=(rand()%n)+1;
    dfs(1,0);
    for (int i=1;i<=v;i++)
    if (obr[i]==1) swap(xx[i],yy[i]);
    for (int i=1;i<=v;i++) ish[xx[i]]++;
    for (int i=1;i<=n;i++)
    if (ish[i]%2==1) {
        v++;
        xx[v]=i;
        yy[v]=i;
    }
    cout << v << "\n";
    for (int i=1;i<=v;i++) cout << xx[i] << " " << yy[i] << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,xx[500000],m,x,y,k,obr[500000],st[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x,int y) {
    for (st[x];st[x]<ed[x].size();st[x]++) {
        int j=st[x];
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        int pr=ed[x][j].ob;
        if (mar[in]==1) continue;
        mar[in]=1;
        if (pr==0 && y==1) obr[in]=1;
        if (pr==1 && y==0) obr[in]=1;
        dfs(to,1-y);
    }
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=2;i<=k;i++) add_edge(a[1],a[i]);
    int root;
    if (k>0) root=a[1];
    else root=(rand()%n)+1;
    dfs(1,0);
    for (int i=1;i<=v1;i++)
    if (obr[i]==1) swap(xx[i],yy[i]);
    for (int i=1;i<=v;i++) ish[xx[i]]++;
    for (int i=1;i<=n;i++)
    if (ish[i]%2==1) {
        v++;
        xx[v]=i;
        yy[v]=i;
    }
    cout << v << "\n";
    for (int i=1;i<=v;i++) cout << xx[i] << " " << yy[i] << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,xx[500000],m,x,y,k,obr[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x,int y) {
    for (int j=0;j<ed[x].size();j++) {
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        int pr=ed[x][j].ob;
        if (mar[in]==1) continue;
        mar[in]=1;
        obr[in]=(obr[in]^y);
        dfs(to,1-y);
    }
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=1;i<=k;i+=2) add_edge(a[i],a[i+1]);
    dfs(1,0);
    for (int i=1;i<=v;i++)
    if (obr[i]==1) swap(xx[i],yy[i]);
    for (int i=1;i<=v;i++) ish[xx[i]]++;
    for (int i=1;i<=n;i++)
    if (ish[i]%2==1) {
        v++;
        xx[v]=i;
        yy[v]=i;
    }
    cout << v << "\n";
    for (int i=1;i<=v;i++) cout << xx[i] << " " << yy[i] << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
struct edge {
int vr,sl,ob;
};
int n,v,xx[500000],m,x,y,k,obr[500000],st[500000],mar[500000],yy[500000],sz[500000],ish[500000],a[500000];
vector<edge> ed[200000];
void dfs(int x,int y) {
    for (st[x];st[x]<ed[x].size();st[x]++) {
        int j=st[x];
        int to=ed[x][j].vr;
        int in=ed[x][j].sl;
        int pr=ed[x][j].ob;
        if (mar[in]==1) continue;
        mar[in]=1;
        if (pr==0 && y==1) obr[in]=1;
        if (pr==1 && y==0) obr[in]=1;
        dfs(to,1-y);
    }
}
void add_edge(int x, int y) {
    v++;
    xx[v]=x;
    yy[v]=y;
    ed[x].push_back({y,v,0});
    ed[y].push_back({x,v,1});
}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i=1;i<=m;i++) {
        cin >> x >> y;
        add_edge(x,y);
        sz[x]++;
        sz[y]++;
    }
    for (int i=1;i<=n;i++) {
        if (sz[i]%2==1) {
            k++;
            a[k]=i;
        }
    }
    for (int i=2;i<=k;i++) add_edge(a[1],a[i]);
    int root;
    root=(rand()%n)+1;
    dfs(1,0);
    for (int i=1;i<=v;i++)
    if (obr[i]==1) swap(xx[i],yy[i]);
    for (int i=1;i<=v;i++) ish[xx[i]]++;
    for (int i=1;i<=n;i++)
    if (ish[i]%2==1) {
        v++;
        xx[v]=i;
        yy[v]=i;
    }
    cout << v << "\n";
    for (int i=1;i<=v;i++) cout << xx[i] << " " << yy[i] << "\n";
    return 0;
}


/*********************************************************************\
   |--\        ---       /\        |-----------| -----   /-------|    |
   |   \        |       /  \       |               |    /             |
   |    \       |      /    \      |               |   |              |
   |     \      |     /      \     |               |   |----|         |
   |      \     |    / ------ \    |-------|       |        |-----|   |
   |       \    |   /          \   |               |              |   |
   |        \   |  /            \  |               |              /   |
  ---        -------            ------           ----- |---------/    |
                                                                      |
    codeforces = nfssdq  ||  topcoder = nafis007                      |
    mail = nafis_sadique@yahoo.com || nfssdq@gmail.com                |
    IIT,Jahangirnagar University(41)                                  |
                                                                      |
**********************************************************************/

#include <bits/stdc++.h>

using namespace std;

#define xx         first
#define yy         second
#define pb         push_back
#define mp         make_pair
#define LL         long long
#define inf        INT_MAX/3
#define mod        1000000009ll
#define PI         acos(-1.0)
#define linf       (1ll<<60)-1
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define REP(I,N)   FOR(I,0,N)
#define ALL(A)     ((A).begin(), (A).end())
#define set0(ar)   memset(ar,0,sizeof ar)
#define vsort(v)   sort(v.begin(),v.end())
#define setinf(ar) memset(ar,126,sizeof ar)

//cout << fixed << setprecision(20) << p << endl;

template <class T> inline T bigmod(T p,T e,T M){
    LL ret = 1;
    for(; e > 0; e >>= 1){
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return (T)ret;
}
template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

}


/*********************************************************************\
   |--\        ---       /\        |-----------| -----   /-------|    |
   |   \        |       /  \       |               |    /             |
   |    \       |      /    \      |               |   |              |
   |     \      |     /      \     |               |   |----|         |
   |      \     |    / ------ \    |-------|       |        |-----|   |
   |       \    |   /          \   |               |              |   |
   |        \   |  /            \  |               |              /   |
  ---        -------            ------           ----- |---------/    |
                                                                      |
    codeforces = nfssdq  ||  topcoder = nafis007                      |
    mail = nafis_sadique@yahoo.com || nfssdq@gmail.com                |
    IIT,Jahangirnagar University(41)                                  |
                                                                      |
**********************************************************************/

#include <bits/stdc++.h>

using namespace std;

#define xx         first
#define yy         second
#define pb         push_back
#define mp         make_pair
#define LL         long long
#define inf        INT_MAX/3
#define mod        1000000007ll
#define PI         acos(-1.0)
#define linf       (1ll<<60)-1
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define REP(I,N)   FOR(I,0,N)
#define ALL(A)     ((A).begin(), (A).end())
#define set0(ar)   memset(ar,0,sizeof ar)
#define vsort(v)   sort(v.begin(),v.end())
#define setinf(ar) memset(ar,126,sizeof ar)

//cout << fixed << setprecision(20) << p << endl;

template <class T> inline T bigmod(T p,T e,T M){
    LL ret = 1;
    for(; e > 0; e >>= 1){
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return (T)ret;
}
template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}

vector < int > vc[100001], vp[100001], circuit;
int deg[100001], vis[500001], cnt[100001];
void dfs(int c){
    while(cnt[c] < vp[c].size()){
        int i = cnt[c];
        cnt[c]++;
        if(vis[ vp[c][i] ]) continue;
        vis[ vp[c][i] ] = 1;
        dfs(vc[c][i]);
    }
    circuit.pb(c);
}
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n, m;
    cin >> n >> m;
    REP(i, m){
        int x, y;
        cin >> x >> y;
        vc[x].pb(y);
        vc[y].pb(x);
        vp[x].pb(i);
        vp[y].pb(i);
        deg[x]++; deg[y]++;
    }
    int last = -1;
    FOR(i, 1, n+1){
        if(deg[i]%2 == 1) {
            if(last == -1) last = i;
            else {
                vc[last].pb(i);
                vc[i].pb(last);
                vp[i].pb(m);
                vp[last].pb(m);
                deg[last]++;
                deg[i]++;
                last = -1;
                m++;
            }
        }
    }
    if(m % 2 == 1){
        vc[1].pb(1);
        vc[1].pb(1);
        vp[1].pb(m);
        vp[1].pb(m);
        deg[1] += 2;
        m++;
    }
    dfs(1);
    cout << m << endl;
    for(int i = 1; i < circuit.size(); i += 2){
        cout << circuit[i - 1] << " " << circuit[i] << endl;
        cout << circuit[i + 1] << " " << circuit[i] << endl;
    }

}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

struct punkt{
    vector<pair<int, int>> e;
    int it;
} v[100005];

vector<pair<int, int>> ans;
bool used[500005];
int n, m, ecount;

void euler(int a) {
    while(v[a].it < v[a].e.size()) {
        pair<int, int> b = v[a].e[v[a].it];
        if(!used[b.second]) {
            used[b.second] = 1;
            euler(b.first);
            ans.emplace_back(a, b.first);
        }
        v[a].it++;
    }
}

void join(int a, int b) {
    v[a].e.emplace_back(b, ecount);
    v[b].e.emplace_back(a, ecount);
    ecount++;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for(int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        join(a, b);
    }
    vector<int> q;
    for(int i = 1; i <= n; i++)
        if(v[i].e.size()&1)
            q.push_back(i);

    for(int i = 0; i < q.size(); i+=2)
        join(q[i], q[i+1]);

    if(ecount & 1)
        join(1, 1);

    euler(1);
    cout << ecount << "\n";
    for(int i = 0; i < ans.size(); i++) {
        if(i&1)
            cout << ans[i].first << " " << ans[i].second << "\n";
        else
            cout << ans[i].second << " " << ans[i].first << "\n";
    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <set>

using namespace std;

typedef long long LL;
typedef pair<int,int> PP;

/*
    freopen("input","r",stdin);
    freopen("output","w",stdout);
*/

const int MAX_N = 400000;

int circuit[MAX_N];
int circuitpos;
vector<multiset<int> > G(MAX_N);

multiset<int>::iterator it;

void find_circuit(int n) {
    int i,j,k,m;
    if (G[n].size() == 0) {
        circuit[circuitpos] = n;
        circuitpos++;
    }
    else {
        while (G[n].size() != 0) {
            it = G[n].begin();
            m = (*it);
            G[n].erase(it);
            it = G[m].find(n);
            G[m].erase(it);
            find_circuit(m);
        }
        circuit[circuitpos] = n;
        circuitpos++;
    }
    return;
}

void find_euler_circuit() {
    memset(circuit,0,sizeof(circuit));
    circuitpos = 0;
    find_circuit(1);
    return;
}

int main() {
    ios::sync_with_stdio(false);

    // Start from 1

    int i,j,k,n,m,N,M,x,y;
    cin >> N >> M;

    for (i = 0;i < M;i++) {
        cin >> x >> y;
        G[x].insert(y);
        G[y].insert(x);
    }

    bool ok = 0;
    int pre = 0;

    for (i = 1;i <= N;i++) {
        if (G[i].size() % 2 == 1) {
            if (ok == 0) {
                ok = 1;
                pre = i;
            }
            else {
                ok = 0;
                G[pre].insert(i);
                G[i].insert(pre);
            }
        }
    }

    find_euler_circuit();

    ok = 0;

    if (circuitpos % 2 == 0) cout << circuitpos << endl;
    else cout << circuitpos - 1 << endl;

    for (int i = 0;i < circuitpos - 1;i++) {
        if (ok == 0) {
            ok = 1;
            cout << circuit[i] << ' ' << circuit[i + 1] << endl;
        }
        else {
            ok = 0;
            cout << circuit[i + 1] << ' ' << circuit[i] << endl;
        }
    }
    if (circuitpos % 2 == 0) {
        cout << circuit[0] << ' ' << circuit[0] << endl;
    }

    return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <set>

using namespace std;

typedef long long LL;
typedef pair<int,int> PP;

/*
    freopen("input","r",stdin);
    freopen("output","w",stdout);
*/

const int MAX_N = 400000;

int circuit[MAX_N];
int circuitpos;
vector<vector<int> > G(MAX_N);

void find_circuit(int n) {
    int i,j,k,m;
    if (G[n].size() == 0) {
        circuit[circuitpos] = n;
        circuitpos++;
    }
    else {
        while (G[n].size() != 0) {
            m = G[n][0];
            G[n].erase(G[n].begin());
            for (i = 0;i < G[m].size();i++) {
                if (G[m][i] == n) {
                    G[m].erase(G[m].begin() + i);
                    break;
                }
            }
            find_circuit(m);
        }
        circuit[circuitpos] = n;
        circuitpos++;
    }
    return;
}

void find_euler_circuit() {
    memset(circuit,0,sizeof(circuit));
    circuitpos = 0;
    find_circuit(1);
    return;
}

int main() {
    ios::sync_with_stdio(false);

    // Start from 1

    int i,j,k,n,m,N,M,x,y;
    cin >> N >> M;

    for (i = 0;i < M;i++) {
        cin >> x >> y;
        G[x].push_back(y);
        G[y].push_back(x);
    }

    bool ok = 0;
    int pre = 0;

    for (i = 1;i <= N;i++) {
        if (G[i].size() % 2 == 1) {
            if (ok == 0) {
                ok = 1;
                pre = i;
            }
            else {
                ok = 0;
                G[pre].push_back(i);
                G[i].push_back(pre);
            }
        }
    }

    find_euler_circuit();

    ok = 0;

    if (circuitpos % 2 == 0) cout << circuitpos << endl;
    else cout << circuitpos - 1 << endl;

    for (int i = 0;i < circuitpos - 1;i++) {
        if (ok == 0) {
            ok = 1;
            cout << circuit[i] << ' ' << circuit[i + 1] << endl;
        }
        else {
            ok = 0;
            cout << circuit[i + 1] << ' ' << circuit[i] << endl;
        }
    }
    if (circuitpos % 2 == 0) {
        cout << circuit[0] << ' ' << circuit[0] << endl;
    }

    return 0;
}


#include<stdio.h>
int main()
{
    int i,j,a[2],m=0,c=0,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        for(j=0;j<2;j++)
        {
            if(a[j]>a[j+1])
            m++;
            else
            c++;
        }
    }
    if(m>c)
    {
        printf("Mishka");
    }
    else if(m<c)
    {
        printf("Chris");
    }
    else
    printf("Friendship is magic!^^");
    return 0;
}


#include<stdio.h>
int main()
{
    int i,a,b,n,m=0,c=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d%d",&a,&b);
        if(a>b)
        m++;
        else
        c++;
    }
    if(m>c)
    {
        printf("Mishka");
    }
    else if(c>m)
    {
        printf("Chris");
    }
    else
    printf("Friendship is magic!^^");
    return 0;
}


#include<stdio.h>
int main()
{
    int i,j,a[2],m=0,c=0,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        for(j=0;j<2;j++)
        {
            if(a[i]>a[i+1])
            m++;
            else
            c++;
        }
    }
    if(m>c)
    {
        printf("Mishka");
    }
    else if(m<c)
    {
        printf("Chris");
    }
    else
    printf("Friendship is magic!^^");
    return 0;
}


#include<stdio.h>
int main()
{
    int i,j,a[2],m=0,c=0,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        for(j=0;j<2;j++)
        {
            if(a[i]>a[i+1])
            m++;
            else
            c++;
        }
    }
    if(m>c)
    {
        printf("Mishka");
    }
    else if(c>m)
    {
        printf("Chris");
    }
    else
    printf("Friendship is magic!^^");
    return 0;
}


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


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,sum;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        int a,b;
        scanf("%d%d",&a,&b);
        if(a==b)continue;
        if(a>b)sum++;
        else sum--;
    }
    if(sum>0)printf("Mishka");
    else if(sum<0)printf("Chris");
    else printf("Friendship is magic!^^");
}


#include<iostream>

using namespace std;

int n,a[105],b[105],m,s;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i]>>b[i];
		if(a[i]<b[i])s++;
		if(a[i]>b[i])m++;
	}
	if(s==m)cout<<"Friendship is magic!^^";
	if(s>m)cout<<"Chris";
	if(s<m)cout<<"Mishka";
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n,i,a,b,sa=0,sb=0;
	cin>>n;
	for (i=1;i<=n;i++){
		cin>>a>>b;
		if (a>b)sa++;else sb++;
	}
	if (sa>sb)cout<<"Mishka";
		else if (sa<sb)cout<<"Chris";
	        else cout<<"Friendship is magic!^^";
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n,a,b,score=0;
    cin>>n;
    for (int i=1; i<=n; i++)
    {
        cin>>a>>b;
        if (a>b) score++;
        if (a<b) score--;
    }
    if (score>0) cout<<"Mishka";
    if (score<0) cout<<"Chris";
    if (score==0) cout<<"Friendship is magic!^^";
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n,a,b,cnt=0;
    cin>>n;
    for(int i=1;i<=n;i++)
	{
        cin>>a>>b;
        if(a>b)
		{
			cnt++;
		}
        else if(a<b)
		{
			cnt--;
		}
    }
    if (cnt>0)
    {
		cout<<"Mishka";
	}
    else if(cnt<0)
    {
		cout<<"Chris";
	}
    else
    {
		cout<<"Friendship is magic!^^";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a,b,ans1=0,ans2=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a>>b;
		a>b?ans1++:a<b?ans2++:ans1=ans1;
	}
	ans1>ans2?puts("Mishka"):ans1<ans2?puts("Chris"):puts("Friendship is magic!^^");
    return 0;
}


#include <iostream>
using namespace std;
int main(){
    int n,a[1001][1001],i,j,ans=0,s=0,w=0;
	cin>>n;
	for(i=1;i<=n;i++){
	  for(j=1;j<=2;j++)
	cin>>a[i][j];
		if(a[i][1]>a[i][2]) ans++;
		if(a[i][1]==a[i][2]) s++;
		if(a[i][1]<a[i][2]) w++;
	}
    if(ans>s&&ans>w) cout<<"Mishka";
    if(s>ans&&s>w) cout<<"Friendship is magic!^^";
    if(w>ans&&w>s) cout<<"Chris";
}


/*如果Mishka是这场游戏的胜利者，仅输出一行"Mishka"（不含引号）。

如果Chris是这场游戏的胜利者，仅输出一行"Chris"（不含引号）。

如果这场游戏是平局，仅输出一行"Friendship is magic!^^"（不含引号）。*/
#include <iostream>
using namespace std;

int main(){
    short n;
    short m=0,c=0;
    cin>>n;
    short ms,cs;
    for(short i=0;i<n;i++){
        cin>>ms>>cs;
        if(ms>cs)m+=1;
        else if(ms<cs)c+=1;
    }
    if(m>c)cout<<"Mishka";
    else cout<<(m<c?"Chris":"Friendship is magic!^^");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,n,m;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>m>>c;
		if(m>c){
			a++;
		}
		if(m<c){
			b++;
		}
		if(m=c){
			a++;
			b++;
		}
	}
	if(a==b){
		cout<<"Friendship is magic!^^"<<endl;
		return 0;
	}
	if(a<b){
		cout<<"Chris"<<endl;
		return 0;
	}
	if(a>b){
		cout<<"Mishka"<<endl;
		return 0;
	}
	return 0;
}
/*#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,n,m;
int main(){
	for(int i=1;i<=n;i++){
		cin>>m>>c;
		if(m>c){
			a++;
		}
		if(m<c){
			b++;
		}
		if(m=c){
			a++;
			b++;
		}
	}
	if(a==b){
		cout<<"Friendship is magic!^^"<<endl;
		return 0;
	}
	if(a<b){
		cout<<"Chris"<<endl;
		return 0;
	}
	if(a>b){
		cout<<"Mishka"<<endl;
		return 0;
	}
	return 0;
}
#include<iostream>
using namespace std;
int main(){
	int n,m,c,ans;
	cin>>n;
	for (int i=1;i<=n;i++) {
		cin>>m>>c;
		if (m>c) ans++;
		if (m<c) ans--;
		if(m=c) ans+=0;
	}
	if (ans>(n/2)) cout<<"Mishka";
	if (ans<(n/2)) cout<<"Chris";
	else cout<<"Friendship is magic!^^";
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a,b,ans=0;
	cin>>n;
	for (int i=1;i<=n;i++) {
		cin>>a>>b;
		if (a>b) ans++;
		else if (a<b) ans--;
		else ans=ans;
	}
	if (ans>0) cout<<"Mishka";
	else if (ans<0) cout<<"Chris";
	else cout<<"Friendship is magic!^^";
}*/


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,a[1000],b[1000],c=0,d=0;
    cin>>n;
	for(int i=1;i<=n;i++)
		{
			cin>>a[i];
			cin>>b[i];
			c=a[i]+c;
			d=b[i]+d;
		}
	if(c>d)cout<<"Mishka";
	if(c<d)cout<<"Chris";
	else cout<<"Friendship is magic!^^";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,sum;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        int a,b;
        scanf("%d%d",&a,&b);
        if(a==b)continue;
        if(a>b)sum++;
        else sum--;
    }
    if(sum>0)printf("Mishka");
    else if(sum<0)printf("Chris");
    else printf("Friendship is magic!^^")
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,c,ms=0,cs=0;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
    	cin>>m>>c;
    	if(m>c)
    	{
    		ms++;
		}
		if(m<c)
		{
			cs++;
		}
	}
	if(ms>cs){
		cout<<"Mishka";
		return 0;
	}
	if(ms==cs)
	{
		cout<<"Friendship is magic!^^";
		return 0;
	}
	if(ms<cs)
	{
		cout<<"Chris";
		return 0;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,a[1000],b[1000],c=0,d=0;
	for(int i=1;i<=n;i++)
		{
			cin>>a[i];
			cin>>b[i];
			c=a[i]+c;
			d=b[i]+d;
		}
	if(c>d)cout<<"Mishka";
	if(c<d)cout<<"Chris";
	else cout<<"Friendship is magic!^^";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int x,y,a=0,b=0,n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d",&x,&y);
		if(x>y)
		{
			a++;
		}
		else
		{
			b++;
		}
	}
	if(a>b)
	{
		cout<<"Mishka\n";
		return 0;
	}
	if(a<b)
	{
		cout<<"Chris\n";
		return 0;
	}
	else
	{
		cout<<"Friendship is magic!^^\n";
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int x,y,cnt,M;
int main(){
    scanf("%d",&cnt);
    while(cnt--){
        scanf("%d%d",&x,&y);
        M += x>y?1:-1;
    }
    if(M > 0) puts("Mishka");
    else if(M == 0) puts("Friendship is magic!^^");
    else puts("Chris");
    return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int cntm=0,cntc=0;
	while(n--)
	{
		int m,c;
		cin >> m >> c;
		if(m>c) cntm++;
		else if(m<c) cntc++;
		else continue;
	}
	if(cntm>cntc) cout << "Mishka" << endl;
	else if(cntm<cntc) cout << "Chris" << endl;
	else cout << "Friendship is magic!^^" << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,ans1=0,ans2=0;
int main()
{
	scanf("%d",&n);
	int x1,x2;
	for (int i=1;i<=n;i++)
	{
		scanf("%d%d",&x1,&x2);
		if (x1>x2) ans1++;
		if (x2>x1) ans2++;
	}
	if (ans1>ans2) printf("Mishka");
	if (ans1==ans2) printf("Friendship is magic!^^");
	if (ans1<ans2) printf("Chris");
	return 0;
}


#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
int n,a,b,m,c,f;
int main(){
    ios::sync_with_stdio(false);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a>>b;
        if(a>b)m++;
        if(a<b)c++;
    }
    if(m>c) cout<<"Mishka";
    else if(m<c) cout<<"Chris";
    else if(m==c) cout<<"Friendship is magic!^^";
    return 0;
}


#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
	int n,a[2]={0};
	cin >> n;
	while(n--)
	{
		int m,c;
		cin >> m >> c;
		if(m>c)
		a[0]++;
		else a[1]++;
	}
	if(a[0]>a[1]) cout << "Mishka" << endl;
	else if(a[0]<a[1]) cout << "Chris" << endl;
	else cout << "Friendship is magic!^^" << endl;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n;
int a,b;
int num1,num2;
int main(){
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a>>b;
        if(a>b) num1++;
        else if(a<b) num2++;
    }
    if(num1-num2>0) cout<<"Mishka"<<endl;
    else if(num1-num2<0) cout<<"Chris"<<endl;
    else cout<<"Friendship is magic!^^";
}


#include <bits/stdc++.h>
using namespace std;
long long n,m,k,t,i,s;
int main(){
	cin>>n;
	s=t=0;
	for(i=1;i<=n;i++){
		cin>>m>>k;
		if(m>k) s++;
		else if(k>m) t++;
	}

	if(s>t) cout<<"Mishka";
		else if(t>s) cout<<"Chris";
				else cout<<"Friendship is magic!^^";
	return 0;
 }


#include<iostream>
#include<cstring>
#include<queue>
#include<cstdlib>
#include<utility>
#include<vector>
#include<cmath>
#include<stack>
using namespace std;
int main()
{
	int a,b,c,e=0,f=0;
	cin>>a;
	for(int d=0;d<a;d++)
	{
		cin>>b>>c;
		b>c?e++:b==c?:f++;
	}
	e>f?cout<<"Mishka":e==f?cout<<"Friendship is magic!^^":cout<<"Chris";
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int Mishka,Chris;
    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        if(a>b)Mishka++;
        else if(a<b)Chris++;
    }
    if(Mishka>Chris)cout<<"Mishka";
    else if(Mishka<Chris)cout<<"Chris";
    else if(MIshka==Chris)cout<<"Friendship is magic!^^";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
   int n,M=0,C=0;
   cin>>n;
   for(int i=1;i<=n;i++)
   {
   	  int m,c;
   	  cin>>m>>c;
   	  if(m>c) M++;
   	  else if(m<c) C++;
   }
   if(M>C) cout<<"Mishka";
   if(M<C) cout<<"Chris";
   else cout<<"Friendship is magic!^^";
   return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a,b,m,ansb,ansa;
int main(){
    cin>>m;
    while(m--){
        cin>>a>>b;
        if(a>b) ansa++;
        else ansb++;
    }if(ansa>ansb) cout<<"Mishka";
    else if(ansa==ansb) cout<<"Friendship is magic!^^";
    else cout<<"Chris";
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n,i,a,b,sa=0,sb=0;
	cin>>n;
	for (i=1;i<=n;i++){
		cin>>a>>b;
		if (a>b)sa++;
		if (a<b)sb++;
	}
	if (sa>sb)cout<<"Mishka";
		else if (sa<sb)cout<<"Chris";
	        else cout<<"Friendship is magic!^^";
    return 0;
}


#include<cstdio>
using namespace std;
int main()
{
	int b,c;
	int s1=0,s2=0,a;
	scanf("%d",&a);
	for(int i=1;i<=a;i++)
	{
		scanf("%d%d",&b,&c);
		if(b>c)
		{
			s1++;
		}
		else if(c>b)
		{
			s2++;
		}
		else if(c==b)
		{
			s1++;
			s2++;
		}
	}
	if(s1>s2)
	{
		printf("Mishka");
	}
	if(s2==s1)
	{
		printf("Friendship is magic!^^");
	}
	if(s2>s1)
	{
		printf("Chris");
	}
	return 0;
}


#include<cstdio>
#include<iostream>
#include<cstring>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<ctime>
#define LL long long
#define inf 0x7ffffff
#define pa pair<int,int>
#define pi 3.1415926535897932384626433832795028841971
using namespace std;
inline LL read()
{
    LL x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
inline void write(LL a)
{
    if (a<0){printf("-");a=-a;}
    if (a>=10)write(a/10);
    putchar(a%10+'0');
}
inline void writeln(LL a){write(a);printf("\n");}
int n,a,b;
int main()
{
    n=read();
    for (int i=1;i<=n;i++)
    {
        int x=read(),y=read();
        if (x>y)a++;
        if (x<y)b++;
    }
    if (a>b)
    printf("Mishka\n");
    else if (a==b)printf("Friendship is magic!^^");
    else printf("Chris");
}


#include <iostream>
using namespace std;
long long s1,s2;
int main(){
	int i,j,k,n;
	cin>>n;
	for(i=1;i<=n;i++){
		int a,b;
		cin>>a>>b;
		if(a>b)s1++;
		if(a<b)s2++;
	}
	if(s1>s2)cout<<"Mishka"<<endl;
	if(s1<s2)cout<<"Chris"<<endl;
	if(s1==s2)cout<<"Friendship is magic!^^"<<endl;
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
	int a, b, n, as = 0, bs = 0;
	cin >> n;
	for(int i = 0; i < n; ++i)
	{
		cin >> a >> b;
		as += a;
		bs += b;
	}
	if(as == bs)	cout << "Friendship is magic!^^";
	else if(as > bs)	cout << "Mishka";
	else if(as < bs)	cout << "Chris";
	return 0;
}


#include<iostream>
using namespace std;
int main(){
	int a,b,c,d=0,e=0;
	cin>>a;
	for(int i=1;i<=a;i++){
		cin>>b>>c;
		if(b>c){
			d++;
		}else{
			if(c>b){
				e++;
			}
		}
	}
	if(d>e){
		cout<<"Mishka";
	}
	if(d<e){
		cout<<"Chris";
	}
	if(d==e){
		cout<<"Friendship is magic!^^";
	}
	return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,cnt=0,ans=0;
	cin>>n;
	for(int i=0;i<n;i++){
		int a,b;
		if(a>b) cnt++;
		if(b>a) ans++;
	}
	if(cnt>ans) cout<<"Mishka\n";
	if(ans>cnt) cout<<"Chris\n";
	if(ans==cnt) cout<<"Friendship is magic!^^\n";
	return 0;
}


#include<iostream>
using namespace std;
int main(){
	int n,a,b,cnt=0;
	cin>>n;
	for (int i=1;i<=n;i++) {
		cin>>a>>b;
		if (a>b) cnt++;
		else if (a<b) cnt--;
		else cnt=cnt;
	}
	if (cnt>0) cout<<"Mishka";
	else if (cnt<0) cout<<"Chris";
	else cout<<"Friendship is magic!^^";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int c,m,n,C,M,P;
  cin>>n;
  for(int i=1;i<=n;i++)
  {
  	cin>>m>>c;
  	if(m>c) M++;
  	if(c>m) C++;
  	if(m==c) P++;
  }
  if(M>C) cout<<"Mishka";
  if(C>M) cout<<"Chris";
  if(M==C||P==n) cout<<"Friendship is magic!^^";
  return 0;
}


/*#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,n,m;
int main(){
	for(int i=1;i<=n;i++){
		cin>>m>>c;
		if(m>c){
			a++;
		}
		if(m<c){
			b++;
		}
		if(m=c){
			a++;
			b++;
		}
	}
	if(a==b){
		cout<<"Friendship is magic!^^"<<endl;
		return 0;
	}
	if(a<b){
		cout<<"Chris"<<endl;
		return 0;
	}
	if(a>b){
		cout<<"Mishka"<<endl;
		return 0;
	}
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,n,m;
int main(){
	for(int i=1;i<=n;i++){
		cin>>m>>c;
		if(m>c){
			a++;
		}
		if(m<c){
			b++;
		}
		if(m=c){
			a++;
			b++;
		}
	}
	if(a==b){
		cout<<"Friendship is magic!^^"<<endl;
		return 0;
	}
	if(a<b){
		cout<<"Chris"<<endl;
		return 0;
	}
	if(a>b){
		cout<<"Mishka"<<endl;
		return 0;
	}
	return 0;
}*/
#include<iostream>
using namespace std;
int main(){
	int n,m,c,ans;
	cin>>n;
	for (int i=1;i<=n;i++) {
		cin>>m>>c;
		if (m>c) ans++;
		if (m<c) ans--;
		if(m=c) ans+=0;
	}
	if (ans>(n/2)) cout<<"Mishka";
	if (ans<(n/2)) cout<<"Chris";
	else cout<<"Friendship is magic!^^";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,x,y,c=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>x>>y;
		if(x>y) c++;
		else c--;
	}
	if(c>0) cout<<"Mishka"<<endl;
	else if(c<0) cout<<"Chris"<<endl;
	else cout<<"Friendship is magic!^^"<<endl;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;
int m,c,a,s;
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>m>>c;
		if(m>c)a++;
		else if(m<c)s++;
	}
	if(a>s)cout<<"Mishka";
	if(a<s)cout<<"Chris";
	if(a==s)cout<<"Friendship is magic!^^";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int x,y,num1=0,num2=0,n,i;
	cin>>n;
	for (i=1;i<=n;i++)
	{
		cin>>x>>y;
		if (x<y) num1++;
		if (x>y) num2++;
	}
	if (num1>num2) cout<<"Mishka";
	if (num1<num2) cout<<"Chris";
	if (num1==num2) cout<<"Friendship is magic!^^";
	return 0;
}


#include <bits/stdc++.h>

using namespace std ;

int main (){
	int n;
	cin >> n;
	int num=0;
	int num1=0;
	for (int i=0 ;i<n; i++){
		int a[2];
		cin >> a[0];
		cin >> a[1];
		if (a[0]>a[1]){
			num++;
		}
		if (a[1]>a[0]){
			num1++;
		}
		else {
			num1++;
			num++;
		}
	}
	if (num1>num){
		cout << "Chris";
	}
	if (num>num1){
		cout << "Mishka";
	}
	else {
		cout << "Friendship is magic!^^";
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main (){
	int n;
	cin >> n;
	int a[n][2];
	int win=0;
	for (int i=0;i<=n;i++){
		char n[2];
		cin >> n;
		if (n[0]>n[1]){
			win++;
		}
		if (n[1]>n[0]){
			win=win-1;
		}
	}
	if (win>0){
		cout << "Mishka";
	}
	if (win<0){
		cout << "Chris";
	}
	if (win=0){
		cout << "Friendship is magic!^^";
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std ;

int main (){
	int n;
	cin >> n;
	int num=0;
	int num1=0;
	for (int i=0 ;i<n; i++){
		int a[2];
		cin >> a[0];
		cin >> a[1];
		if (a[0]>a[1]){
			num++;
		}
		if (a[1]>a[0]){
			num1++;
		}
	}
	if (num1>num){
		cout << "Chris";
	}
	if (num>num1){
		cout << "Mishka";
	}
	else {
		cout << "Friendship is magic!^^";
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std ;

int main (){
	int n;
	cin >> n;
	int num=0;
	int num1=0;
	for (int i=0;i<n; i++){
		int a[2];
		cin >> a[0];
		cin >> a[1];
		if (a[0]>a[1]){
			num++;
		}
		if (a[1]>a[0]){
			num1++;
		}
//		else {
//			num1++;
//			num++;
//		}
	}
	if (num1>num){
		cout << "Chris";
	}
	if (num>num1){
		cout << "Mishka";
	}
	if (num1==num){
		cout << "Friendship is magic!^^";
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std ;

int main (){
	int n;
	cin >> n;
	int num=0;
	int num1=0;
	for (int i=0 ;i<n; i++){
		int a[2];
		cin >> a[0];
		cin >> a[1];
		if (a[0]>a[1]){
			num++;
		}
		if (a[1]>a[0]){
			num1++;
		}
		else {
			num1+=0;
		}
	}
	if (num1>num){
		cout << "Chris";
	}
	if (num>num1){
		cout << "Mishka";
	}
	else {
		cout << "Friendship is magic!^^";
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std ;

int main (){
	int n;
	cin >> n;
	int num=0;
	int num1=0;
	for (int i=0 i<n; i++){
		int a[2];
		cin >> a[0];
		cin >> a[1];
		if (a[0]>a[1]){
			num++;
		}
		if (a[1]>a[0]){
			num1++;
		}
	}
	if (num1>num0){
		cout << "Chris";
	}
	if (num0>num1){
		cout << "Mishka"
	}
	else {
		cout << "Friendship is magic!^^"
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main (){
	int n;
	cin >> n;
	int a[n][2];
	int win=1;
	for (int i=0;i<=n;i++){
		char n[2];
		cin >> n;
		if (n[0]>n[1]){
			win++;
		}
		if (n[1]>n[0]){
			win--;
		}
	}
	if (win>0){
		cout << "Mishka";
	}
	if (win<0){
		cout << "Chris";
	}
	if (win=0){
		cout << "Friendship is magic!^^";
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std ;

int main (){
	int n;
	cin >> n;
	int num=0;
	int num1=0;
	for (int i=0;i<n; i++){
		int a[2];
		cin >> a[0];
		cin >> a[1];
		if (a[0]>a[1]){
			num++;
		}
		if (a[1]>a[0]){
			num1++;
		}
//		else {
//			num1++;
//			num++;
//		}
	}
	if (num1>num){
		cout << "Chris";
	}
	if (num>num1){
		cout << "Mishka";
	}
	if (num1=num){
		cout << "Friendship is magic!^^";
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main (){
	int n;
	cin >> n;
	int a[n][2];
	int win=0;
	for (int i=0;i<=n;i++){
		char n[2];
		cin >> n;
		if (n[0]>n[1]){
			win++;
		}
		if (n[1]>n[0]){
			win--;
		}
	}
	if (win>0){
		cout << "Mishka";
	}
	if (win<0){
		cout << "Chris";
	}
	if (win=0){
		cout << "Friendship is magic!";
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main (){
	int n;
	cin >> n;
	int a[n][2];
	int win=0;
	for (int i=0;i<=n;i++){
		char n[2];
		cin >> n;
		if (n[0]>n[1]){
			win++;
		}
		if (n[1]>n[0]){
			win--;
		}
	}
	if (win>0){
		cout << "Mishka";
	}
	if (win<0){
		cout << "Chris";
	}
	if (win=0){
		cout << "Friendship is magic!^^";
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, m = 0, c = 0; cin >> n;
	while (n--) {
		int a, b; cin >> a >> b;
		if (a > b) m++;
		if (b > a) c++;
	}
	cout << ((m == c)? "Friendship is magic!^^" : (m > c)? "Mishka" : "Chris") << endl;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n,x,y;
    cin>>n;
    int num1=0,num2=0;
    for(int i=0;i<n;i++)
    {
        cin>>x>>y;
        if(x>y)
            num1++;
        else
            num2++;
    }
    if(num1>num2)
        cout<<"Mishka"<<endl;
    else if(num1<num2)
        cout<<"Chris"<<endl;

    else
        cout<<"Friendship is magic!^^"<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n,x,y;
    cin>>n;
    int num1=0,num2=0;
    while(n--)
    {
        cin>>x>>y;
        if(x>y)
            num1++;
        else
            num2++;
    }
    if(num1>num2)
        cout<<"Mishka"<<endl;
    else if(num1==num2)
        cout<<"Friendship is magic!^^"<<endl;
    else
        cout<<"Chris"<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n,x,y;
    cin>>n;
    int num1=0,num2=0;
    while(n--)
    {
        cin>>x>>y;
        if(x>y)
            num1++;
        else
            num2++;
    }
    if(num1>num2)
        cout<<"Mishka"<<endl;
    else if(num1<num2)
        cout<<"Chris"<<endl;

    else
        cout<<"Friendship is magic!^^"<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n,x,y;
    cin>>n;
    int num=0;
    while(n--)
    {
        cin>>x>>y;
        num+=(x>y?1:-1);
    }
    if(num>0)
        cout<<"Mishka"<<endl;
    else if(num==0)
        cout<<"Friendship is magic!^^"<<endl;
    else
        cout<<"Chris"<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
int n,i,j=0,k=0;
cin>>n;
int m[n],p[n];
for(i=0;i<n;i++)
{
  cin>>m[i]>>p[i];
  if(m[i]>p[i])
{
  j++;
}
else
{
 k++;

}

if(j>k)
{
 cout<<"Mishka";
}

else if(j==k)
{

  cout<<"Friendship is magic!^^";
}
else if(k>j)
cout<<"Chris";

return 0;
}


#include<iostream>
using namespace std;
int main()
{
int n,i,j=0,k=0;
cin>>n;
int m[n],p[n];
for(i=0;i<n;i++)
{
  cin>>m[i]>>p[i];
  if(m[i]>p[i])
{
  j++;
}
else
{
 k++;

}
}
if(j>k)
{
 cout<<"Mishka";
}

else if(j==k)
{

  cout<<"Friendship is magic!^^";
}
else if(k>j)
cout<<"Chris";

return 0;
}


#include<iostream>
using namespace std;
int main()
{
int n,i,j=0;
cin>>n;
int m[n],p[n];
for(i=0;i<n;i++)
{
  cin>>m[i]>>p[i];
  if(m[i]>p[i])
{
  j++;
}

}

if(j>n/2)
{
 cout<<"Mishka";
}

else if(n%2==0)
{
if(j==n/2)
{
  cout<<"Friendship is magic!^^";
}
}
else
cout<<"Chris";

return 0;
}


#include<iostream>
using namespace std;
int main()
{
int n,i,j=0;
cin>>n;
int m[n],p[n];
for(i=0;i<n;i++)
{
  cin>>m[i]>>p[i];
  if(m[i]>p[i])
{
  j++;
}

}

if(j>n/2)
{
 cout<<"Mishka";
}

else if(j==n/2)
{
  cout<<"Friendship is magic!^^";
}

else
cout<<"Chris";

return 0;
}


#include<iostream>
using namespace std;
int main()
{
int n,i,j=0,k=0;
cin>>n;
int m[n],p[n];
for(i=0;i<n;i++)
{
  cin>>m[i]>>p[i];
  if(m[i]>p[i])
{
  j++;
}
else if(m[i]<p[i])
{
 k++;

}
}
if(j>k)
{
 cout<<"Mishka";
}

else if(j==k)
{

  cout<<"Friendship is magic!^^";
}
else if(k>j)
cout<<"Chris";

return 0;
}


#include<iostream>
using namespace std;
int main()
{
int n,i,j=0;
cin>>n;
int m[n],p[n];
for(i=0;i<n;i++)
{
  cin>>m[i]>>n[i];
  if(m[i]>n[i])
{
  j++;
}

}

if(j>n/2)
{
 cout<<"Mishka";
}

else if(j==n/2)
{
  cout<<"Friendship is magic!^^";
}

else
cout<<"Chris";

return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int a[100],b[100],m=0,n=0,tc,i;

    while(scanf("%d",&tc)==1)
    {
        for(i=0;i<tc;i++)
        {
            cin>>a[i]>>b[i];

            if(a[i]>b[i])
                m++;
            else if(a[i]<b[i])
                n++;

        }

 if(m>n)
    cout<<"Mishka\n";
 else if(m<n)
    cout<<"Chris\n";
 else
    cout<<"Friendship is magic^^\n";

    }

return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main()
{
  int n;
  cin>>n;
  int m[n],c[n],M=0,C=0;
  for(int i=0;i<n;i++)
  {
      cin>>m[i]>>c[i];
      if(m[i]>c[i])
        ++M;
      else if(m[i]<c[i])
        ++C;
  }
  if(M>C)
    cout<<"Mishka\n";
  else if(M<C)
    cout<<"Chris\n";
  else
    cout<<"Friendship is magic!^^\n";
  return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int a[100],b[100],m=0,n=0,tc,i;

    while(scanf("%d",&tc)==1)
    {
        for(i=0;i<tc;i++)
        {
            cin>>a[i]>>b[i];

            if(a[i]>b[i])
                m++;
            else if(a[i]<b[i])
                n++;

        }

 if(m>n)
    cout<<"Mishka\n";
 else if(m<n)
    cout<<"Chris\n";
 else
    cout<<"Friendship is magic!^^\n";

    }

return 0;

}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[100],b[100],tc,sum,bum,i;
    while(scanf("%d",&tc)==1)
    {
        for(i=0;i<tc;i++)
        {
            scanf("%d%d",&a[i],&b[i]);

            if(a[i]>b[i])
                ++sum;
            else if(a[i]<b[i])
                ++bum;

        }

    if(sum>bum)
        printf("Mishka\n");
    else if(sum<bum)
        printf("Chris\n");
    else if(sum==bum)
        printf("Friendship is magic!^^\n");

    }
   return 0;
}


#include<stdio.h>
int main()
{
    int a,b,tc,sum=0,bum=0,i;

    while(scanf("%d",&tc)==1)
    {
        for(i=0;i<tc;i++)
        {
            scanf("%d%d",&a,&b);

            sum=sum+a;
            bum=bum+b;

        }

    if(sum>bum)
                printf("Mishka\n");

            else if(sum<bum)
                printf("Chris\n");
            else if(sum==bum)
                printf("Friendship is magic!^^\n");

    }

return 0;

}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[100],b[100],tc,sum,bum,i;
    while(scanf("%d",&tc)==1)
    {
        for(i=0;i<tc;i++)
        {
            scanf("%d%d",&a[i],&b[i]);

            if(a[i]>b[i])
                ++sum;
            else if(a[i]<b[i])
                ++bum;
        }

    if(sum>bum)
        printf("Mishka\n");
    else if(bum>sum)
        printf("Chris\n");
    else
        printf("Friendship is magic!^^\n");

    }
   return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
main(){
	    int i=0,a=0,b=0,n=0,m=0,t=0;
	    cin>>t;
	    for(i=0;i<t;i++){

	    	cin>>n>>m;
	    	if(n>m){ a++; } else { b++;}

	    	}

	if(a>b){ cout<<"Mishka"<<endl;}
	else if(a<b){ cout<<"Chris"<<endl; }
	else {  cout<<"Friendship is magic!^^"<<endl;}

}


#include<iostream>
using namespace std;
main(){
           int i=0,j=0,n=0,m=0,t=0,k=0,b=0,c=0;
           cin>>n;
           for(i=0;i<n;i++){
           for(j=0;j<n;j++){
                       cin>>b;
                       cin>>c;
                        if(b>c){t++;} else {k++;}
                     }}

		      if(t>k){ cout<<"Mishka"<<endl; } else if(t==k) { cout<<"Friendship is magic!^^"<<endl; }
				else { cout<<"Chris"<<endl; }

      }


#include<iostream>
using namespace std;
main(){
           int i=0,j=0,n=0,m=0,t=0,k=0;
           cin>>n;
           for(i=0;i<n;i++){
           for(j=0;j<n;j++){
                        if(i>j){t++;} else {k++;}
                     }}

		      if(t>k){ cout<<"Mishka"<<endl; } else if(t==k) { cout<<"Friendship is magic!^^"<<endl; }
				else { cout<<"Chris"<<endl; }

      }


#include<iostream>
#include<algorithm>
using namespace std;
main(){
	    long long i=0,a=0,b=0,n=0,m=0,t=0;
	    cin>>t;
	    for(i=0;i<t;i++){

	    	cin>>n>>m;
	    	if(n>m){ a++; } else if(m>n) { b++;}

	    	}

	if(a>b){ cout<<"Mishka"<<endl;}
	else if(a<b){ cout<<"Chris"<<endl; }
	else {  cout<<"Friendship is magic!^^"<<endl;}

}


#include<iostream>
#include<algorithm>
using namespace std;
main(){
	    long long i=0,a=0,b=0,n=0,m=0,t=0;
	    cin>>t;
	    for(i=0;i<t;i++){

	    	cin>>n>>m;
	    	if(n>m){ a++; } else { b++;}

	    	}

	if(a>b){ cout<<"Mishka"<<endl;}
	else if(a<b){ cout<<"Chris"<<endl; }
	else {  cout<<"Friendship is magic!^^"<<endl;}

}


#include<iostream>
using namespace std;
main(){
           int i=0,j=0,n=0,m=0,t=0,k=0;
           cin>>n;
           for(i=0;i<n;i++){
           for(j=0;j<n;j++){
                        if(i>j){t++;} else {k++;}
                     }}

		      if(t>k){ cout<<"Chris"<<endl;  } else if(t==k) { cout<<"Friendship is magic!^^"<<endl; }
				else { cout<<"Mishka"<<endl;}

      }


#include <iostream>
using namespace std;
int main()
{
int x;
int a,b;
int ca=0;
int cb=0;
cin>>x;
for(int i=0;i<x;i++)
{
cin>>a>>b;
if(a>b)
{
    ca=ca+1;
}
else
{
    cb=cb+1;
}
}
if(ca>cb)
{
    cout<<"Mishka"<<endl;
}
else if(cb>ca)
{
    cout<<"Chris"<<endl;
}
else if(cb=ca)
{
    cout<<"Friendship is magic!^^"<<endl;
}
}


#include <iostream>
using namespace std;
int main()
{
int x;
int a,b;
int ca=0;
int cb=0;
cin>>x;
for(int i=0;i<x;i++)
{
cin>>a>>b;
if(a>b)
{
    ca=ca+1;
}
else if (b>a)
{
    cb=cb+1;
}
}
if(ca>cb)
{
    cout<<"Mishka"<<endl;
}
else if(cb>ca)
{
    cout<<"Chris"<<endl;
}
else if(cb=ca)
{
    cout<<"Friendship is magic!^^"<<endl;
}
}


#include <iostream>
using namespace std;
int main()
{
int x;
long long a,b;
long long ca=0;
long long cb=0;
cin>>x;
for(int i=0;i<x;i++)
{
cin>>a>>b;
if(a>b)
{
    ca=ca+1;
}
else if (b>a)
{
    cb=cb+1;
}
}
if(ca>cb)
{
    cout<<"Mishka"<<endl;
}
else if(cb>ca)
{
    cout<<"Chris"<<endl;
}
else
{
    cout<<"Friendship is magic!^^"<<endl;
}
}


#include <iostream>
using namespace std;
int main()
{
int x;
int a,b;
int ca=0;
int cb=0;
cin>>x;
for(int i=0;i<x;i++)
{
cin>>a>>b;
if(a>=b)
{
    ca=ca+1;
}
else
{
    cb=cb+1;
}
}
if(ca>cb)
{
    cout<<"Mishka"<<endl;
}
else if(cb>ca)
{
    cout<<"Chris"<<endl;
}
else if(cb=ca)
{
    cout<<"Friendship is magic!^^"<<endl;
}
}


#include <iostream>
using namespace std;
int main()
{
int x;
long long a,b;
long long ca=0;
long long cb=0;
cin>>x;
for(int i=0;i<x;i++)
{
cin>>a>>b;
if(a>b)
{
    ca=ca+1;
}
else if (b>a)
{
    cb=cb+1;
}
}
if(ca>cb)
{
    cout<<"Mishka"<<endl;
}
else if(cb>ca)
{
    cout<<"Chris"<<endl;
}
else if(cb=ca)
{
    cout<<"Friendship is magic!^^"<<endl;
}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,i,c1=0,c2=0;
  pair<int,int>a[100];
  cin>>n;
  for(i=0;i<n;i++)
  {
      cin>>a[i].first>>a[i].second;
  }
  for(i=0;i<n;i++)
  {
      if(a[i].first>a[i].second)
        c1++;
      else
        c2++;
  }
  if(c1>c2)
    cout<<"Mishka"<<endl;
  else if(c1<c2)
    cout<<"Chris"<<endl;
  else
    cout<<"Friendship is magic!^^"<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,i,c1=0,c2=0;
  pair<int,int>a[100];
  cin>>n;
  for(i=0;i<n;i++)
  {
      cin>>a[i].first>>a[i].second;
  }
  for(i=0;i<n;i++)
  {
      if(a[i].first>a[i].second)
        c1++;
      else if(a[i].first<a[i].second)
        c2++;
  }
  if(c1>c2)
    cout<<"Mishka"<<endl;
  else if(c1<c2)
    cout<<"Chris"<<endl;
  else
    cout<<"Friendship is magic!^^"<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,i,a,b,c1=0,c2=0;
  cin>>n;
  while(n--)
  {
      cin>>a>>b;
      if(a>b)
        c1++;
      else if(a<b)
        c2++;
  }
  if(c1==c2)
    cout<<"Friendship is magic!^^"<<endl;
  if(c1>c2)
    cout<<"Mishka"<<endl;
  if(c1<c2)
    cout<<"Chris"<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,i,a,b,c1=0,c2=0;
  cin>>n;
  while(n--)
  {
      cin>>a>>b;
      if(a>b)
        c1++;
      else
        c2++;
  }
  if(c1==c2)
    cout<<"Friendship is magic!^^"<<endl;
  if(c1>c2)
    cout<<"Mishka"<<endl;
  if(c1<c2)
    cout<<"Chris"<<endl;
}


#include <iostream>

using namespace std;

int main()
{
    int arr[100][100],n,i,j,sum1=0,sum2=0;
    cin >>n;
    for(i=0; i<n; i++)
    {

        for(j=0; j<2; j++)
        {
            cin >>arr[i][j];

        }
    }

    for(i=0; i<n; i++)
    {

        for(j=0; j<2; j++)
        {
            if(j==0){
                sum1=sum1+arr[i][j];
            }
            else if(j==1)
            {
                sum2=sum2+arr[i][j];
            }

        }
    }
    if(sum1>sum2)
    {
        cout << "Mishka";
    }
    else if(sum1<sum2)
    {
        cout <<"Chris";
    }
    else if(sum1==sum2)
    {
        cout<<"Friendship is magic!^^";
    }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int arr[100][100],n,i,j,sum1=0,sum2=0;
    cin >>n;
    for(i=0; i<n; i++)
    {

        for(j=0; j<2; j++)
        {
            cin >>arr[i][j];

        }
    }

    for(i=0; i<n; i++)
    {

        for(j=0; j<2; j++)
        {
            if(arr[i][j]==arr[i][0]){
                sum1=sum1+arr[i][j];
                cout<<sum1;
                cout<<"\n";
            }
            else if(arr[i][j]==arr[i][1])
            {
                sum2=sum2+arr[i][j];
                cout<<sum2;
                cout<<"\n";

            }

        }
    }
    cout<<"sum1 is\n"<<sum1;
    cout<<"sum2 is\n"<<sum2;
    if(sum1>sum2)
    {
        cout << "Mishka";
    }
    else if(sum1<sum2)
    {
        cout <<"Chris";
    }
    else if(sum1==sum2)
    {
        cout<<"Friendship is magic!^^";
    }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int arr[101][101],n,i,j,sum1=0,sum2=0;
    cin >>n;
    for(i=0; i<n; i++)
    {

        for(j=0; j<2; j++)
        {
            cin >>arr[i][j];

        }
    }

    for(i=0; i<n; i++)
    {

        for(j=0; j<1; j++)
        {
  if(arr[i][0]>arr[i][1]){

    sum1++;
  }
if(arr[i][0]<arr[i][1]){

    sum2++;
  }
        }
    }
    if(sum1>sum2)
    {
        cout << "Mishka";
    }
    else if(sum1<sum2)
    {
        cout <<"Chris";
    }
    else if(sum1==sum2)
    {
        cout<<"Friendship is magic!^^";
    }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int arr[101][101],n,i,j,sum1=0,sum2=0;
    cin >>n;
    for(i=0; i<n; i++)
    {

        for(j=0; j<2; j++)
        {
            cin >>arr[i][j];

        }
    }

    for(i=0; i<n; i++)
    {

        for(j=0; j<2; j++)
        {
            if(j==0){
                sum1++;
            }
            else if(j==1)
            {
                sum2++;
            }

        }
    }
    if(sum1>sum2)
    {
        cout << "Mishka";
    }
    else if(sum1<sum2)
    {
        cout <<"Chris";
    }
    else if(sum1==sum2)
    {
        cout<<"Friendship is magic!^^";
    }

    return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
   int m=0;
   int c=0;
   int n;
   cin>>n;
   int l1,l2;
   for(int i=0;i<n;i++)
   {
       cin>>l1;
       cin>>l2;
       if(l1<l2)
       {
           c++;
       }
       else{
        m++;
       }
   }
   if(m>c) cout<<"Mishka";
   if(m<c) cout<<"Chris";
   if(m==c)cout<<"Friendship is magic!^^";
  return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
   int m=0;
   int c=0;
   int n;
   cin>>n;
   int l1,l2;
   for(int i=0;i<n;i++)
   {
       cin>>l1;
       cin>>l2;
       if(l1<l2)
       {
           c++;
       }
       else{
        m++;
       }
   }
   if(m>c) cout<<"Mishka";
   if(m<c) cout<<"Chris";
   if(m==c)cout<<"Friendship is magic!";
  return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
   int m=0;
   int c=0;
   int n;
   cin>>n;
   int l1,l2;
   for(int i=0;i<n;i++)
   {
       cin>>l1;
       cin>>l2;
       if(l1<l2)
       {
           c++;
       }
       else{
        m++;
       }
   }
   if(m>c) cout<<"Mishka";
   else {cout<<"Chris";}
   if(m==c) {cout<<"Friendship is magic!";}
  return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
   int m=0;
   int c=0;
   int n;
   cin>>n;
   int l1,l2;
   for(int i=0;i<n;i++)
   {
       cin>>l1;
       cin>>l2;
       if(l1<l2)
       {
           c++;
       }
       else{
        m++;
       }
   }
   if(m>c) cout<<"Mishka";
   else {cout<<"Chris";}
   if(m==c) cout<<"Friendship is magic!";
  return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
   int m=0;
   int c=0;
   int n;
   cin>>n;
   int l1,l2;
   for(int i=0;i<n;i++)
   {
       cin>>l1;
       cin>>l2;
       if(l1<l2)
       {
           c++;
       }
       if(l1>l2){
        m++;
       }
   }
   if(m>c) cout<<"Mishka";
   if(m<c) cout<<"Chris";
   if(m==c)cout<<"Friendship is magic!^^";
  return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <utility>
#include <bitset>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>

using namespace std;

typedef unsigned un;
typedef long long lol;
typedef unsigned char uchar;
typedef unsigned long long ulol;
typedef pair<int,int> pii;
typedef map<int,int> mii;

#define pf printf
#define sf scanf
#define pause system("pause")
#define pmin int,vector<int>,greater<int>
#define checkBit(n,p) (bool)(n&(1<<p))
#define setBit(n,p) (n|=(1<<p))
#define resetBit(n,p) (n&=~(1<<p))
#define toggleBit(n,p) (n^=1<<p)
#define mp(x,y) make_pair(x,y)
#define pb push_back
#define fi first
#define se second
#define init(arr,start,end,val) memset(arr+start,val,(end-start+1)*sizeof(arr[0]))
#define CMAX 127
#define UCMAX 255
#define SMAX 32767
#define USMAX 65535
#define IMAX 2147483647
#define UMAX 4294967295u
#define LMAX 9223372036854775807ll
#define ULMAX 18446744073709551615llu
#define M256 65000000
#define M512 125000000
#define PI acos(-1.0)
#define gcd(x,y) __gcd((lol)abs(x),(lol)abs(y))
#define lcm(x,y) abs(x)/__gcd((lol)abs(x),(lol)abs(y))*abs(y)
#define sqr(x) (lol)x*x

int dirK[8][2] = {{-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1}};
int dir8[8][2] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}};
int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
int month[] = {31,28,31,30,31,30,31,31,30,31,30,31};

/*============================================================================//
                    Cause wild horses couldn't drag me away
                  Wild, wild horses, we'll ride them some day
//============================================================================*/

int main()
{
    //ios_base::sync_with_stdio(false);cin.tie(NULL);
    //freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
    //pf("Hello World\n");
    /*int t,i;
    sf("%d",&t);
    //getchar();
    for(i=0;i<t;i++)
    {
    }*/
    //sf("%d %d",&n,&m);
    int i,n,a,b,mishka=0,chris=0;
    sf("%d",&n);
    for(i=0;i<n;i++)
    {
        sf("%d %d",&a,&b);
        if(a<b)
        {
            chris++;
        }
        else if(a>b)
        {
            mishka++;
        }
    }
    if(mishka<chris)
    {
        pf("Chris");
    }
    else if(mishka==chris)
    {
        pf("Friendship is magic!^^");
    }
    else
    {
        pf("Mishka");
    }
}


//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
//#include <cstdio>
#include <stdio.h>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <utility>
#include <bitset>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>

using namespace std;

typedef unsigned un;
typedef long long lol;
typedef unsigned char uchar;
typedef unsigned long long ulol;
typedef pair<int,int> pii;
typedef map<int,int> mii;

#define pf printf
#define sf scanf
#define pause system("pause")
#define pmin int,vector<int>,greater<int>
#define checkBit(n,p) (bool)(n&(1<<p))
#define setBit(n,p) (n|=(1<<p))
#define resetBit(n,p) (n&=~(1<<p))
#define toggleBit(n,p) (n^=1<<p)
#define mp(x,y) make_pair(x,y)
#define pb push_back
#define fi first
#define se second
#define init(arr,start,end,val) memset(arr+start,val,(end-start+1)*sizeof(arr[0]))
#define CMAX 127
#define UCMAX 255
#define SMAX 32767
#define USMAX 65535
#define IMAX 2147483647
#define UMAX 4294967295u
#define LMAX 9223372036854775807ll
#define ULMAX 18446744073709551615llu
#define M256 65000000
#define M512 125000000
#define PI acos(-1.0)
#define gcd(x,y) __gcd((lol)abs(x),(lol)abs(y))
#define lcm(x,y) abs(x)/__gcd((lol)abs(x),(lol)abs(y))*abs(y)
#define sqr(x) (lol)x*x

int dirK[8][2] = {{-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1}};
int dir8[8][2] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}};
int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
int month[] = {31,28,31,30,31,30,31,31,30,31,30,31};

/*============================================================================//
                    Cause wild horses couldn't drag me away
                  Wild, wild horses, we'll ride them some day
//============================================================================*/

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    //freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
    //pf("Hello World\n");
    /*int t,i;
    sf("%d",&t);
    //getchar();
    for(i=0;i<t;i++)
    {
    }*/
    //sf("%d %d",&n,&m);
    int i,n,a,b;
    int mishka=0,chris=0;
    sf("%d",&n);
    for(i=0;i<n;i++)
    {
        sf("%d %d",&a,&b);
        if(a<b)
        {
            chris++;
        }
        else if(a>b)
        {
            mishka++;
        }
    }
    if(mishka<chris)
    {
        pf("Chris");
    }
    else if(mishka==chris)
    {
        pf("Friendship is magic!^^");
    }
    else
    {
        pf("Mishka");
    }
}


//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <utility>
#include <bitset>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>

using namespace std;

typedef unsigned un;
typedef long long lol;
typedef unsigned char uchar;
typedef unsigned long long ulol;
typedef pair<int,int> pii;
typedef map<int,int> mii;

#define pf printf
#define sf scanf
#define pause system("pause")
#define pmin int,vector<int>,greater<int>
#define checkBit(n,p) (bool)(n&(1<<p))
#define setBit(n,p) (n|=(1<<p))
#define resetBit(n,p) (n&=~(1<<p))
#define toggleBit(n,p) (n^=1<<p)
#define mp(x,y) make_pair(x,y)
#define pb push_back
#define fi first
#define se second
#define init(arr,start,end,val) memset(arr+start,val,(end-start+1)*sizeof(arr[0]))
#define CMAX 127
#define UCMAX 255
#define SMAX 32767
#define USMAX 65535
#define IMAX 2147483647
#define UMAX 4294967295u
#define LMAX 9223372036854775807ll
#define ULMAX 18446744073709551615llu
#define M256 65000000
#define M512 125000000
#define PI acos(-1.0)
#define gcd(x,y) __gcd((lol)abs(x),(lol)abs(y))
#define lcm(x,y) abs(x)/__gcd((lol)abs(x),(lol)abs(y))*abs(y)
#define sqr(x) (lol)x*x

int dirK[8][2] = {{-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1}};
int dir8[8][2] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}};
int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
int month[] = {31,28,31,30,31,30,31,31,30,31,30,31};

/*============================================================================//
                    Cause wild horses couldn't drag me away
                  Wild, wild horses, we'll ride them some day
//============================================================================*/

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    //freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
    //pf("Hello World\n");
    /*int t,i;
    sf("%d",&t);
    //getchar();
    for(i=0;i<t;i++)
    {
    }*/
    //sf("%d %d",&n,&m);
    int i,n,a,b,mishka=0,chris=0;
    //sf("%d",&n);
    cin >> n;
    for(i=0;i<n;i++)
    {
        //sf("%d %d",&a,&b);
        cin >> a >> b;
        if(a<b)
        {
            chris++;
        }
        else if(a>b)
        {
            mishka++;
        }
    }
    if(mishka<chris)
    {
        //pf("Chris");
        cout << "Chris";
    }
    else if(mishka==chris)
    {
        //pf("Friendship is magic!^^");
        cout << "Friendship is magic!^^";
    }
    else
    {
        //pf("Mishka");
        cout << "Mishka";
    }
}


//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <utility>
#include <bitset>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>

using namespace std;

typedef unsigned un;
typedef long long lol;
typedef unsigned char uchar;
typedef unsigned long long ulol;
typedef pair<int,int> pii;
typedef map<int,int> mii;

#define pf printf
#define sf scanf
#define pause system("pause")
#define pmin int,vector<int>,greater<int>
#define checkBit(n,p) (bool)(n&(1<<p))
#define setBit(n,p) (n|=(1<<p))
#define resetBit(n,p) (n&=~(1<<p))
#define toggleBit(n,p) (n^=1<<p)
#define mp(x,y) make_pair(x,y)
#define pb push_back
#define fi first
#define se second
#define init(arr,start,end,val) memset(arr+start,val,(end-start+1)*sizeof(arr[0]))
#define CMAX 127
#define UCMAX 255
#define SMAX 32767
#define USMAX 65535
#define IMAX 2147483647
#define UMAX 4294967295u
#define LMAX 9223372036854775807ll
#define ULMAX 18446744073709551615llu
#define M256 65000000
#define M512 125000000
#define PI acos(-1.0)
#define gcd(x,y) __gcd((lol)abs(x),(lol)abs(y))
#define lcm(x,y) abs(x)/__gcd((lol)abs(x),(lol)abs(y))*abs(y)
#define sqr(x) (lol)x*x

int dirK[8][2] = {{-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1}};
int dir8[8][2] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}};
int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
int month[] = {31,28,31,30,31,30,31,31,30,31,30,31};

/*============================================================================//
                         Life goes on, it gets so heavy
                         The wheel breaks the butterfly
                             Every tear a waterfall
               In the night the stormy night she'll close her eyes
                  In the night the stormy night away she'd fly
                             And dreams of paradise
//============================================================================*/

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    //freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
    //pf("Hello World\n");
    int t,i,j,k,l,n,m,p,q,u,v,a,b,c,x,y,z,num,sum,counter,length,high,low;
    /*sf("%d",&t);
    //getchar();
    for(i=0;i<t;i++)
    {
    }*/
    //sf("%d %d",&n,&m);
    int mishka=0,chris=0;
    sf("%d",&n);
    for(i=0;i<n;i++)
    {
        sf("%d %d",&a,&b);
        if(a<b)
        {
            chris++;
        }
        else if(a>b)
        {
            mishka++;
        }
    }
    if(mishka<chris)
    {
        pf("Chris");
    }
    else if(mishka==chris)
    {
        pf("Friendship is magic!^^");
    }
    else
    {
        pf("Mishka");
    }
}


//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <utility>
#include <bitset>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>

using namespace std;

typedef unsigned un;
typedef long long lol;
typedef unsigned char uchar;
typedef unsigned long long ulol;
typedef pair<int,int> pii;
typedef map<int,int> mii;

#define pf printf
#define sf scanf
#define pause system("pause")
#define pmin int,vector<int>,greater<int>
#define checkBit(n,p) (bool)(n&(1<<p))
#define setBit(n,p) (n|=(1<<p))
#define resetBit(n,p) (n&=~(1<<p))
#define toggleBit(n,p) (n^=1<<p)
#define mp(x,y) make_pair(x,y)
#define pb push_back
#define fi first
#define se second
#define init(arr,start,end,val) memset(arr+start,val,(end-start+1)*sizeof(arr[0]))
#define CMAX 127
#define UCMAX 255
#define SMAX 32767
#define USMAX 65535
#define IMAX 2147483647
#define UMAX 4294967295u
#define LMAX 9223372036854775807ll
#define ULMAX 18446744073709551615llu
#define M256 65000000
#define M512 125000000
#define PI acos(-1.0)
#define gcd(x,y) __gcd((lol)abs(x),(lol)abs(y))
#define lcm(x,y) abs(x)/__gcd((lol)abs(x),(lol)abs(y))*abs(y)
#define sqr(x) (lol)x*x

int dirK[8][2] = {{-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1}};
int dir8[8][2] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}};
int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
int month[] = {31,28,31,30,31,30,31,31,30,31,30,31};

/*============================================================================//
                    Cause wild horses couldn't drag me away
                  Wild, wild horses, we'll ride them some day
//============================================================================*/

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    //freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
    //pf("Hello World\n");
    /*int t,i;
    sf("%d",&t);
    //getchar();
    for(i=0;i<t;i++)
    {
    }*/
    //sf("%d %d",&n,&m);
    int i,n,a,b,mishka=0,chris=0;
    //sf("%d",&n);
    cin >> n;
    for(i=0;i<n;i++)
    {
        sf("%d %d",&a,&b);
        if(a<b)
        {
            chris++;
        }
        else if(a>b)
        {
            mishka++;
        }
    }
    if(mishka<chris)
    {
        //pf("Chris");
        cout << "Chris";
    }
    else if(mishka==chris)
    {
        //pf("Friendship is magic!^^");
        cout << "Friendship is magic!^^";
    }
    else
    {
        //pf("Mishka");
        cout << "Mishka";
    }
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll x=pow(10,9);
int main()
{
ll n,y,p,q;
cin>>n;
ll a[n];
for(int i=1;i<=n;i++)
{
    cin>>a[i];
}
for(int i=2;i<=n;i++)
{
    if(abs(a[i]-a[i-1])!=1){y=abs(a[i]-a[i-1]);break;}
    }

p=((a[1]/y)+1);
q=(a[1]%y);
bool r=true;
if(y==0){r=false;}
else{
for(int i=1;i<n;i++)
{
    ll t=(a[i+1]-a[i]);
    if(t==1)
        {
            if(q>(y-1)){r=false;break;}
    else
    {
       q+=1;
    }
    }
    else if(t==-1)
            {
                if(q<=1){r=false;break;}
                    else
                    {
                        q-=1;
                    }
            }
            else if(t==y)
            {
                if(p>=x){r=false;break;}
                else{p+=1;}
            }
            else if(t==-y)
            {
                if(p==1){r=false;break;}
                else{p-=1;}
            }
            else{r=false;break;}
}
}
if(r)
{
    cout<<"YES"<<endl;
    cout<<x<<" "<<y<<endl;
}
else
{
    cout<<"NO"<<endl;
}
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll x=pow(10,9);
int main()
{
ll n,y,p,q;
cin>>n;
ll a[n];
for(int i=1;i<=n;i++)
{
    cin>>a[i];
}
for(int i=2;i<=n;i++)
{
    if(abs(a[i]-a[i-1])!=1){y=abs(a[i]-a[i-1]);break;}
    }
p=((a[1]/y)+1);
q=(a[1]%y);
bool r=true;
for(int i=1;i<n;i++)
{
    ll t=(a[i+1]-a[i]);
    if(t==1)
        {
            if(q>(y-1)){r=false;break;}
    else
    {
       q+=1;
    }
    }
    else if(t==-1)
            {
                if(q<=1){r=false;break;}
                    else
                    {
                        q-=1;
                    }
            }
            else if(t==y)
            {
                if(p>=x){r=false;break;}
                else{p+=1;}
            }
            else if(t==-y)
            {
                if(p==1){r=false;break;}
                else{p-=1;}
            }
            else{r=false;break;}
}
if(r)
{
    cout<<"Yes"<<endl;
    cout<<x<<" "<<y<<endl;
}
else
{
    cout<<"No"<<endl;
}
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll x=pow(10,9);
int main()
{
ll n,y=1,p,q;
cin>>n;
ll a[n];
for(int i=1;i<=n;i++)
{
    cin>>a[i];
}
int o=0;
for(int i=2;i<=n;i++)
{
    if(abs(a[i]-a[i-1])!=1){y=abs(a[i]-a[i-1]);break;}

    }
bool r=true;

if(y==0){r=false;}
else{
p=((a[1]/y)+1);
q=(a[1]%y);

for(int i=1;i<n;i++)
{
    ll t=(a[i+1]-a[i]);
    if(t==1)
        {
            if(q>(y-1)){r=false;break;}
    else
    {
       q+=1;
    }
    }
    else if(t==-1)
            {
                if(q<=1){r=false;break;}
                    else
                    {
                        q-=1;
                    }
            }
            else if(t==y)
            {
                if(p>=x){r=false;break;}
                else{p+=1;}
            }
            else if(t==-y)
            {
                if(p==1){r=false;break;}
                else{p-=1;}
            }
            else{r=false;break;}
}
}

if(r)
{
    cout<<"YES"<<endl;
    cout<<x<<" "<<y<<endl;
}
else
{
    cout<<"NO"<<endl;
}
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
	ll n,x=-1,y=-1;
	cin>>n;
	ll a[n],b[n-1];
	for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll mx=0;
    for(int i=0;i<n;i++){if(a[i]>mx){mx=a[i];}}
    for(int i=0;i<(n-1);i++)
    {
        b[i]=abs(a[i+1]-a[i]);}

        for(int i=0;i<(n-1);i++){
        if(b[i]!=1 && b[i]!=x){
                if(x==-1)

                    {
                        if(b[i]){x=b[i];}
                        else{break;}
                }

        else{y=b[i];break;}

        }
        }

        if(y==-1)
        {
            if(x!=-1){
        ll r= (mx/x+1);
            if(r<=pow(10,9) && x<=pow(10,9)){cout<<"YES"<<endl;
            cout<<r<<" "<<x<<endl;
        }}
        else
        {
         cout<<"NO"<<endl;
        }
        }

        else
            {
                cout<<"NO"<<endl;
        }

return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll x=pow(10,9);
int main()
{
ll n,y=1,p,q;
cin>>n;
ll a[n];
for(int i=1;i<=n;i++)
{
    cin>>a[i];
}
for(int i=2;i<=n;i++)
{
    if(abs(a[i]-a[i-1])!=1){y=abs(a[i]-a[i-1]);break;}

    }
bool r=true;

if(y==0){r=false;}
else{
p=((a[1]/y)+1);
q=(a[1]%y);

for(int i=1;i<n;i++)
{
    ll t=(a[i+1]-a[i]);
    if(p<0 || q<0 || p>x ){r=false;break;}
    if(t==1)
        {
            if(y!=1){
            if(q%y==0){r=false;break;}
    else
    {
       q+=1;
    }}
    else{

    p+=1;}
    }
    else if(t==-1)
            {
                if(y!=1){if(q%y==1){r=false;break;}
                    else
                    {
                        q-=1;
                    }}
                    else
                    {
                        p-=1;
                    }
            }
            else if(t==y)
            {
                if(p>=x){r=false;break;}
                else{p+=1;}
            }
            else if(t==-y)
            {
                if(p==1){r=false;break;}
                else{p-=1;}
            }
            else{r=false;break;}
}
}

if(r)
{
    cout<<"YES"<<endl;
    cout<<x<<" "<<y<<endl;
}
else
{
    cout<<"NO"<<endl;
}
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
	ll n,x=-1,y=-1;
	cin>>n;
	ll a[n],b[n-1];
	for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll mx=0;
    for(int i=0;i<n;i++){if(a[i]>mx){mx=a[i];}}
    for(int i=0;i<(n-1);i++)
    {
        b[i]=abs(a[i+1]-a[i]);}

        for(int i=0;i<(n-1);i++){
        if(b[i]!=1 && b[i]!=x){
                if(x==-1){x=b[i];}

        else{y=b[i];break;}

        }
        }

        if(y==-1)
        {
        ll r= (mx/x+1);
            if(r<=pow(10,9) && x<=pow(10,9)){cout<<"YES"<<endl;
            cout<<r<<" "<<x<<endl;
        }}
        else{cout<<"NO"<<endl;}

return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll x=pow(10,9);
int main()
{
ll n,y,p,q;
cin>>n;
ll a[n];
for(int i=1;i<=n;i++)
{
    cin>>a[i];
}
for(int i=2;i<=n;i++)
{
    if(abs(a[i]-a[i-1])!=1){y=abs(a[i]-a[i-1]);break;}
    }
p=((a[1]/y)+1);
q=(a[1]%y);
bool r=true;
for(int i=1;i<n;i++)
{
    ll t=(a[i+1]-a[i]);
    if(t==1)
        {
            if(q>(y-1)){r=false;break;}
    else
    {
       q+=1;
    }
    }
    else if(t==-1)
            {
                if(q<=1){r=false;break;}
                    else
                    {
                        q-=1;
                    }
            }
            else if(t==y)
            {
                if(p>=x){r=false;break;}
                else{p+=1;}
            }
            else if(t==-y)
            {
                if(p==1){r=false;break;}
                else{p-=1;}
            }
            else{r=false;break;}
}
if(r)
{
    cout<<"YES"<<endl;
    cout<<x<<" "<<y<<endl;
}
else
{
    cout<<"NO"<<endl;
}
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll x=pow(10,9);
int main()
{
ll n,y,p,q;
cin>>n;
ll a[n];
for(int i=1;i<=n;i++)
{
    cin>>a[i];
}
for(int i=2;i<=n;i++)
{
    if(abs(a[i]-a[i-1])!=1){y=abs(a[i]-a[i-1]);break;}
    }
bool r=true;
if(n>1){
if(y==0){r=false;}
else{
p=((a[1]/y)+1);
q=(a[1]%y);

for(int i=1;i<n;i++)
{
    ll t=(a[i+1]-a[i]);
    if(t==1)
        {
            if(q>(y-1)){r=false;break;}
    else
    {
       q+=1;
    }
    }
    else if(t==-1)
            {
                if(q<=1){r=false;break;}
                    else
                    {
                        q-=1;
                    }
            }
            else if(t==y)
            {
                if(p>=x){r=false;break;}
                else{p+=1;}
            }
            else if(t==-y)
            {
                if(p==1){r=false;break;}
                else{p-=1;}
            }
            else{r=false;break;}
}
}
}
if(r)
{
    cout<<"YES"<<endl;
    cout<<x<<" "<<y<<endl;
}
else
{
    cout<<"NO"<<endl;
}
    return 0;
}