#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
void solve() {
  long long int n;
  cin >> n;
  char a;
  int c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == 'AC') {
      c0++;
    } else if (a == 'WA') {
      c1++;
    } else if (a == 'TLE') {
      c2++;
    } else {
      c3++;
    }
  }
  cout << "AC x " << c0;
  cout << "WA x " << c1;
  cout << "TLE x " << c2;
  cout << "RE x " << c3;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
