jiahuimbzuai/CoQuIR huggingface dataset:
//  [cpp]
//17:30
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <map>

using namespace std;
typedef long long ll;
ll max(ll a, ll b){return(a>b)?a:b;}
ll min(ll a, ll b){return(a<b)?a:b;}
ll abss(ll a){return(a<0)?-a:a;}

int a[3];
int main(){
        scanf("%d %d %d",a+0,a+1,a+2);
        sort(a,a+3);

        printf("%d\n",a[2]*10+a[1]+a[0]);
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define max(a,b) a>b?a:b
int main()
{   int a,b,c,n,k,x;
    scanf("%d%d%d",&a,&b,&c);
    if(a>b){
        if(a>c){printf("%d",10*a+b+c);
    }else{
        printf("%d",10*c+a+b);
    }}else if(b>c){
        printf("%d",b*10+a+c);
    }else{
        printf("%d",10*c+a+b);
    }

    return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  if( c>= b && b >= a ){
    printf("%d",c*10+b+a);
  }else if( b>= a && a>= c){
    printf("%d",b*10+a+c);
  }else if( a>= b && b>=c){
    printf("%d",a*10+b+c);
  }else if( c>= a && a >= b){
    printf("%d",c*10+a+b);
  }else if( b>= c && c>= a){
    printf("%d",b*10+c+a);
  }else if(a >=c && c>=b){
    printf("%d",a*10+c+b);
  }
}
//  [c]
#include <stdio.h>

int main(){
  int a,b,c;
  scanf("%d %d %d", &a, &b, &c);
  
  if(b <= a && c <= a){
    printf("%d", 10 * a + b + c);
  } else if(a <= b && c <= b){
    printf("%d", 10 * b + a + c);
  } else {
    printf("%d", 10 * c + a + b);
  }
}
//  [javascript]
function main(arg) {
	arg = arg.split("\n")[0]
	arg = arg.split(" ").map((e) => Number(e))
	arg.sort((a,b) => {
		if (a > b) {
			return -1
		}
		return 1
	})
	console.log(arg[0]*10+arg[1] + arg[2])
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input) {
  input = input.split("\n");
  var a = parseInt(input[0].split(" ")[0]);
  var b = parseInt(input[0].split(" ")[1]);
  var c = parseInt(input[0].split(" ")[2]);
  var ans =0;
  x = new Array(a,b,c);
  x.sort(function(a,b){
    if( a > b ) return -1;
    if( a < b ) return 1;
    return 0;
  });
  var n =parseInt(x[0]+"" +x[1]+" ");
  ans = n+x[2];

  console.log('%s', ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
var main = function(input) {

var array =input.split(' ').map(x=>parseInt(x));
	array=array.sort();
	array=array.reverse();
var sum=array[0]*10+array[1]+array[2];
  console.log(sum)
    return 0; 
}

main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	a, b, c := intScanner(), intScanner(), intScanner()
	fmt.Println(max([]int{a*10 + b + c, a + b*10 + c, a + b + c*10}))
}
//  [go]
package main

import (
	"fmt"
)

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func main() {
	var a [3]int
	fmt.Scan(&a[0], &a[1], &a[2])
	ans := -1

	for i := 0; i < 3; i++ {
		for j := 0; j < 3; j++ {
			if j == i {
				continue
			}
			for k := 0; k < 3; k++ {
				if k == i || k == j {
					continue
				}
				ans = max(ans, a[i]*10+a[j]+a[k])
			}
		}
	}
	fmt.Println(ans)

}
//  [ruby]
arr = gets.chomp.split(" ").map(&:to_i)

a,b,c = arr.sort_by{|x| -x}

puts a * 10 + b + c
//  [ruby]
a, b, c = gets.chomp.split(" ").map(&:to_i).sort
puts (c.to_s+b.to_s).to_i+a.to_i
//  [ruby]
a = gets.split.map(&:to_i)
a.sort!
puts a[2] * 10 + a[1] + a[0]
//  [rust]
use text_io::*;
use std::collections::HashMap;
use std::process::exit;

fn main() {
    let mut v:Vec<usize> = Vec::new();
    for _i in 0..3 {
        let a:usize = read!();
        v.push(a);
    }
    v.sort();
    println!("{}",v[0]+v[1]+v[2]*10);
}
//  [rust]
use std::io;
use std::str::FromStr;

fn input_vec() -> Vec<u64> {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn main() {
    let mut n = input_vec();
    n.sort();
    println!("{}", n[2] * 10 + n[1] + n[0]);
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input!(n: [usize; 3]);

    let &max = n.iter().max().unwrap();
    let sum: usize = n.iter().sum();

    println!("{}", max * 9usize + sum);
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [A, B, C] = input[0].map(Number);

  return Math.max(A, B, C) * 9 + A + B + C;
};

console.log(main(read()));
//  [typescript]
var lines=[];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
reader.on('line', function (line) {
  lines.push(line);
});
reader.on('close', function () {
  main(lines);
});

function main(lines) {
  const [a, b, c] = parseLines(lines);  
  const sorted = [a, b, c].sort((a, b) => b - a);
  console.log(formula(sorted));
}

function formula(sorted) {
  return parseInt('' + sorted[0] + sorted[1]) + sorted[2];
}

function parseLines(lines) {
  const [a, b, c] = lines[0].trim().split(' ').map(s => parseInt(s));
  return [a, b, c];
}
//  [typescript]
'use strict';

const receive = () => require('fs').readFileSync('/dev/stdin', 'utf8').split(/\s/);

const main = input => {
  const [A, B, C, ...rest] = input.map(x => Number(x));
  const ans = Math.max(A, B, C) * 9 + A + B + C;
  console.log(ans);
};

main(receive());
//  [python]
import sys

N = int(input())
L = list(map(int, input().split()))

n = L[0]
while True:
    if len(L) <= 0:
        break

    if L[0] - n < -1:
        print("No")
        sys.exit()

    n = max(n, L[0])
    L.pop(0)

print("Yes")
//  [python]
import numpy as np
import sys
n = int(input())
h = np.array(list(map(int, input().split())))
ans = "No"
h[0] -= 1
for i in range(1, n-1):
    dif_1 = h[i] - h[i+1]
    dif_2 = h[i] - h[i-1]
    if dif_1 > 1:
        print(ans)
        sys.exit()
    elif dif_1 == 1 or dif_2 > 0:
        h[i] -= 1


max_h = 0
for i in range(1, n):
    max_h = max(max_h, h[i-1])
    dif = h[i] - max_h
    if dif < 0:
        print(ans)
        sys.exit()
ans = "Yes"
print(ans)
//  [python]
import numpy as np

N=int(input())
H=np.array(input().split(),dtype=np.int32)

flag=True

for i in range(N-1,0,-1):
    if(H[i]>=H[i-1]):
        continue
    else:
        H[i-1]=H[i-1]-1
        if(H[i]<H[i-1]):
            flag=False

if(flag):
    print("Yes")
else:
    print("No")
//  [java]
import java.util.*;

public class Main{

    public static void main(String args[]){

        Scanner scan = new Scanner(System.in);
        Integer N = Integer.parseInt(scan.next());
        ArrayList<Long> h = new ArrayList<Long>();

        for(int i=0;i<N;i++){
            h.add(Long.parseLong(scan.next()));
        }

        for(int i=N-1;i>=1;i--){
            Long l = h.get(i-1);
            if(h.get(i) < h.get(i-1)){
                h.remove(i-1);
                h.add(i-1,l-1);
            }
        }

        int i=0;
        for(i=0;i<N-1;i++){
            if(h.get(i)<=h.get(i+1)){

            }else{
                break;
            }
        }

        if(i==N-1)
            System.out.println("Yes");
        else
            System.out.println("No");

    }
}
//  [java]
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int[] H = new int[N];
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		boolean flg = true;
		for(int i=N-1;i>=1;i--) {
			if(flg==false) {
				break;
			}
			for(int j=i-1;j>=0;j--) {
				if(H[i]+2<=H[j]) {
					flg = false;
				}
			}
		}
		if(flg) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
//  [java]
import java.util.Scanner;
import java.util.HashMap;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.lang.Math;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] h = new int[n];
        int[] hl = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
            hl[i] = 0;
        }
        for (int i = 0; i < n-1; i++) {
            if (h[i] > h[i+1]) {
                h[i] -= 1;
                hl[i] = 1;
                if (i != 0) {
                    for (int j = i; j >= 1; j--) {
                        if (h[j-1] > h[j]) {
                            if (hl[j-1] != 0) {
                                System.out.println("No");
                                System.exit(0);
                            } else {
                                if (h[j-1] - h[j] > 1) {
                                    System.out.println("No");
                                    System.exit(0);
                                } else {
                                    h[j-1] -= 1;
                                    hl[j-1] = 1;
                                }
                            }
                        }
                    }
                }
            }
        }
        System.out.println("Yes");
    }

}
//  [cpp]
#include<iostream>
using namespace std;

