#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long int MAX_N = 500010;
const long long int INF = 999999999999;
int main() {
  int n;
  cin >> n;
  int a, b, c, d;
  for (int i = 0; i < n; i++) {
    string p;
    cin >> p;
    if (p == "AC") {
      a++;
    } else if (p == "WA") {
      b++;
    } else if (p == "TLE") {
      c++;
    } else {
      d++;
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
}
