#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t, m, n, x, a, b;
  string s;
  cin >> t;
  a = b = m = n = 0;
  while (t--) {
    cin >> s;
    transform(s.begin(), s.end(), s.begin(), ::toupper);
    if (s[0] == 'A') a++;
    if (s[0] == 'W') b++;
    if (s[0] == 'T') m++;
    if (s[0] == 'E') n++;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << m << endl;
  cout << "RE x " << n << endl;
  return 0;
}
