#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int a = 0, w = 0, t = 0, r = 0;
    cin.ignore();
    while (n--) {
      string st;
      getline(cin, st);
      if (st[0] == 'A' && st[1] == 'C') a++;
      if (st[0] == 'W' && st[1] == 'A') w++;
      if (st[0] == 'T' && st[1] == 'L' && st[2] == 'E') t++;
      if (st[0] == 'R' && st[1] == 'E') r++;
    }
    cout << "AC "
         << "x " << a << endl;
    cout << "WA "
         << "x " << w << endl;
    cout << "TLE "
         << "x " << t << endl;
    cout << "RA "
         << "x " << r << endl;
  }
  return 0;
}