int main(){
    int N;
    cin >> N;

    long int H[N];
    for(int i=0; i<N; i++) cin >> H[i];

    int i = 0;
    int flag = 0;
    while(flag == 0 && i < N){
        if(H[i+1] - H[i] >= 0){
            i++;
        }
        else{
            for(int j=i+1; j<N; j++){
                if(H[i] - H[j] >= 2){
                    cout << "No";
                    flag = 1;
                    break;
                }
            }
            i++;
        }
    }
    if(flag == 0) cout << "Yes";
}
//  [cpp]
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define in insert
#define sz(x) ((in)(x).size())
using namespace std;
const int N = 1e5 + 123;
ll a[N];

void read_file()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
}

void solve()
{
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 2; i <= n; i++)
    {
        if (a[i - 1] > a[i])
        {
            for (int j = i - 1; j >= 1; j--)
            {
                if (a[j] - a[i] > 1)
                {
                    cout << "No\n";
                    return;
                }
            }
        }

    }
    cout << "Yes\n";
}

int main()
{
    solve();
    //cerr << printf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
    return (0);
}
//  [cpp]
#include<iostream>
#include<vector>
#include<cassert>
#include<algorithm>
using namespace std;

int main(void)
{
    long N;
    cin >> N;
    vector<long> H(N);
    
    for(long i = 0; i < N; i++) cin >> H[i];

    string flag = "Yes";
    long ind = -1;
    long max = -1;
    decltype(H)::iterator top = H.begin();
    for(long i = N-1; i > 0; i--){
        if (ind == -1 || i == ind){
            ind = max_element(top, top+i-1) - top;
            max = H[ind];
        }
        if (max - H[i] > 1){
            flag = "No";
            break;
        }
    }

    cout << flag << endl;
    
    return 0;
}
//  [c]
#include<stdio.h>
int n,d=3;
  int a[100000];
  int b[100000];
