int n; constint N = 1024; vector< pair<int, int> > son[N]; intdfs(int u, int fa){ int ans = 0; for(auto p: son[u]) { int v, w; tie(v, w) = p; if (v == fa) continue; ans ^= sg(w, dfs(v, u)); } return ans; } voidsolve(){ n=read(); rep(i,1,n) son[i].clear(); rep(i,1,n-1){ int u=read()+1; int v=read()+1; int w=read(); son[u].push_back(make_pair(v, w)); son[v].push_back(make_pair(u, w)); } int ans = dfs(1, 0); puts(ans ? "Emily" : "Jolly"); }