#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, i, j, k, l, m, a, b, t, sum, sum1, flag;
  cin >> n;
  string s;
  sum = 0, sum1 = 0, k = 0, m = 0;
  while (n--) {
    cin >> s;
    if (s == "AC") {
      sum += 1;
    }
    if (s == "TLE") {
      sum1 += 1;
    }
    if (s == "WA") {
      k += 1;
    }
    if (s == "RE") {
      m += 1;
    }
  }
  cout << "AC x " << sum << endl;
  cout << "TLE x " << sum1 << endl;
  cout << "WA x " << k << endl;
  cout << "RE x " << m << endl;
}