void l(void){
  int i;
  for(i=0;i<n-1;i++){
  //  printf("a");
    if(a[i]>a[i+1]){
      //printf("a");
      if(a[i]-1>a[i+1]||b[i]){
        //printf("No\n");
        d=0;
      }else{
        b[i]=1;
        a[i]--;
        return (l());
      }
    }

  }
  //printf("Yes\n");
  if(d==3)
  d=1;
}
int main(void){
  int i;
  scanf("%d",&n);
  for(i=0;i<n;i++)
  scanf("%d",&a[i]);
  l();
  if(d){
    printf("Yes\n");

  }
  else
  printf("No\n");
  //for(i=0;i<n;i++){
    //printf("%d,",a[i]);
  //}
  return(0);
}
//  [c]
n,i,a[100009];main(){
	scanf("%d",&n);for(i=0;i<n;i++)scanf("%d",&a[i]);
	for(i=n-1;i>=1;i--){
    	if(a[i]<a[i-1])a[i-1]--;
    	if(a[i]<a[i-1]){printf("No");return 0;}
	}
	printf("Yes");
}
//  [c]
int main()
{
  int n;
  scanf("%d", &n);
  long h[n];
  int i;
  for (i = 0; i < n; i++)
    scanf("%ld", &h[i]);
  for (i = 0; i < n - 1; i++)
  {
    if (i >= 1)
      if (h[i] > h[i - 1])
        h[i]--;
    if (h[i] > h[i + 1])
    {
      printf("No");
      return 0;
    }
  }
  printf("Yes");
}
//  [javascript]


function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  var H = input[1].split(" ").map(i => parseInt(i));
  var H1=0;
  var ans="Yes";
  var max=0;
  for(var i=1;i<N;i++){
    if(H[i-1]-H[i]>=2){
      ans="No";
      break;
    }else if(H[i-1]-H[i]==1){
      if(H[i-1]-1>=max){
        max=H[i-1]-1;
      }else{
        ans="No";
        break;
      }
    }
  }

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var N = nextInt();
	var list = nextIntArray();
	for(var i = N - 1; i > 0; i--){
		if(list[i - 1] > list[i]){
			list[i - 1]--;
			if(list[i - 1] > list[i]){
				myout("No");
				return;
			}
		}
	}
	myout("Yes");
}
//  [go]
package main

import (
   "fmt"
)

func solution(n int, h []int) string {
   for i := n - 1; i > 0; i-- {
        if h[i] >= h[i-1] {
                continue
        }
        h[i-1]--
        if h[i] < h[i-1] {
                return "No"
        }
   }
   return "Yes"
}

func main() {
   var n int
   fmt.Scan(&n)
   h := make([]int, n)
   for i := range h {
        fmt.Scan(&h[i])
   }
   fmt.Println(solution(n, h))
}
//  [go]
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	h  := make([]int, n)
	for i := 0; i <n ; i++ {
		fmt.Scan(&h[i])
	}

	for i := 0; i < n; i++ {
		if i == 0 {
			continue
		}
		if h[i] > h[i-1] {
			h[i]--
		}

		if h[i] < h[i-1] {
			fmt.Println("No")
			return
		}
	}
	fmt.Println("Yes")
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	
	h := make([]int, n)
	
	max := 0
	for i := 0; i < n; i++ {
		fmt.Scan(&h[i])
		if max < h[i] {
			max = h[i]
		}
		if max-1 > h[i] {
			fmt.Println("No")
			return
		}
	}
	fmt.Println("Yes")
}
//  [ruby]
N = gets.chomp.to_i
H = gets.chomp.split.map(&:to_i)

before = nil
H.each_cons(3) do |a, b, c|
  candidates =
    if before
      ab = before.map {|x| [x[1], x[2]]}.uniq
      ab.flat_map do |_a, _b|
        [
          [_a, _b, c],
          [_a, _b, c - 1],
        ]
      end
    else
      [
        [a, b, c],
        [a, b, c - 1],
        [a, b - 1, c],
        [a, b - 1, c - 1],
        [a - 1, b, c ],
        [a - 1, b, c - 1],
        [a - 1, b -1, c],
        [a - 1, b -1, c - 1],
      ]
    end

  before = candidates.select do |x, y, z|
    x <= y && y <= z
  end
  (puts 'No'; exit) if before.size == 0
end
puts 'Yes'
//  [ruby]
gets
h = gets.split.map &:to_i
d = [-1]
h.each{|i| d = (i-1..i).select{|j| d.any?{|k| k<=j}}}
puts d[0] ? :Yes : :No
//  [ruby]
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# Nと空白区切の入力値を数値の配列で返却する
def gets_n_and_i_list()
  return gets.chomp.to_i, gets.chomp.split(" ").map(&:to_i)
end
n, hlist = gets_n_and_i_list

hlist.reverse!

0.upto(n-2) do |i|
  ch = hlist[i]
  nh = hlist[i+1]
  if ch < nh
    hlist[i+1] -= 1
  end
end

if hlist == hlist.sort.reverse
  puts "Yes"
else
  puts "No"
end
//  [rust]
use text_io::*;
use std::collections::*;
use std::process::exit;
use std::cmp::max;

