#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define endl "\n"
#define TASK ""
#define II pair<int,int>
#define fi first
#define se second
#define MASK(i) (1 << (i))
#define BIT(i,x) (((x) >> (i)) & 1)
int MOD = 1e9 + 7;
int const N = 1e6 + 7;
struct Trie{
struct node{
node * child[26];
int exits[3];
node(){
for(int i = 0;i < 26;i++) child[i] = NULL;
exits[1] = exits[2] = 0;
}
};
node *root;
Trie(){
root = new node();
}
void insert(string s,int i){
node *p = root;
for(auto f : s){
int c = f - 'a';
if(p -> child[c] == NULL) p -> child[c] = new node();
p = p -> child[c];
p -> exits[i] = 1;
}
}
void dfs(node *p,int h){
if(p != root){
if(p -> exits[2] == 0 && h % 2 == 1){
cout<<"Nina";
exit(0);
}
}
int s = (h + 1) & 1;
for(int i = 0;i < 26;i++){
if(p -> child[i] == NULL) continue;
if(p -> child[i] -> exits[s] == 0) continue;
dfs(p -> child[i],h + 1);
}
}
}T;
void solve(){
int n;cin>>n;
for(int i = 1;i <= n;i++){
string s;cin>>s;
T.insert(s,1);
}
// cout<<"hi"<<endl;
int m;cin>>m;
for(int i = 1;i <= m;i++){
string s;cin>>s;
T.insert(s,2);
}
T.dfs(T.root,0);
cout<<"Emilija";
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
// freopen(TASK".INP","r",stdin);
// freopen(TASK".OUT","w",stdout);
solve();
return 0;
}
//be
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |