Problem: Example

Input

3 5 4
3
6
12


Output

Hanako

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
int N,A,B,x[100000],c;
bool Awin(){
	cin>>N>>A>>B;
	rep(i,N) cin>>x[i];
	rep(i,N) if(x[i]>min(A,B)) c++;
	if(A>B){
		if(c) return 1;
	}else if(A<B){
		if(c>1) return 0;
		if(c==1){
			int a=0,j=-1;
			rep(i,N){
				if(x[i]>A) j=i;
				else a^=x[i]%(A+1);
			}
			if(a<=A&&x[j]-A<=a&&a<x[j]) return 1;
			else return 0;
		}
	}
	int a=0;
	rep(i,N) a^=x[i]%(min(A,B)+1);
	return a;
}
int main(){
	if(Awin()) puts("Hanako");
	else puts("Jiro");
}