#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  {
    long long a, b, c, d, i, j, k, l, m, n, sum = 0, temp = 0, f = 0, cnt = 0;
    string ac = "AC", re = "RE", tle = "TLE", wa = "WA";
    cin >> n;
    string s;
    a = 0, b = 0, c = 0, d = 0;
    for (i = 0; i < n; i++) {
      cin >> s;
      if (s == ac) a++;
      if (s == re) b++;
      if (s == wa) c++;
      if (s == tle) d++;
    }
    cout << ac << " X " << a << endl;
    cout << wa << " X " << c << endl;
    cout << tle << " X " << d << endl;
    cout << re << " X " << b << endl;
  }
}
