#include using namespace std; int main() { string S, T = "OK"; while (cin >> S) { if (S.size() != 1 && S.at(0) == '0') T = "NG"; for (int i = 0; i < S.size(); i++) if (!isdigit(S.at(i))) T = "NG"; } cout << T << "\n"; }