for(;R=readline();print(V))for(V=R[~-R.length];!+V;)V=R.match(V+'=(\\w+)')[1]