#include<stdio.h>
#include<iostream>
#include<sstream>
#include<queue>
#include<math.h>
#include<stdlib.h>
#include<stack>
#include<string.h>
#include<string>
#include<map>
#include<algorithm>
#include<time.h>
#include<set>
#include<vector>
#include <numeric>
using namespace std;
#define All(a) a.begin(), a.end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define rep(i,n) for(long i=0;i<long(n);i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define repi(i,a,n) for(int i=int(a);i<int(n);i++)
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define Odd(x) x%2!=0
#define Even(x) x%2==0
#define Pi 3.14
#define INF 2000000000 // 2 billion
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, string> is;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;
using namespace std;
int main() {
long n,m;
cin>>n;
vector <ll> a(n,0),b(n,0);
map<ll,long> ai,bi;
ll temp = -1;
rep(i,n) {
cin>>a[i];
if(a[i] > temp) {
ai[a[i]] = i+1;
temp = a[i];
}
}
temp = -1;
rep(i,n){
cin>>b[i];
if(b[i] > temp) {
bi[b[i]] = i+1;
temp = b[i];
}
}
cin>>m;
vector <ll> a1(m,0),b1(m,0);
bool ok;
rep(i,m){
cin>>a1[i];
}
rep(i,m){
cin>>b1[i];
}
long t1,t2;
map<ll,long>::iterator i1,i2;
rep(i,m){
// with upper bound
// i1 = ai.upper_bound(a1[i]);
// i2 = bi.upper_bound(b1[i]);
//with lower bound
i1 = ai.lower_bound(a1[i]);
i2 = bi.lower_bound(b1[i]);
ok = true;
if(i1 == ai.end() && i2 == bi.end()) cout<<"Draw\n";
else if (i1 == ai.end()) cout<<"Constantine\n";
else if (i2 == bi.end()) cout<<"Mike\n";
else if(i1->second < i2->second) cout<<"Mike\n";
else if (i1->second > i2->second ) cout<<"Constantine\n";
else{
cout<<"Draw\n";
}
// it was my first checking
// for (;i1 != ai.end() && i2 != bi.end();){
// if(i1->first <= a1[i] && i2->first <= b1[i] )
// {
// if(i1->second < i2->second) i1++;
// else if (i1->second > i2->second) i2++;
// else i1++, i2++;
// }
// else if(i1->first <= a1[i] && i2->first > b1[i] ){
// cout<<"Constantine\n";
// ok=0;
// break;
// }
// else if(i1->first > a1[i] && i2->first <= b1[i] ){
// cout<<"Mike\n";
// ok=0;
// break;
// }
// else {
// if(i1->second < i2->second){
// cout<<"Mike\n";
// ok = false;
// break;
// }
// else if(i1->second > i2->second){
// cout<<"Constantine\n";
// ok = false;
// break;
// }
// else{
// cout<<"Draw\n";
// ok = false;
// break;
// }
// }
// }
// if(ok){
// if(i1 == ai.end()){
// for(;i2 != bi.end();){
// if(i2->first > b1[i])
// {
// cout<<"Constantine\n";
// ok = false;
// break;
// }
// i2++;
// }
// if(ok) cout<<"Draw\n";
// }
// else{
// for(;i1 != ai.end();){
// if(i1->first > a1[i])
// {
// cout<<"Mike\n";
// ok = false;
// break;
// }
// i1++;
// }
// if(ok) cout<<"Draw\n";
// }
// }
}
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPHNzdHJlYW0+CiNpbmNsdWRlPHF1ZXVlPgojaW5jbHVkZTxtYXRoLmg+CiNpbmNsdWRlPHN0ZGxpYi5oPgojaW5jbHVkZTxzdGFjaz4KI2luY2x1ZGU8c3RyaW5nLmg+CiNpbmNsdWRlPHN0cmluZz4KI2luY2x1ZGU8bWFwPgojaW5jbHVkZTxhbGdvcml0aG0+CiNpbmNsdWRlPHRpbWUuaD4KI2luY2x1ZGU8c2V0PgojaW5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HBhaXI8aW50LCBzdHJpbmc+IGlzOwp0eXBlZGVmIHZlY3RvcjxpaT4gdmlpOwp0eXBlZGVmIGxvbmcgbG9uZyBsbDsKdHlwZWRlZiB1bnNpZ25lZCBsb25nIHVsOwp0eXBlZGVmIHVuc2lnbmVkIGxvbmcgbG9uZyB1bGw7CnR5cGVkZWYgbG9uZyBkb3VibGUgbGQ7Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICAKICAgIGxvbmcgbixtOwogICAgY2luPj5uOwogICAgdmVjdG9yIDxsbD4gYShuLDApLGIobiwwKTsKICAgIG1hcDxsbCxsb25nPiBhaSxiaTsKICAgIGxsIHRlbXAgPSAtMTsKICAgIHJlcChpLG4pIHsKICAgICAgICBjaW4+PmFbaV07CiAgICAgICAgaWYoYVtpXSA+IHRlbXApIHsKICAgICAgICAgICAgICBhaVthW2ldXSA9IGkrMTsKICAgICAgICAgICAgICB0ZW1wID0gYVtpXTsKICAgICAgICAgIH0KICAgIH0KICAgIHRlbXAgPSAtMTsKICAgIHJlcChpLG4pewogICAgICAgIGNpbj4+YltpXTsKICAgICAgICAgICAgaWYoYltpXSA+IHRlbXApIHsKICAgICAgICAgICAgICAgIGJpW2JbaV1dID0gaSsxOwogICAgICAgICAgICAgICAgdGVtcCA9IGJbaV07CiAgICAgICAgICAgIH0KICAgIH0KICAgIGNpbj4+bTsKICAgIHZlY3RvciA8bGw+IGExKG0sMCksYjEobSwwKTsKICAgIGJvb2wgb2s7CiAgICByZXAoaSxtKXsKICAgICAgICBjaW4+PmExW2ldOwogICAgfQogICAgcmVwKGksbSl7CiAgICAgICAgY2luPj5iMVtpXTsKICAgIH0KICAgIGxvbmcgdDEsdDI7CiAgICBtYXA8bGwsbG9uZz46Oml0ZXJhdG9yIGkxLGkyOwogICAgcmVwKGksbSl7CiAgICAJCiAgICAJLy8gd2l0aCB1cHBlciBib3VuZAogICAgCQovLyAgICAgICAgaTEgPSBhaS51cHBlcl9ib3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MisrOwovLyAgICAgICAgICAgIH0KLy8gICAgICAgICAgICBlbHNlIGlmKGkxLT5maXJzdCA8PSBhMVtpXSAmJiBpMi0+Zmlyc3QgPiBiMVtpXSApewovLyAgICAgICAgICAgICAgICBjb3V0PDwiQ29uc3RhbnRpbmVcbiI7Ci8vICAgICAgICAgICAgICAgIG9rPTA7Ci8vICAgICAgICAgICAgICAgIGJyZWFrOwovLyAgICAgICAgICAgIH0KLy8gICAgICAgICAgICBlbHNlIGlmKGkxLT5maXJzdCA+IGExW2ldICYmIGkyLT5maXJzdCA8PSBiMVtpXSApewovLyAgICAgICAgICAgICAgICBjb3V0PDwiTWlrZVxuIjsKLy8gICAgICAgICAgICAgICAgb2s9MDsKLy8gICAgICAgICAgICAgICAgYnJlYWs7Ci8vICAgICAgICAgICAgfQovLyAgICAgICAgICAgIGVsc2UgewovLyAgICAgICAgICAgICAgICBpZihpMS0+c2Vjb25kIDwgaTItPnNlY29uZCl7Ci8vICAgICAgICAgICAgICAgICAgICBjb3V0PDwiTWlrZVxuIjsKLy8gICAgICAgICAgICAgICAgICAgIG9rID0gZmFsc2U7Ci8vICAgICAgICAgICAgICAgICAgICBicmVhazsKLy8gICAgICAgICAgICAgICAgfQovLyAgICAgICAgICAgICAgICBlbHNlIGlmKGkxLT5zZWNvbmQgPiBpMi0+c2Vjb25kKXsKLy8gICAgICAgICAgICAgICAgICAgIGNvdXQ8PCJDb25zdGFudGluZVxuIjsKLy8gICAgICAgICAgICAgICAgICAgIG9rID0gZmFsc2U7Ci8vICAgICAgICAgICAgICAgICAgICBicmVhazsKLy8gICAgICAgICAgICAgICAgfQovLyAgICAgICAgICAgICAgICBlbHNlewovLyAgICAgICAgICAgICAgICAgICAgY291dDw8IkRyYXdcbiI7Ci8vICAgICAgICAgICAgICAgICAgICBvayA9IGZhbHNlOwovLyAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci8vICAgICAgICAgICAgICAgIH0KLy8gICAgICAgICAgICB9Ci8vICAgICAgICB9Ci8vICAgICAgICBpZihvayl7Ci8vICAgICAgICAgICAgaWYoaTEgPT0gYWkuZW5kKCkpewovLyAgICAgICAgICAgICAgICBmb3IoO2kyICE9IGJpLmVuZCgpOyl7Ci8vICAgICAgICAgICAgICAgICAgICBpZihpMi0+Zmlyc3QgPiBiMVtpXSkKLy8gICAgICAgICAgICAgICAgICAgIHsKLy8gICAgICAgICAgICAgICAgICAgICAgICBjb3V0PDwiQ29uc3RhbnRpbmVcbiI7Ci8vICAgICAgICAgICAgICAgICAgICAgICAgb2sgPSBmYWxzZTsKLy8gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLy8gICAgICAgICAgICAgICAgICAgIH0KLy8gICAgICAgICAgICAgICAgICAgIGkyKys7Ci8vICAgICAgICAgICAgICAgIH0KLy8gICAgICAgICAgICAgICAgaWYob2spIGNvdXQ8PCJEcmF3XG4iOwovLyAgICAgICAgICAgIH0KLy8gICAgICAgICAgICBlbHNlewovLyAgICAgICAgICAgICAgICBmb3IoO2kxICE9IGFpLmVuZCgpOyl7Ci8vICAgICAgICAgICAgICAgICAgICBpZihpMS0+Zmlyc3QgPiBhMVtpXSkKLy8gICAgICAgICAgICAgICAgICAgIHsKLy8gICAgICAgICAgICAgICAgICAgICAgICBjb3V0PDwiTWlrZVxuIjsKLy8gICAgICAgICAgICAgICAgICAgICAgICBvayA9IGZhbHNlOwovLyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwovLyAgICAgICAgICAgICAgICAgICAgfQovLyAgICAgICAgICAgICAgICAgICAgaTErKzsKLy8gICAgICAgICAgICAgICAgfQovLyAgICAgICAgICAgICAgICBpZihvaykgY291dDw8IkRyYXdcbiI7Ci8vICAgICAgICAgICAgfQovLyAgICAgICAgfQogICAgfQogICAgcmV0dXJuIDA7Cn0K