#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  string s[] = {"AC", "WA", "TLE", "RT"};
  map<string, long long> mp;
  for (int i = 0; i < 4; i++) {
    mp[s[i]] = 0;
  }
  while (n--) {
    string s;
    cin >> s;
    mp[s]++;
  }
  for (int i = 0; i < 4; i++) {
    cout << s[i] << " x " << mp[s[i]] << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  solve();
}
