

#include <iostream>
#include <string>
#include <vector>
using namespace std;

vector <string> split(string s, char p = '.') {
    vector <string> result;
    
    string word = "";
    s += p;
    
    for (char c : s) {
        if (c == p) {
            result.push_back(word);
            word = "";
        } else {
            word += c;
        }
    }
    
    return result;
}

bool check_if_num (string s) {
    if (s.empty()) return false;
    
    for (char c : s) {
        if (!isdigit(c)) {
            return false;
        }       
    }
    
    return true;
}

int count_dots(string s) {
    int result = 0;
    
    for (char c : s) {
        if (c == '.') {result++;}
    }
    
    return result;
}

int main() {
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
    string s;
    cin >> s;
    if (count_dots(s) != 3 || s[s.size() - 1] == '.') {
        cout << "NO";
        return 0;
    }
    for (string w : split(s)) {
    	string copy_without_zero = "";
    	for (char c : w) {if (c != '0') {copy_without_zero += c;}}
    	
        if (copy_without_zero.size() > 3) {
            cout << "Bad";
            return 0;
        } else if (!check_if_num(w)) {
            cout << "Bad";
            return 0;   
        } 
        
        int num = stoi(w);
        
        if (num < 0 || num > 255) {
            cout << "Bad";
            return 0; 
        }
    }
    
    cout << "Good";
    
    return 0;
}