#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int solve() {
  int a, b, q;
  cin >> a >> b >> q;
  while (q--) {
    int l, r, u = 0;
    cin >> l >> r;
    for (int i = (int)(l); i < (int)(r + 1); ++i) {
      if (((i % a) % b) != ((i % b) % a)) u = 1, cout << i << " ", i = r + 1;
    }
    (u == 0) ? cout << 0 << " " : cout << "";
  }
  cout << "\n";
  return 0;
}
bool check(int n) {
  long long h;
  for (int i = (int)(4); i < (int)((n / 2)); ++i) {
    h = sqrt(i);
    if ((h * h) == i && n % i == 0) {
      return false;
    }
  }
  return true;
}
int soolve() {
  string s;
  cin >> s;
  int g = 0, k, l, x, y;
  for (int i = (int)(0); i < (int)(s.size() - 1); ++i) {
    if (s[i] != s[i + 1]) g++;
  }
  cout << g / 2 << "\n";
  return 0;
}
int sooolve() {
  string a, b, c;
  cin >> a >> b >> c;
  map<char, int> x, y, z;
  for (int i = (int)(0); i < (int)(a.size()); ++i) x[a[i]]++;
  for (int i = (int)(0); i < (int)(b.size()); ++i) y[b[i]]++;
  for (int i = (int)(0); i < (int)(c.size()); ++i) z[c[i]]++;
  if (a[0] != b[0]) {
    cout << "NO\n";
    return 0;
  }
  for (auto d : x) {
    if (d.second > y[d.first]) {
      cout << "NO\n";
      return 0;
    } else if (y[d.first] > (d.second + z[d.first])) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  return 0;
}
bool is_prime(int n) {
  if (n == 2 || n == 3) return true;
  for (int i = (int)(2); i < (int)(sqrt(n) + 1); ++i) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  map<string, int> m;
  m["AC"] = 0, m["TLE"] = 0, m["WA"] = 0, m["RE"] = 0;
  while (n--) {
    string s;
    cin >> s;
    m[s]++;
  }
  for (auto t : m) {
    cout << t.first << " x " << t.second << "\n";
  }
  return 0;
}
