#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  ll n;
  cin >> n;
  vector<ll> cons(n);
  for (int i = 0; i < (n); ++i) {
    string ch;
    cin >> ch;
    if (ch[0] == 'A') {
      cons[0]++;
    } else if (ch[0] == 'W') {
      cons[1]++;
    } else if (ch[0] == 'T') {
      cons[2]++;
    } else if (ch[0] == 'R') {
      cons[3]++;
    }
  }
  cout << "AC x " << cons[0] << endl;
  cout << "WA x " << cons[1] << endl;
  cout << "TLE x " << cons[2] << endl;
  cout << "RE x " << cons[3] << endl;
}
