#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void _IOS() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
}
int n, l, r, x;
vector<int> b(200009), a(200009);
int main() {
  unordered_map<string, int> mp;
  cin >> n;
  mp["RE"] = 0, mp["TLE"] = 0, mp["WA"] = 0, mp["AC"] = 0;
  while (n--) {
    string s;
    cin >> s;
    mp[s]++;
  }
  for (auto i : mp) {
    cout << i.first << " x " << i.second << endl;
  }
}
