#include <bits/stdc++.h>
using namespace std;
double PI = (acos(-1));
long long md = 1000000007;
long long ma = 998244353;
long long pw(long long a, long long b) {
  long long c = 1, m = a;
  while (b) {
    if (b & 1) c = (c * m);
    m = (m * m);
    b /= 2;
  }
  return c;
}
long long pwmd(long long a, long long b) {
  long long c = 1, m = a;
  while (b) {
    if (b & 1) c = ((c * m)) % md;
    m = (m * m) % md;
    b /= 2;
  }
  return c;
}
long long modinv(long long n) { return pwmd(n, md - 2); }
long long min(long long a, long long b) {
  if (a >= b) return b;
  return a;
}
long long nc2(long long n) { return (1ll * n * (n - 1)) / 2; }
long long nsum(long long n) { return (1ll * n * (n + 1)) / 2; }
bool is(string r) {
  string p = r;
  reverse(p.begin(), p.end());
  return (r == p);
}
bool prime(long long a) {
  for (int i = 2; i * i <= a; i++) {
    if (a % i == 0) return false;
  }
  return true;
}
void SieveOfEratosthenes(vector<int> &primes) {
  bool IsPrime[1005];
  memset(IsPrime, true, sizeof(IsPrime));
  for (int p = 2; p * p < 1005; p++) {
    if (IsPrime[p] == true) {
      for (int i = p * p; i < 1005; i += p) IsPrime[i] = false;
    }
  }
  for (int p = 2; p < 1005; p++)
    if (IsPrime[p]) primes.push_back(p);
}
void solve() {
  long long n;
  cin >> n;
  long long a = 0, w = 0, r = 0, t = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s[0] == 'A')
      a++;
    else if (s[0] == 'W')
      w++;
    else if (s[0] == 'R')
      r++;
    else
      t++;
  }
  cout << "AC"
       << " " << a << "\n";
  cout << "WA"
       << " " << w << "\n";
  cout << "TLE"
       << " " << t << "\n";
  cout << "RE"
       << " " << r << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long tests = 1;
  while (tests--) {
    solve();
  }
  return 0;
}
