#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  string s[4];
  s[0] = "AC";
  s[1] = "WA";
  s[2] = "TLE";
  s[3] = "RE";
  long long c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  for (long long i = 0; i < n; i++) {
    string t;
    cin >> t;
    if (t[0] == 'A')
      c0++;
    else if (t[0] == 'W')
      c1++;
    else if (t[0] == 'T')
      c2++;
    else if (t[0] == 'R')
      c3++;
  }
  cout << s[0] << " X  " << c0 << "\n";
  cout << s[1] << " X  " << c1 << "\n";
  cout << s[2] << " X  " << c2 << "\n";
  cout << s[3] << " X  " << c3 << "\n";
}
