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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    vector<string> first(n), second(n);
    for (string& name : first) cin >> name;
    for (string& name : second) cin >> name;

    unordered_map<string, string> partner;
    for (int i = 0; i < n; ++i) {
        if (first[i] == second[i]) {
            cout << "bad\n";
            return 0;
        }
        partner[first[i]] = second[i];
    }

    for (int i = 0; i < n; ++i) {
        if (partner[second[i]] != first[i]) {
            cout << "bad\n";
            return 0;
        }
    }
    cout << "good\n";
}
