
#include <bits/stdc++.h>

using namespace std;

#define int long long
#define nn "\n"
#define pi pair<int, int>
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define eb emplace_back
#define pb push_back
#define TASK " "

#define ms(a, x) memset(a, x, sizeof(a))
#define all(a) a.begin(), a.end()
#define All(a, n) a + 1, a + 1 + n

#define LOG 19


const int INF = 1e18;
const int mod = 1e9+7;
const int N = 2e5  + 5;
const int maxN = 4e5 + 5;
int MOD = 998244353;
int bit[200000];
struct node{
	int kc, u, hk;
	bool operator<(const node& other) const {
        return kc > other.kc;
    }
};
struct edge{
	int v, w, h;
};
string s;
void nhap(){

}
void solve(){
    while(cin >> s){
        if(s == "0") break;
        bool ok = 1;
        for(int i = 0; i < s.size(); i++){
            if(s[i] != '(' && s[i] != ')'){
                cout << "KHONGHOPLE" << nn;
                ok = 0;
                break;
            }
        }
        int kq = 0;
        for(int i = 0; i < s.size(); i++){
            if(s[i] == '('){
                kq++;
            }
            else{
                kq--;
            }
        }
        if(kq != 0 && ok){
            cout << "KHONGDUNG" << nn;
        }
        else if(ok && kq == 0) cout << "DUNG" << nn;
    }
}
// nGuyEn Le  truOng  thanH
signed main() {
//	 freopen("CHUANHOA.INP", "r", stdin);
//	 freopen("CHUANHOA.OUT", "w", stdout);
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    solve();
	return (0 ^ 0);

}

