#include <bits/stdc++.h>
using namespace std;
long long int powr(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  if (b % 2 == 0) {
    return powr(((a % 1000000007) * (a % 1000000007)) % 1000000007, b / 2);
  } else {
    if (b == 1) {
      return a;
    } else {
      return (a * powr(((a % 1000000007) * (a % 1000000007) % 1000000007),
                       (b - 1) / 2)) %
             1000000007;
    }
  }
}
long long gcd1(long long a, long long b) {
  if (a == 0)
    return b;
  else {
    return gcd1(b % a, a);
  }
}
long long lcm(long long a, long long b) { return (a * b) / gcd1(a, b); }
long long mod1(long long a) {
  if (a < 0)
    return -1 * a;
  else {
    return a;
  }
}
bool isPrime(int num) {
  for (int i = 2; i * i <= (num); i++) {
    if (num % i == 0) {
      return false;
      break;
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int f1;
  f1 = 1;
  for (int y2 = 0; y2 < f1; y2++) {
    map<string, int> make_pair;
    int n;
    string str;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> str;
      make_pair[str]++;
    }
    string str1[4];
    str1[0] = "AC";
    str1[2] = "TLE";
    str1[1] = "WA";
    str1[3] = "RE";
    for (int i = 0; i < 4; i++) {
      cout << str1[i] << " " << make_pair[str1[i]] << "\n";
    }
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
