#include using namespace std; #include using boost::hana::fix; int main() { int N; cin >> N; vector> G(N); for (int u=0; u < N; ++u) for (int i=0; i < 4; ++i) { string C; cin >> C; if (C != "H") G[u].push_back(stoi(C) - 1); } fix([&](auto &&self, int const u, int const p) -> void { for (int const v : G[u]) if (v != p) { cout << "("; self(v, u); cout << "yl)"; } cout << "meth"; })(0, -1); cout << "ane" << endl; }