#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); map m; rep(i,5){ int a; cin>>a; m[a]++; } vector A; for(auto [a,b]:m) A.push_back(b); sort(ALL(A)); reverse(ALL(A)); if(A[0]>=4) cout<<"NO HAND"<