#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e9 + 7;
const int64_t N = 1e6 + 5;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int64_t n;
  cin >> n;
  int64_t a, w, t, r;
  string s;
  for (int64_t i = 0; i < n; i++) {
    cin >> s;
    if (s[0] == 'A') {
      a++;
    } else if (s[0] == 'W')
      w++;
    else if (s[0] == 'R')
      r++;
    else
      t++;
  }
  cout << "AC x " << a << "\n";
  cout << "WA x " << w << "\n";
  cout << "TLE x " << t << "\n";
  cout << "RE x " << r << "\n";
  return 0;
}
