#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  int n, ans = 0;
  cin >> n;
  map<string, int> m;
  string s;
  m["AC"] = 0;
  m["WA"] = 0;
  m["TLE"] = 0;
  m["RE"] = 0;
  while (n--) {
    cin >> s;
    m[s]++;
  }
  for (auto i : m) {
    cout << i.first << " x " << i.second << endl;
  }
}
