#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
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;
}
