#include <bits/stdc++.h>
using namespace std;
map<string, int> m;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  m["AC"] = 0;
  m["WA"] = 0;
  m["TLE"] = 0;
  m["RE"] = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string k;
    cin >> k;
    m[k]++;
  }
  for (auto x : m) {
    cout << x.first << " x " << x.second << endl;
  }
  return 0;
}
