Problem: Example

Input

3 5 4
3
6
12


Output

Hanako

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;
int N,A,B,K;
int s[100000];
int cnt=0;

bool solve(){
  int f=0;
  for(int i=0;i<N;i++)f^=s[i]%(K+1);
  
  if(A==B||cnt==N)return (f>0);

  if(A>B)return true;
  if(cnt<N-1)return false;
  
  f^=s[N-1]%(K+1);
  return (s[N-1]-A<=f && f<=A);
}

int main(){
  cin>>N>>A>>B;
  K=min(A,B);
  for(int i=0;i<N;i++){
    cin>>s[i];
    if(s[i]<=K)cnt++;
  }
  sort(s,s+N);
  cout<< (solve()?"Hanako":"Jiro") <<endl;
  return 0;
}