#include <bits/stdc++.h>
using namespace std;
long long ii() {
  long long x;
  cin >> x;
  return x;
}
string is() {
  string x;
  cin >> x;
  return x;
}
long double id() {
  long double x;
  cin >> x;
  return x;
}
void oi(long long x) { cout << x; }
void od(long double x) { cout << fixed << setprecision(10) << x; }
void os(string x) { cout << x; }
void oe() { cout << endl; }
void oie(long long x) {
  oi(x);
  oe();
}
void ode(long double x) {
  od(x);
  oe();
}
void ose(string x) {
  os(x);
  oe();
}
long long mod = 1000000007;
int main() {
  vector<string> ss = {"AC", "WA", "TLE", "RE"};
  vector<long long> sm(4, 0);
  long long N = ii();
  for (long long i = 0; i < (N); i++) {
    string s = is();
    for (long long i = 0; i < (4); i++) {
      if (ss[i] == s) {
        sm[i]++;
      }
    }
  }
  for (long long i = 0; i < (N); i++) {
    cout << ss[i] << " x " << sm[i] << endl;
  }
  return 0;
}
