#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const ll inf = 1e18 + 10;
typedef pair<int, int> pii;
typedef pair<ll, int> pill;
#define fi first
#define se second
const int N = 200005;
struct Node{
Node *child[26];
bool nina;
bool emi;
};
Node *createNode(){
Node *tmp = new Node();
for(int id=0;id<26;id++){
tmp->child[id] = NULL;
}
tmp->nina = false;
tmp->emi = false;
return tmp;
}
Node *root;
void addString(string &s, int state){
Node *p = root;
int len = s.size();
for(int i=0;i<len;i++){
int id = s[i] - 'a';
if(p->child[id] == NULL) p->child[id] = createNode();
p = p->child[id];
if(state == 1) p->nina = true;
else p->emi = true;
}
}
int n,m;
bool dfs(Node *p, int state){
for(int id=0;id<26;id++){
if(p->child[id] == NULL) continue;
bool canMove = false;
if(state == 1){
if(p->child[id]->nina){
canMove = true;
}
}
else{
if(p->child[id]->emi) canMove = true;
}
if(canMove){
if(dfs(p->child[id], 3 - state) == false) return true;
}
}
return false;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
root = createNode();
cin >> n;
for(int i=0;i<n;i++){
string s; cin >> s;
addString(s, 1);
}
cin >> m;
for(int i=0;i<m;i++){
string s; cin >> s;
addString(s, 2);
}
if(dfs(root, 1)) cout << "Nina";
else cout << "Emilija";
return 0;
}
/*
*/