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