#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, a = 0, m = 0, c = 0, k = 0, i, j, l = 1e9 + 7;
  string s, r, y;
  cin >> n;
  while (n--) {
    cin >> s;
    string s1 = "AC", s2 = "WA", s3 = "TLE";
    if (s == s1)
      a++;
    else if (s == s2)
      m++;
    else if (s == s3)
      c++;
    else
      k++;
  }
  cout << "AC X " << a << '\n';
  cout << "WA X " << m << '\n';
  cout << "TLE X " << c << '\n';
  cout << "RE X " << k << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
