#!/usr/local/bin/python
import sys,string,re;

words=""
for line in sys.stdin.readlines():
  if line.find("[\"") > 0:
    x1=line.find("[\"")+2
    x2=line.find("\"]")
    words+="\""+line[x1:x2]+"\""
POSFile=sys.argv[2]
fd=open(POSFile,'r+')
POS=fd.readlines()
POS=string.join(POS,'\n')
fd.close()
ProbFile=sys.argv[1]
fd=open(ProbFile,'r+')
line=fd.readline()
wordtype=re.compile("[a-ü]+(\-)?[a-ü]*")
while line!="":
  x1=line.find(" ")
  word=line[:x1]
  if word!="":
    if  (wordtype.match(word)) and wordtype.match(word).group()==word:
       if words.find("\""+word+"\"") < 0:
         x=POS.find("\n"+word+" ")
         if x < 0:
           POSofword="NOUN"
         else:
           x=POS.find(" ",x)+1
           x=POS.find(" ",x)+1
           if POS[x:x+2]=="N(":
             POSofword="NOUN"
           elif POS[x:x+2]=="V(":
             POSofword="VERB"
           elif POS[x:x+5]=="Pron(":
             POSofword="PRON"
           elif POS[x:x+5]=="Prep(":
             POSofword="PREP"
           elif POS[x:x+4]=="Adj(":
             POSofword="ADJ"
           elif POS[x:x+4]=="Adv(":
             POSofword="ADV"
           elif POS[x:x+21]=="Num(hoofd,bep,onverv)":
             POSofword="CD"
           elif POS[x:x+4]=="Num(":
             POSofword="ADJ"
           else:
             POSofword="NOUN"
         x2=line.find(" ",x1+1)
         translation=line[x1+1:x2]
         if (wordtype.match(translation)) and (wordtype.match(translation).group()==translation):
           print POSofword+"::"+POSofword+" :| [\""+word+"\"] -> [\""+translation+"\"]"
           print "(\n  (x1::y1)\n)\n"
           words+="\""+word+"\""
  line=fd.readline()
fd.close()
