#include <bits/stdc++.h>
using namespace std;
void kick2309() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long N = 10000007;
long long A[N];
int32_t main() {
  kick2309();
  {
    long long n;
    cin >> n;
    long long a = 0;
    long long b = 0;
    long long c = 0;
    long long d = 0;
    for (long long i = 0; i < n; i++) {
      string s;
      cin >> s;
      if (s[0] == 'A') a++;
      if (s[0] == 'W') b++;
      if (s[0] == 'T') c++;
      if (s[0] == 'R') d++;
    }
    {
      cout << "AC"
           << " x " << a << '\n';
      cout << "WA x" << b << '\n';
      cout << "TLE x " << c << '\n';
      cout << "RE x " << d << '\n';
    }
  }
  return 0;
}
