#include <bits/stdc++.h>
const long long mod = 1000000007;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> freq(4);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      freq[0]++;
    } else if (s == "WA") {
      freq[1]++;
    } else if (s == "TLE") {
      freq[2]++;
    } else {
      freq[3]++;
    }
  }
  cout << "AC  X  " << freq[0] << endl;
  cout << "WA  X  " << freq[1] << endl;
  cout << "TLE  X  " << freq[2] << endl;
  cout << "RE  X  " << freq[3] << endl;
}
