#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(int, char**) {
  int n;
  cin >> n;
  map<string, int> mp;
  for (auto s : {"AC", "WA", "TLE", "RE"}) mp[s] = 0;
  string tmp;
  for (int i = 0; i < (n); i++) {
    cin >> tmp;
    mp[tmp]++;
  }
  for (auto m : mp) {
    cout << m.first << " x " << m.second << endl;
  }
  return 0;
}
