#include <iostream>
using namespace std;
// #include <iostream>
// using namespace std;

struct table
{
    int idx;
    char text[20];

};

struct table data[] =
{
    {0, "Goodnight"},
    {4, "Goodmorning"},
    {12, "Goodafternonn"},
    {18, "Goodevening"},
    {23, "Goodnight"}
};

int main()
{
    int n;
    while (1)
    {
        cout << "何時（0～23）";
        cin >> n;
        if (n == -1)return 0;
        if ((n < 0) || (n > 23))continue;
        for (int i = sizeof(data) / sizeof(data[0]); --i >= 0;)
        {
            if (n >= data[i].idx)
            {
                cout << data[i].text << endl;
                break;
            }
        }
    }
    return 0;
}