fn main() {
    let mut n:usize = read!();
    let mut x:usize = read!();
    for i in 1..n {
        let mut a:usize = read!();
        if x-1 > a{
            println!("No");
            exit(0);
        }
        if x-1==a {
            a+=1;
        }
        x=a;
    }
    println!("Yes");
}
//  [rust]
#[allow(dead_code)]
fn main() {
    let mut nn = i::u();
    let mut hh=i::iv(nn);


    let mut bh=0;
    let mut first = true;
    let mut bfalg =false;


    for x1 in 0..nn {
        let mut num1=x1;
        if (first){
            bh=hh[num1];
            first=false;
            bfalg=false;
        }else{
            let mut sa1=(hh[num1]-bh);
            if (sa1>=0){
                bh=hh[num1];
                bfalg=false;
            }else if (sa1<(-1)){
                println!("No");
                return;
            }else{
                bh=hh[num1]+1;
                bfalg=true;
            }
        }

    }
    println!("Yes");

}


#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::num::*;
#[allow(unused_imports)]
use std::str::*;

#[allow(dead_code)]
mod i {
    use super::*;

    pub fn read<T: FromStr>() -> T {
        stdin()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse::<T>()
            .ok()
            .unwrap()
    }

    pub fn str() -> String {
        read()
    }

    pub fn s() -> Vec<char> {
        str().chars().collect()
    }

    pub fn i() -> i64 {
        read()
    }

    pub fn u() -> usize {
        read()
    }

    pub fn u2() -> (usize, usize) {
        (read(), read())
    }

    pub fn u3() -> (usize, usize, usize) {
        (read(), read(), read())
    }

    pub fn f() -> f64 {
        read()
    }

    pub fn c() -> char {
        read::<String>().pop().unwrap()
    }

    pub fn iv(n: usize) -> Vec<i64> {
        (0..n).map(|_| i()).collect()
    }
    pub fn strv(n: usize) -> Vec<String> {
        (0..n).map(|_| str()).collect()
    }

    pub fn iv2(n: usize) -> Vec<(i64, i64)> {
        (0..n).map(|_| iv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv(n: usize) -> Vec<usize> {
        (0..n).map(|_| u()).collect()
    }

    pub fn uv2(n: usize) -> Vec<(usize, usize)> {
        (0..n).map(|_| uv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv3(n: usize) -> Vec<(usize, usize, usize)> {
        (0..n).map(|_| uv(3)).map(|a| (a[0], a[1], a[2])).collect()
    }

    pub fn fv(n: usize) -> Vec<f64> {
        (0..n).map(|_| f()).collect()
    }

    pub fn cmap(h: usize) -> Vec<Vec<char>> {
        (0..h).map(|_| s()).collect()
    }
}
//  [rust]
use std::io::*;
use std::str::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}

fn usize() -> usize {
    read()
}

fn vec_usize(n: usize) -> Vec<usize> {
    let mut vec = Vec::new();
    for _ in 0..n {
        vec.push(usize())
    }
    vec
}

fn main() {
    let n = usize();
    let mut hs = vec_usize(n);

    if hs.len() == 1 {
        println!("Yes");
        return;
    }
    hs.reverse();
    let mut h = hs[0];
    for i in 1..hs.len() {
        if hs[i] > h + 1 {
            println!("No");
            return;
        }
        if hs[i] > h {
            h = hs[i] - 1;
        } else {
            h = hs[i];
        }
    }
    println!("Yes");
}
//  [swift]
import CoreFoundation

let n=Int(readLine()!)!
var arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
 
var i = 0
var p = arr[0]
var ret : String = ""

if( i == 1 ) {
  print( "Yes" )
  exit(0)
}

for i in 0..<n - 1 {
  let d = arr[i] - arr[i + 1]
  //print( d )
  if(  d > 0 ) {
    ret = "No"
    break
  } else if( d < 0 ) {
    arr[i + 1] -= 1
  } 
}

//print( arr )

if( ret == "" ) {
  print( "Yes" )
} else {
  print( "No" )
}
//  [typescript]
{
  const Main = (input: string) => {
    const inputArray: string[] = input.split(/ |\n/);
    if (!inputArray) return;
    const heightArrayStr: string[] = inputArray.filter((n, i) => i !== 0)
    const heightArray: number[] = heightArrayStr.map(n => parseInt(n)); 
    
    let work: boolean = true;
    let base: number = 0;
    const time: number = parseInt(inputArray[0]);
    for (let i = 0; i < time; i++) {
      if (heightArray[i] > base) {
        base = heightArray[i];
      } else if (base - 1 > heightArray[i]) {
        work = false;
        i = time;
      }
    }

    console.log(work ? 'Yes' : 'No');
  }
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}
//  [typescript]
// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): { N: number, H: number[] } => {
  const N = +lines[0]
  const H = lines[1].split(' ').map(line => +line)
  const obj = { N, H }
  debug(obj)
  return obj
}
// solver
export const solve = (lines: string[]): string => {
  const { N, H } = parseLines(lines)
  let current = H[0]
  for (let i = 1; i < N - 1; i++) {
    if (current <= H[i] - 1) {
      current = H[i] - 1
    } else if (current <= H[i]) {
      current = H[i]
    } else {
      return 'No'
    }
  }

  if (current <= H[N-1] || current <= H[N-1] - 1) {
    return 'Yes'
  } else {
    return 'No'
  }

}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}
//  [typescript]
// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): { N: number, H: number[] } => {
  const N = +lines[0]
  const H = lines[1].split(' ').map(line => +line)
  const obj = { N, H }
  debug(obj)
  return obj
}
// solver
export const solve = (lines: string[]): string => {
  const { N, H } = parseLines(lines)
  let current = H[0]
  for (let i = 1; i < N; i++) {
    if (current <= H[i] - 1) {
      current = H[i] - 1
    } else if (current <= H[i]) {
      current = H[i]
    } else {
      return 'No'
    }
  }
  return 'Yes'
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}
//  [python]
import sys
import time
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
from operator import itemgetter
MAX_INT = int(10e18)
MIN_INT = -MAX_INT
mod = 1000000000+7
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
s = [S() for i in range(N)]

