def main():
    N = int(input())
    ac = 0
    wa = 0
    tle = 0
    re = 0
    for i in range(0, N):
        res = input()
        if (res == 'AC'):
            ac += 1
        if (res == 'WA'):
            wa += 1
        if (res == 'TLE'):
            tle += 1
        if (res == 'RE'):
            re += 1
    print(f"AC x {ac}")
    print(f"WA x {wa}")
    print(f"TEL x {tle}")
    print(f"RE x {re}")


if __name__ == '__main__':
    main()
