#include #include using mint = atcoder::static_modint<998244353>; //using mint = atcoder::static_modint<1000000007>; using namespace std; using namespace atcoder; using ld = long double; using ll = long long; #define mp(a,b) make_pair(a,b) #define rep(i,s,n) for(int i=s; i dx{1,0,-1,0},dy{0,1,0,-1}; vector> G(200000); string m="meth",head="(",tail="yl)"; void dfs(int x,int p){ for(auto y:G[x])if(y!=p){ cout << head; dfs(y,x); cout << tail; } if(x==0)cout<<"methane"; else cout << m; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; rep(i,0,n){ char c; rep(j,0,4){ cin >> c; if(c!='H'){ G[i].push_back(c-'1'); } } } // rep(i,0,n){ // cout << i << "\n"; // for(auto x:G[i])cout << x << " "; // cout <<"\n"; // } dfs(0,-1); }