#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, a = 0, t = 0, w = 0, r = 0;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    if (s[0] == 'A') ++a;
    if (s[0] == 'T') ++t;
    if (s[0] == 'W') ++w;
    if (s[0] == 'R') ++r;
  }
  cout << "AC x " << a;
  cout << "\nwA x " << w;
  cout << "\nTLE x " << t;
  cout << "\nRE x " << r;
  return 0;
}
