def main():
    N = int(input())
    AC = 0
    WA = 0
    TLE = 0
    RE = 0
    for i in range(N):
        St = input()
        if St == 'AC':
            AC += 1
        elif St == 'WA':
            WA += 1
        elif St == 'TLE':
            TLE += 1
        elif St == 'RE':
            RE += 1
        else:

    print('AC x ' + str(AC))
    print('AC x ' + str(WA))
    print('AC x ' + str(TLE))
    print('AC x ' + str(RE))
main()