#include <bits/stdc++.h>
using namespace std;
const int MAX = 3000000;
long long fac[MAX], finv[MAX], inv[MAX];
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % (1000000007);
    inv[i] = (1000000007) -
             inv[(1000000007) % i] * ((1000000007) / i) % (1000000007);
    finv[i] = finv[i - 1] * inv[i] % (1000000007);
  }
}
long long COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % (1000000007)) % (1000000007);
}
map<long long, long long> prime;
void prime_factorize(long long n) {
  if (n <= 1) return;
  long long l = sqrt(n);
  for (long long i = 2; i <= (long long)(l); i++) {
    if (n % i == 0) {
      prime_factorize(i);
      prime_factorize(long long(n / i));
      return;
    }
  }
  prime[n]++;
  return;
}
int main() {
  long long N;
  cin >> N;
  map<string, long long> m;
  m["AC"] = 0;
  m["TLE"] = 0;
  m["WA"] = 0;
  m["RE"] = 0;
  for (long long i = 0; i < N; i++) {
    string S;
    cin >> S;
    m[S]++;
  }
  for (auto itr = m.begin(); itr != m.end(); itr++) {
    cout << itr->first << " x " << itr->second << endl;
  }
  return 0;
}
