#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, WA, TLE, RE;
  AC = WA = TLE = RE = 0;
  while (n--) {
    string str;
    cin >> str;
    if (str == "AC")
      AC++;
    else if (str == "WA")
      WA++;
    else if (str == "TLE")
      TLE++;
    else if (str == "RE")
      RE++;
  }
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE;
}
