#include <iostream>
#include <string>
using namespace std;
string str;
int main()
{
while (1)
{
getline(cin, str);
if (str.back() == '?') cout << "Quack!" << endl;
else if (str.back() == '.') cout << "*Nod*" << endl;
else break;
}
return 0;
}