cases = int(input())

account = {'AC': 0, 'WA' : 0, 'TLE':0, 'RE':0}

while cases > 0:
  account[input()]++
  cases--
  
print('AC x '+ account['AC'])
print('WA x '+ account['WA'])
print('TLE x '+ account['TLE'])
print('RE x '+ account['RE'])