#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;
  }
};
using ll = long long;
using vi = vector<int>;
using ii = pair<int, int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
const ll MOD = 1e9 + 7;
template <typename T, typename L>
T power(T a, L b);
template <typename T, typename L>
L coefficient(T n, T k);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  unordered_map<string, int> mp;
  mp["AC"] = mp["WA"] = mp["TLE"] = mp["RE"] = 0;
  for (int i = (0); ((1) > 0 ? i < (n) : i > (n)); i += (1)) {
    string s;
    cin >> s;
    mp[s]++;
  }
  for (auto x : mp) {
    cout << x.first << " x " << x.second << (x.first == "RE" ? "" : "\n");
  }
}
template <typename T, typename L>
T power(T a, L b) {
  T result = 1;
  while (b) {
    if (b & 1) result = (result % MOD * a % MOD) % MOD;
    a = (a % MOD * a % MOD) % MOD;
    b /= 2;
  }
  return result;
}
template <typename T, typename L>
L coefficient(T n, T k) {
  k = min(k, (n - k));
  L res = 1;
  for (T i = 0; i < k; i++) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
