#include <bits/stdc++.h>
const int N = 100005;
const long double pi = 3.141592653;
const long long MOD = 1000000007;
using namespace std;
int dx[9] = {1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 0, 1, -1, 1, -1, 1, -1, 0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1, cac = 0, cwa = 0, ctle = 0, cre = 0;
  cin >> T;
  while (T--) {
    string s;
    cin >> s;
    if (s[0] == 'A')
      cac++;
    else if (s[0] == 'W')
      cwa++;
    else if (s[0] == 'T')
      ctle++;
    else
      cre++;
  }
  cout << "AC X " << cac << "\n";
  cout << "WA X " << cwa << "\n";
  cout << "TLE X " << ctle << "\n";
  cout << "RE X " << cre << "\n";
  return 0;
}
