#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  freopen("input.txt", "r", stdin);
  ;
  freopen("output.txt", "w", stdout);
  ;
  int n;
  cin >> n;
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  string str;
  while (n--) {
    cin >> str;
    if (str.compare("AC") == 0)
      AC++;
    else if (str.compare("WA") == 0)
      WA++;
    else if (str.compare("TLE") == 0)
      TLE++;
    else
      RE++;
  }
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;
}