d = [0]*4
for i in range(N):
  if s[i] == "AC":
    d[0] += 1
  elif s[i] == "WA":
    d[1] += 1
  elif s[i] == "TLE":
    d[2] += 1
  else:
    d[3] += 1

print("AC x",d[0])
print("WA x",d[1])
print("TLE x",d[2])
print("RE x",d[3])
//  [python]
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    d = collections.defaultdict(int)
    for i in range(N):
        s = S()
        d[s] += 1
    for s in ['AC', 'WA', 'TLE', 'RE']:
        print('{} x {}'.format(s, d[s]))


main()
//  [python]
def examA():
    N = I()
    ans = (10000 - N)%1000
    print(ans)
    return

def examB():
    T = ["AC","WA","TLE","RE"]
    N = I()
    S = [SI()for _ in range(N)]

    ans = [0]*4
    for s in S:
        for i in range(4):
            if s==T[i]:
                ans[i] += 1
                break
    for i in range(4):
        print(T[i]+" x "+str(ans[i]))
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examB()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""
//  [java]
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		List<String> listAC = new ArrayList<String>();
		List<String> listWA = new ArrayList<String>();
		List<String> listTLE = new ArrayList<String>();
		List<String> listRE = new ArrayList<String>();
		for (int i = 0; i < n; i++) {
			sc.nextLine();
			String s = sc.next();
			switch (s) {
			case "AC" : listAC.add(s); break;
			case "WA" : listWA.add(s); break;
			case "TLE" : listTLE.add(s); break;
			case "RE" : listRE.add(s); break;
			}
		}
		System.out.println("AC x " + listAC.size());
		System.out.println("WA x " + listWA.size());
		System.out.println("TLE x " + listTLE.size());
		System.out.println("RE x " + listRE.size());
