#include #include #include #include #include #include signed main() { int n; std::cin >> n; std::vector> tree(n); for(const auto i : std::views::iota(0, n)) { for([[maybe_unused]] const auto _ : std::views::iota(0, 4)) { std::string c; std::cin >> c; if(c == "H") continue; tree[i].emplace_back(std::stoi(c) - 1); } } std::string ans; auto dfs = [&](auto&& dfs, const auto v, const auto p) -> void { for(const auto nv : tree[v]) { if(nv == p) continue; ans += "("; dfs(dfs, nv, v); ans += "yl)"; } ans += "meth"; }; dfs(dfs, 0, -1); std::cout << ans + "ane\n"; } __attribute__((constructor)) inline void fast_io() { std::ios::sync_with_stdio(false), std::cin.tie(nullptr); }