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