int main() { long long int n; int flag,t; scanf("%d\n",&t); while(t--) { scanf("%lld\n",&n); int ch; ch = 1; while(n>0) { switch(ch) { case 1: n =chef(n); ch = 2; flag = 1; break; case 2 : n = misha(n); ch = 1; flag=2; break; } } switch(flag) { case 1 : printf("Chef\n"); break; case 2 : printf("Misha\n"); break; } } return 0; }
int main (int argc, char **argv) { if (argc > 2) { fprintf (stderr, "Usage: chef [file]\n"); exit (1); } if (argc == 2) { if (freopen (argv[1], "r", stdin) == NULL) { fprintf (stderr, "Can't open '%s'.\n", argv[1]); exit (1); } } chef (); return 0; }