//		AC x 3
//		WA x 1
//		TLE x 2
//		RE x 0

	}
}
//  [java]
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int num = Integer.valueOf(sc.nextInt());
    
    Map<String, Integer> map = new HashMap<String, Integer>();
    map.put("AC", 0);
    map.put("WA", 0);
    map.put("TLE", 0);
    map.put("RE", 0);    

    while(sc.hasNext()) {
      String str = sc.nextLine();
      if (map.containsKey(str)) {
        map.put(str, map.get(str)+1);
      }
    }

    System.out.println("AC x "+ map.get("AC"));
    System.out.println("WA x "+ map.get("WA"));
    System.out.println("TLE x "+ map.get("TLE"));
    System.out.println("RE x "+ map.get("RE"));

    sc.close();
  }
}
//  [java]
import java.io.*;
import java.lang.*;
import java.util.*;

 public class Main{
  
 public static void main(String args[]){
   
  Scanner s = new Scanner(System.in);
   
   int x =s.nextInt();
  s.nextLine();
   int ac=0,wa=0,tle=0,re=0;
   while(x-- >0){
       String g = s.nextLine();
     if(g.equals("AC"))
       ac++;
     else if(g.equals("WA"))
       wa++;
     else if(g.equals("TLE"))
       tle++;
     else if(g.equals("RE"))
       re++;
         
   }
   
   System.out.println("AC x "+ac);
   System.out.println("WA x "+wa);
   System.out.println("TLE x "+tle);
   System.out.println("RE x "+re);
 }
  
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define ms(a ,value) memset(a ,value,sizeof(a))
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define N 20000000
class Triplet{
	public:
		int x , y , z;	
};
const int dx[4] = {0,0,1,-1};
const int dy[4] = {1,-1,0,0};
const int mod = 1e9+7;
vector <int> adj[N];
string str;
map <string,int> freq;
const double PI=3.1415926535897;
typedef long long int ll;

int main(){
	ios::sync_with_stdio(false);
  	cin.tie(0);
  	freq["AC"]=0;
  	freq["WA"]=0;
  	freq["TLE"]=0;
  	freq["RE"]=0;
	int t;
	cin>>t;
	while(t--){
		cin>>str;
		freq[str]++;
	}
	cout<<"AC x "<<freq["AC"]<<endl;
	cout<<"WA x "<<freq["WA"]<<endl;
	cout<<"TLE x "<<freq["TLE"]<<endl;
	cout<<"RE x "<<freq["RE"]<<endl;
	return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
 
int main(void){
  int i=0,N;
  int c0=0,c1=0,c2=0,c3=0;  
  
  scanf("%d",&N);
  
  char s[N][256];
  
  for(i=0;i<N;i++){
    scanf("%s",s[i]);
    if(strcmp(s[i],"AC")==0)
      c0++;
    if(strcmp(s[i],"WA")==0)
      c1++;
    if(strcmp(s[i],"TLE")==0)
      c2++;
    if(strcmp(s[i],"RE")==0)
      c3++;
  }
  printf("AC x %d\n",c0);
  printf("WA x %d\n",c1);
  printf("TLE x %d\n",c2);
  printf("RE x %d\n",c3);
  return 0;
}
//  [c]
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define PI acos(-1)
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;

int main(void) {
  /* 標準入力フラグ */
  int   scan;

  /* 数入力 */
  ll    answer;
  ll    n;
  char    **s;
  answer = 0;
  scan = scanf("%lld", &n);
  s = (char **)malloc(sizeof(char *) * n);
  for (ll j = 0; j < n; j++) {
    s[j] = (char *)malloc(sizeof(char) * 4);
  }
  for (ll i = 0; i < n; i++) {
    scan = scanf("%s", s[i]);
  }

  /* プログラムを書く */
  ll  ac = 0;
  ll  wa = 0;
  ll  tle = 0;
  ll  re = 0;

  for (ll k = 0; k < n; k++) {
    if (s[k][0] == 'A' && s[k][1] == 'C')
      ac++;
    if (s[k][0] == 'W' && s[k][1] == 'A')
      wa++;
    if (s[k][0] == 'T' && s[k][1] == 'L' && s[k][2] == 'E')
      tle++;
    if (s[k][0] == 'R' && s[k][1] == 'E')
      re++;
  }
    
  /* 文回答 */
  printf("AC x %lld\n", ac);
  printf("WA x %lld\n", wa);
  printf("TLE x %lld\n", tle);
  printf("RE x %lld\n", re);

  return (0);
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main () {
	int N;
	scanf("%d", &N);
	char **S = malloc((N + 1) * sizeof(char*));
	int c_ac = 0;
	int c_wa = 0;
	int c_tle = 0;
	int c_re = 0;
	for (int i = 1; i <= N; i++)
	{
		S[i] = malloc(4 * sizeof(char));
		scanf("%s", S[i]);
		if(strcmp(S[i], "AC") == 0) {
			c_ac++;
		} else if (strcmp(S[i], "WA") == 0) {
			c_wa++;
		} else if (strcmp(S[i], "TLE") == 0) {
			c_tle++;
		} else {
			c_re++;
		}
	}
	printf("AC x %d\n", c_ac);
	printf("WA x %d\n", c_wa);
	printf("TLE x %d\n", c_tle);
	printf("RE x %d\n", c_re);

	return (0);
}
//  [javascript]
function main(input = "") {
    const lines = input.split("\n");
    const datas = ["AC", "WA", "TLE", "RE"];
    let cnts = new Int32Array(4);

    for (let i = 1; i < lines.length; i++) {
        for (let k = 0; k < 4; k++) {
            if (lines[i] === datas[k]) {
                cnts[k]++;
                break;
            }
        }
    }

    let res = "";
    for(let i = 0; i < 4; i++){
        res += `${datas[i]} x ${cnts[i]}` + "\n"
    }
    res = res.trim();
    return res;
}

//******************************
exports.main = main;

function Main(input) {
    console.log(main(input.trim()));
}

if (process.argv[2] !== "test") {
    Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}
//  [javascript]
"use strict";

const main = (input) => {
    const spi = input.split('\n');
    const n = parseInt(spi[0]);
    const map = new Map([["AC", 0], ["WA", 0], ["TLE", 0], ["RE", 0],]);
    
    for (let i = 1; i < n + 1; i++) {
        map.set(spi[i], map.get(spi[i])+1);
    }

    for (let entry of map.entries()) {
        console.log(entry[0] + " x " + entry[1]);
    }
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
var GET = (function () {function f(s) {return new g(s);}function g(s) {this._s = s.trim().split("\n");}g.prototype.getValue = function (n) {return this._s[n];};g.prototype.getArray = function (n) {return this.stoa(this._s[n]);};g.prototype.slice = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stox(v));};g.prototype.sliceArray = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stoa(v));};g.prototype.stoa = function (s) {return s.split(" ").map(v => this.stox(v));};g.prototype.stox = function (v) {var i = +v;return (i === i) ? i : v;};return f;})();
var o = GET(require("fs").readFileSync("/dev/stdin", "utf8"));

console.log(main());
function main(){
    var N = o.getValue(0);
    var C = {
        'AC': 0,
        'WA': 0,
        'TLE': 0,
        'RE': 0
    };

    for(var i = 0; N > i; i++) {
        var key = o.getValue(i + 1);
        C[key]++;
    }

    return Object.keys(C).map(function (v) {
        return `${v} x ${C[v]}`;
    }).join('\n');
}
//  [go]
package main

import "fmt"

func scanStrings(len int) (strings []string) {
	var str string
	for i := 0; i < len; i++ {
		fmt.Scanf("%s", &str)
		strings = append(strings, str)
	}
	return
}

func main()  {
	var n int
	fmt.Scan(&n)


	ac := 0;
	wa := 0;
	tle := 0;
	re := 0;

	result := scanStrings(n)
	for i := range result {
		col := result[i]

		if col == "AC"{
			ac += 1
		}else if col == "WA"{
			wa += 1
		}else if col == "TLE"{
			tle += 1
		}else if col == "RE"{
			re += 1
		}
	}

	fmt.Println("AC x", ac)
	fmt.Println("WA x", wa)
	fmt.Println("TLE x", tle)
	fmt.Println("RE x", re)

}
//  [go]
package main

import (
	"fmt"
)


