#include <bits/stdc++.h>
using namespace std;
#define int long long 
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define vi vector <int>
#define vp vector <pair<int,int>>
#define f(x,y,z) for(x=y;x<z;x++)
#define pb push_back
#define mp make_pair
#define ld long double
#define fb(x,y,z) for(x=y;x>z;x--)
#define pqf priority_queue <int,vector <int>> 
#define pqb priority_queue <int,vector <int>,greater<int>> 
#define ps(x,y) fixed << setprecision(y) << x
#define PI 3.1415926535
#define mod 1000000007 
#define mods 998244353 
#define setbits(x) __builtin_popcountll(x)
#define all(x) (x).begin(), (x).end()
#define fill(a) memset(a,0,sizeof(a))


// AUTHOR ALOK KUMAR
int lcm(int a,int b)
{
    return (a*b)/(__gcd(a,b));
}
int power(int a,int b)
{
    int c=1;
    while(b)
    {
        if(b&1)
        c*=a;
        a*=a;
        b/=2;
    }
    return c;
}
void solve()
{
  int n;
  cin>>n;
  string s[n];
  f(i,0,n)
    cin>>s[i];
  int i,j,k1,k2,k;
  int count[4]={0};
  f(i,0,n)
  {
    if(s[i]=="AC")
      count[0]++;
    else if(s[i]=="WA")
      count[1]++;
    else if(s[i]=="TLE")
      count[2]++;
    else
      count[3]++:
    
  }
  cout<<"AC x "<<count[0]<<"\n"<<"WA x "<<count[1]<<"\n"<<"TLE x "<<count[2]<<"\n"<<"RE x "<<count[3]<<"\n";
    
}



int32_t main()
{
    IOS
    int t=1;
    //cin>>t;
    while(t--)
    solve();
    return 0;
}






























