#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long inf64 = 1e18;
const int mod = inf + 7;
const int N = 2e5 + 10;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  string s;
  map<string, int> m;
  while (n--) {
    cin >> s;
    m[s]++;
  }
  for (auto it : m) cout << it.first << " x " << it.second << "\n";
  if (m["AC"] == 0)
    cout << "AC"
         << " x " << 0 << "\n";
  if (m["WA"] == 0)
    cout << "WA"
         << " x " << 0 << "\n";
  if (m["TLE"] == 0)
    cout << "TLE"
         << " x " << 0 << "\n";
  if (m["RE"] == 0)
    cout << "RE"
         << " x " << 0 << "\n";
}