func main(){
	var n int
	fmt.Scanf("%d",&n)
	m:=make(map[string]int)
	keys:=[]string{"AC","WA","TLE","RE"}
	for i:=0;i<n;i++{
		var s string
		fmt.Scanf("%s\n",&s)
		m[s]=m[s]+1
	}
	for _,s:=range keys{
		fmt.Printf("%s x %d\n", s, m[s])
	}

}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)
	tests := make([]string, n)
	i := 0
	for i < n {
		fmt.Scanf("%s", &tests[i])
		i++
	}

	m := map[string]int{"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
	for _, s := range tests {
		m[s]++
	}
	fmt.Printf("AC x %d\n", m["AC"])
	fmt.Printf("WA x %d\n", m["WA"])
	fmt.Printf("TLE x %d\n", m["TLE"])
	fmt.Printf("RE x %d", m["RE"])
}
//  [ruby]
n = gets.to_i
C_0,C_1,C_2,C_3 = 0,0,0,0
n.times do
  s = gets.chomp()
  if s == 'AC'
    C_0 += 1
  elsif s == 'WA'
    C_1 += 1
  elsif s == 'TLE'
    C_2 += 1
  else
    C_3 += 1
  end
end

print('AC x ',C_0, "\n")
print('WA x ',C_1,"\n")
print('TLE x ',C_2,"\n")
print('RE x ', C_3,"\n")
//  [ruby]
N = gets.to_i
S = N.times.map{gets.chomp.split.map(&:to_s)}.flatten
a = S.count("AC")
b = S.count("WA")
c = S.count("TLE")
d = S.count("RE")

puts "AC x #{a}"
puts "WA x #{b}"
puts "TLE x #{c}"
puts "RE x #{d}"
//  [ruby]
N = gets.chomp.to_i
S = N.times.map{gets.chomp.to_s}

countac = 0
countwa = 0
counttle = 0
countre = 0

(0...N).each do |i|
  if S[i] == "AC"
    countac += 1
  elsif S[i] == "WA"
    countwa += 1
  elsif S[i] == "TLE"
    counttle += 1
  elsif S[i] == "RE"
    countre += 1
  end
end

puts "AC x #{countac}"
puts "WA x #{countwa}"
puts "TLE x #{counttle}"
puts "RE x #{countre}"
//  [rust]
use proconio::input;

fn main() {
    input! {
        n: usize,
        s: [String; n],
    }

    let ac = s.iter().filter(|x| x.to_string() == "AC").count();
    let wa = s.iter().filter(|x| x.to_string() == "WA").count();
    let tle = s.iter().filter(|x| x.to_string() == "TLE").count();
    let re = s.iter().filter(|x| x.to_string() == "RE").count();

    println!("AC x {}", ac);
    println!("WA x {}", wa);
    println!("TLE x {}", tle);
    println!("RE x {}", re);
}
//  [rust]
//use itertools::Itertools;
use std::cmp;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::io::Read;
use std::usize::MAX;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        n: usize,
        s: [chars;n]
    }

    let mut ac = 0;
    let mut wa = 0;
    let mut tle = 0;
    let mut re = 0;

    //println!("{:?}", s);
    for i in 0..n {
        match s[i][0] {
            'A' => {
                ac += 1;
            }
            'W' => {
                wa += 1;
            }
            'T' => {
                tle += 1;
            }
            'R' => {
                re += 1;
            }
            _ => {}
        }
    }

    println!("AC x {}", ac);
    println!("WA x {}", wa);
    println!("TLE x {}", tle);
    println!("RE x {}", re);
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet
//  [rust]
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::collections::HashMap;

fn main() {
    let mut map: HashMap<String, usize> = HashMap::new();

    map.insert(String::from("AC"), 0);
    map.insert(String::from("WA"), 0);
    map.insert(String::from("TLE"), 0);
    map.insert(String::from("RE"), 0);

    let n: usize = read();
    let mut r: Vec<String> = vec![];
    for _ in 0..n {
        r.push(read());
    }

    for i in 0..r.len() {
        let ri = &r[i];
        let current = map.get_mut(ri).unwrap();
        *current += 1;
    }

    println!("AC x {}", map.get("AC").unwrap());
    println!("WA x {}", map.get("WA").unwrap());
    println!("TLE x {}", map.get("TLE").unwrap());
    println!("RE x {}", map.get("RE").unwrap());
}
//  [swift]
import Foundation

struct Mojiretu: Equatable {
    var characters: [Int]
    
    init(characters: [Int]) {
        
        self.characters = characters
    }
    init(_ slice: ArraySlice<Int>) {
        
        self.characters = Array(slice)
    }
}

extension Mojiretu {
    struct KeyCode {
        static let space = 0x20
        static let lf = 0x0A
    }
    
    static func readLine() -> Mojiretu {
        .init(characters:
            (0...)
                .lazy
                .map { _ in Int(getchar()) }
                .prefix { $0 != KeyCode.lf }
        )
    }
    
    static func readToken() -> Mojiretu {
        .init(characters:
            (0...)
                .lazy
                .map { _ in Int(getchar()) }
                .prefix { $0 != KeyCode.lf && $0 != KeyCode.space }
        )
    }
    
    var tokens: [Mojiretu] {
        characters
            .split { $0 == KeyCode.lf || $0 == KeyCode.space }
            .map(Mojiretu.init)
    }
}

