import sys
import re
listing={}
for line in sys.stdin:
startpos=0
name=''
dupsfound=[]
while True:
m=re.match("\s*<(\w+)>",line[startpos:])
if not m:
break
word=m.group(1)
name+=' '+word
startpos+=m.end()
if startpos<=0:
continue
m=re.match(r'[^"]*"(.+)"',line)
if not m:
val='???'
print("couldn't make sense of line: "+line)
else:
val=m.group(1)
if name in listing:
if val != listing[name]:
print("Exact conflict found: (%s )[%s][%s]"%(name,
listing[name], val))
else:
print("\tRedundant definition: (%s )[%s]"%(name, val))
else:
listing[name]=val
print("hit end")
print("Checking prefixes.")
for key in listing:
pref=''
for word in key.split(" ")[:-1]:
if not word:
continue
pref+=" "+word
if pref in listing:
print("Prefix conflict found: "
"(%s )[%s] vs (%s )[%s]"%(pref, listing[pref],
key, listing[key]))