#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using db = double;
using str = string;
using pi = pair<int, int>;
using pl = pair<long long, long long>;
using pd = pair<double, double>;
using pld = pair<long double, long double>;
using vi = vector<int>;
using vd = vector<double>;
using vld = vector<long double>;
using vl = vector<long long>;
using vs = vector<string>;
using vc = vector<char>;
using vpi = vector<pair<int, int>>;
using vpl = vector<pair<long long, long long>>;
using vpd = vector<pair<double, double>>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
const long long INF = 1e18;
const long double PI = acos((long double)-1);
const long long MOD = 998244353;
const int MX = 2e5 + 5;
template <class A>
void re(complex<A>& c);
template <class A, class B>
void re(pair<A, B>& p);
template <class A>
void re(vector<A>& v);
template <class A, size_t SZ>
void re(array<A, SZ>& a);
template <class T>
void re(T& x) {
  cin >> x;
}
void re(double& d) {
  string t;
  re(t);
  d = stod(t);
}
void re(long double& d) {
  string t;
  re(t);
  d = stold(t);
}
template <class H, class... T>
void re(H& h, T&... t) {
  re(h);
  re(t...);
}
template <class A>
void re(complex<A>& c) {
  A a, b;
  re(a, b);
  c = {a, b};
}
template <class A, class B>
void re(pair<A, B>& p) {
  re(p.first, p.second);
}
template <class A>
void re(vector<A>& x) {
  for (auto& i : x) re(i);
}
template <class A, size_t SZ>
void re(array<A, SZ>& x) {
  for (auto& i : x) re(i);
}
string to_string(char c) { return string(1, c); }
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char* second) { return (string)second; }
string to_string(string second) { return second; }
template <class A>
string to_string(complex<A> c) {
  stringstream ss;
  ss << c;
  return ss.str();
}
string to_string(vector<bool> v) {
  string res = "{";
  for (int i = 0; i < ((int)(v).size()); ++i) res += char('0' + v[i]);
  res += "}";
  return res;
}
template <size_t SZ>
string to_string(bitset<SZ> b) {
  string res = "";
  for (int i = 0; i < SZ; ++i) res += char('0' + b[i]);
  return res;
}
template <class A, class B>
string to_string(pair<A, B> p);
template <class T>
string to_string(T v) {
  bool fst = 1;
  string res = "{";
  for (const auto& x : v) {
    if (!fst) res += ", ";
    fst = 0;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <class A, class B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void DBG() { cerr << "]" << endl; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) cerr << ", ";
  DBG(t...);
}
void EDBG(string names) { names = names; }
template <class H, class... T>
void EDBG(string names, H h, T... t) {
  auto pos = names.find(',');
  auto first_name = names.substr(0, pos);
  auto rest = names.substr(pos + 1);
  while (rest.front() == ' ') {
    rest = rest.substr(1);
  }
  cerr << "[" << first_name << "]: [" << to_string(h) << "]"
       << "\n";
  EDBG(rest, t...);
}
void pr() {}
template <typename H, typename... T>
void pr(const H& var1, const T&... var2) {
  cout << var1;
  pr(var2...);
}
void ps() { cout << "\n"; }
template <typename H, typename... T>
void ps(const H& var1, const T&... var2) {
  cout << var1 << ' ';
  ps(var2...);
}
void setIn(string second) { freopen(second.c_str(), "r", stdin); }
void setOut(string second) { freopen(second.c_str(), "w", stdout); }
void unsyncIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(20);
}
void setIO(string second = "") {
  unsyncIO();
  if (((int)(second).size())) {
    setIn(second + ".in");
    setOut(second + ".out");
  }
}
template <class T>
void uni(vector<T>& v) {
  sort(begin(v), end(v));
  v.erase(unique(begin(v), end(v)), end(v));
}
ll cdiv(ll a, ll b) { return a / b + !(a < 0 || a % b == 0); }
ll gcd(ll a, ll b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
ll gld(ll a, ll b) { return (a - (a % b)); }
ll lcm(ll a, ll b) { return (a / (gcd(a, b)) * b); }
ll mpow(ll a, ll b, ll c) {
  ll res = 1;
  a %= c;
  while (b > 0) {
    if (b & 1) res = res * a % c;
    a = a * a % c;
    b >>= 1;
  }
  return res;
}
ll power(ll a, ll b) {
  ll res = 1;
  while (b > 0) {
    if (b % 2) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
int n;
vs a;
int main() {
  setIO();
  re(n);
  a.resize(n);
  re(a);
  map<string, int> make_pair;
  make_pair["AC"] = 0;
  make_pair["WA"] = 0;
  make_pair["TLE"] = 0;
  make_pair["RE"] = 0;
  for (int i = 0; i < n; i++) {
    make_pair[a[i]]++;
  }
  for (auto& i : make_pair) {
    ps(i.first, 'x', i.second);
  }
}