struct MojiretuCharacterIterator: IteratorProtocol {
    private var iter: IndexingIterator<Array<Int>>
    
    init(_ Mojiretu: Mojiretu) {
        iter = Mojiretu.characters.makeIterator()
    }
    
    mutating func next() -> Character? {
        guard let i = iter.next() else { return nil }
        
        return Unicode.Scalar(i).map(Character.init)
    }
}

extension Mojiretu: Sequence {
    
    func makeIterator() -> MojiretuCharacterIterator {
        MojiretuCharacterIterator(self)
    }
}


extension Mojiretu {
    var integer: Int {
        characters
            .lazy
            .map { $0 - Int("0".utf8.first!) }
            .prefix { (0...9) ~= $0 }
            .reduce(0) { r, i in r * 10 + i }
    }
    
    var string: String {
        .init(
            characters
                .compactMap(Unicode.Scalar.init)
                .map(Character.init)
        )
    }
}


extension Mojiretu {
    
    static func == (lhs: Mojiretu, rhs: String) -> Bool {
        lhs.string == rhs
    }
    
    static func == (lhs: String, rhs: Mojiretu) -> Bool {
        lhs == rhs.string
    }
    
    static func ~= (lhs: Mojiretu, rhs: String) -> Bool {
        lhs == rhs
    }
    
    static func ~= (lhs: String, rhs: Mojiretu) -> Bool {
        lhs == rhs
    }
}


let n = Mojiretu.readLine().integer

let judge = (1...n)
  .map { _ in Mojiretu.readLine() }
  .reduce((0, 0, 0, 0)) { r, m in
    switch m {
      case "AC": return (r.0 + 1, r.1, r.2, r.3)
      case "WA": return (r.0, r.1 + 1, r.2, r.3)
      case "TLE": return (r.0, r.1, r.2 + 1, r.3)
      case "RE": return (r.0, r.1, r.2, r.3 + 1)
      default: return (r.0, r.1, r.2, r.3)
    }
  }

print("AC x", judge.0)
print("WA x", judge.1)
print("TLE x", judge.2)
print("RE x", judge.3)
//  [swift]
import Foundation

extension String {
    func wordsMap<T>(_ f: (Substring) -> T?) -> [T] {
        return self.split(separator: " ").compactMap(f)
    }
}

private func readWords<T>(_ f: (Substring) -> T?) -> [T] {
    return readLine()!.wordsMap(f)
}

extension Optional {
    func pleaseAC(){
        print(self!)
    }
}

readLine().map { line -> Any in 
    let n = Int(line)!
    var ans = [String:Int]()

    for _ in 1...n {
        let s = readLine()!
        ans[s, default: 0] += 1
    }

    for s in ["AC","WA","TLE","RE"] {
        print("\(s) x \(ans[s] ?? 0)")
    }
    
    return ""
}
.pleaseAC()
//  [swift]
import Foundation
var r = Int(readLine()!)!
var ac = 0
var wa = 0
var tle = 0
var re = 0
for _ in 0 ..< r {
   let arr=readLine()!
    if arr == "AC" {
        ac += 1
    }
    if arr == "WA" {
           wa += 1
    }
    if arr == "TLE" {
           tle += 1
       }
    if arr == "RE" {
           re += 1
       }
}
print("AC x "+String(ac))
print("WA x "+String(wa))
print("TLE x "+String(tle))
print("RE x "+String(re))
//  [typescript]
import { readFileSync } from 'fs'

function main(input: string) {
    let [n, ...S] = input.split('\n')
    console.log("AC x " + S.filter(s => s === 'AC').length)
    console.log("WA x " + S.filter(s => s === 'WA').length)
    console.log("TLE x " + S.filter(s => s === 'TLE').length)
    console.log("RE x " + S.filter(s => s === 'RE').length)
}

let lines: string;
const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', function (line: string) {
  lines += line;
  lines += '\n';
});
reader.on('close', function () {
    main(lines)
});
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const N = Number(input[0][0]);

  let AC = 0;
  let WA = 0;
  let TLE = 0;
  let RE = 0;

  for (let i = 1; i <= N; i++) {
    const S = input[i][0];

    switch (S) {
      case "AC": {
        AC += 1;
        break;
      }
      case "WA": {
        WA += 1;
        break;
      }
      case "TLE": {
        TLE += 1;
        break;
      }
      case "RE": {
        RE += 1;
        break;
      }
    }
  }

  return [`AC x ${AC}`, `WA x ${WA}`, `TLE x ${TLE}`, `RE x ${RE}`].join("\n");
};

console.log(main(read()));
//  [typescript]
import { readFileSync } from 'fs'
import { reverse } from 'dns'
import { start } from 'repl'
 
let lines: string[] = [];
const reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
 
reader.on('line', function (line: string) {
    lines.push(line);
});
reader.on('close', function () {
    /* let [n, d] = lines[0].split(' ').map( _ => parseInt(_)) */
    let n = parseInt(lines[0])
    let ac = 0, wa = 0, tle = 0, re = 0

    for(let i = 0; i < n; i++) {
        let s = lines[i+1]
        if(s == 'AC') {
            ac++
        } else if (s == 'WA') {
            wa++
        } else if (s == 'TLE') {
            tle++
        } else {
            re++
        }
    }


    console.log(`AC x ${ac}`);
    console.log(`WA x ${wa}`);
    console.log(`TLE x ${tle}`);
    console.log(`RE x ${re}`);
});