jiahuimbzuai/CoQuIR huggingface dataset:
//  [swift]
import Foundation
import CoreFoundation

#if swift(>=4.0)
#else
extension String {
    func split(separator separator: Character) -> [String] {
        return self.characters.split(separator).map{String($0)}
    }
    var count: Int {
        return self.characters.count
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    mutating func swapAt(i: Int, _ j: Int) {
        swap(&self[i], &self[j])
    }
    func joined(separator separator: String = " ") -> String {
        return self.map{String($0)}.joinWithSeparator(separator)
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func reverse() {
        self = self.reversed()
    }
    func enumerated() -> EnumerateSequence<[Element]> {
        return self.enumerate()
    }
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: Character = " ") -> [String] {
    return readLine()!.split(separator: separator)
}
func readIntSplit(by separator: Character = " ") -> [Int] {
    return readLine()!.split(separator: separator).map{Int($0)!}
}
prefix operator * { }
prefix func * <T> (a: [T]) -> (T, T)          { return (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T)       { return (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T)    { return (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { return (a[0], a[1], a[2], a[3], a[4]) }
infix operator ** { associativity right precedence 155 }    // 右結合，乗除算より強くビットシフトより弱い
func **(lhs: Int, rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
func **(lhs: Int, rhs: Double) -> Double {
    return pow(Double(lhs), rhs)
}
//func gcd(x: Int, _ y: Int) -> Int {
//    return y>0 ? gcd(y, x%y) : x
//}
//func lcm(x: Int, _ y: Int) -> Int {
//    return x * y / gcd(x, y)
//}
let MOD = 10**9+7

/*************** テストスペース ***************/

//arr.sort{$0.0==$1.0 ? $0.1<$1.1 : $0.0<$1.0}  // タプル配列のソート

/*************** メインプログラム ***************/

let N = readInt()!
var H = readIntSplit()
for i in 0..<N-1 {
    if H[i] > H[i+1] {
        H[i] -= 1
    }
}
var ans = "Yes"
for i in 0..<N-1 {
    if H[i] > H[i+1] {
        ans = "No"
        break
    }
}
print(ans)
//  [typescript]
'use strict'
const main = (input: string) => {
    const std: string[] = input.trim().split('\n');
    const n: number = ~~std.shift();
    let h: number[] = std[0].split(' ').map(Number);
    for (let i = 0; i < n-1; i++) {
        if (h[i] > h[i+1]) {
            return console.log("No");
        }
        if (h[i] < h[i+1]) {
            h[i+1]--;
        }
    }
    console.log("Yes");
    
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
function main(input) {
  input = input.trim().split("\n");
  const n = Number(input[0]);
  const hs = input[1].split(" ").map(a => Number(a));
  let prevH = 0;
  let result = "Yes";
  for (let i = 0; i < n-1; i++) {
    const h = hs[i];
    const nextH = hs[i+1];
    if (1 < h - nextH) {
      result = "No";
      break;
    } else if (h - nextH === 1) {
      if (i !== 0 && nextH < prevH) {
        result = "No";
        break;
      }
      prevH = nextH;
    } else {
      prevH = prevH < h ? h-1 : h;
    }
  }
  console.log(result);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const n = Number(stdin.split('\n')[0])
const h = stdin
  .split('\n')[1]
  .split(' ')
  .map(Number)

const ans = () => {
  let max = h[0]

  for (let i = 1; i < n; i++) {
    if (max - h[i] > 1) {
      return 'No'
    }

    max = Math.max(max, h[i])
  }

  return 'Yes'
}

console.log(ans())
//  [typescript]
'use strict'
const main = (input: string) => {
    const std: string[] = input.trim().split('\n');
    const n: number = ~~std.shift();
    let h: number[] = std[0].split(' ').map(Number);
    if (n === 1) {
        console.log("Yes");
        return;
    }
    for (let i = 1; i < h.length-1; i++) {
        if ((h[i] - h[i-1] >= 3) && (h[i+1] - h[i] >= 3)) {
            console.log("No");
            return;
        }
        if (i+1 === h.length -1 && (h[i+1] > h[i] || h[i+1]+1 > h[i])) {
            console.log("Yes");
            return;
        }
        if (i+1 === h.length -1 && (h[i+1] <= h[i] || h[i+1]+1 <= h[i])) {
            console.log("No");
            return;
        } 
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
'use strict'
const main = (input: string) => {
    const std: string[] = input.trim().split('\n');
    const n: number = ~~std.shift();
    let h: number[] = std[0].split(' ').map(Number);
    for (let i = 1; i < h.length-1; i++) {
        if ((h[i] - h[i-1] >= 3) && (h[i+1] - h[i] >= 3)) {
            console.log("No");
            return;
        }
        if (i+1 === h.length -1 && (h[i+1] > h[i] || h[i+1]+1 > h[i])) {
            console.log("Yes");
            return;
        }
        if (i+1 === h.length -1 && (h[i+1] <= h[i] || h[i+1]+1 <= h[i])) {
            console.log("No");
            return;
        } 
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<functional>

#define vec2c vector<vector<char>>
#define vec2i vector<vector<int>>
#define vecc vector<char>
#define vecs vector<string>
#define veci vector<int>
#define vecd vector<double>
#define rep(i, n) for(int i=0; i < (int)(n); i++)
#define rrep(i, n) for(int i=(int)(n); i>=0;i--)

using namespace std;

int main() {

  int n;
  veci h;

  cin >> n;
  rep(i, n) {
    int x;
    cin >> x;
    h.push_back(x);
  }

  for(int i=0; i<n-1; i++) {
    if (h[i] == h[i+1]) {
      continue;
    }
    else if (h[i] <= h[i+1] - 1) {
      h[i+1]--;
      continue;
    }
    else {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;
  return 0;
}
//  [python]
c=open(0).read().count
for s in'AC','WA','TLE','RE':print(s, 'x',c(s))
//  [python]
s = open(0).read().count
for r in "AC", "WA", "TLE", "RE":
    print(r, "x", s(r))
//  [python]
c=open(0).read().count
for s in'AC','WA','TLE','RE':print(s,'x',c(s))
//  [python]
# listじゃなくてdict使いたい
n = int(input())
j = [0] * 4
for i in range(n):
    s=input()
    if s == "AC":
        j[0] += 1
    elif s=="WA":
        j[1] += 1
    elif s=="TLE":
        j[2] += 1
    elif s == "RE":
        j[3] += 1
for k in range(4):
    print(f"AC x {j[k]}")
//  [python]
# listじゃなくてdict使いたい
n = int(input())
j = [0] * 4
for i in range(n):
    s=input()
    if s == "AC":
        j[0] += 1
    elif s=="WA":
        j[1] += 1
    elif s=="TLE":
        j[2] += 1
    elif s == "RE":
        j[3] += 1
for k in range(4):
    print(f"AC × {j[k]}")
//  [python]
N=int(input())
ac=0
wa=0
tle=0
re=0
for _ in range(N):
  s=input()
  if 'AC'==s:
     ac+=1
  elif 'WA'==s:
    wa+=1
  elif 'TLE'==s:
    tle+=1
  elif 'RE'==s:
    re+=1
print('AC',x,ac)
print('WA',x,wa)
print('TLE',x,tle)
print('RE',x,re)
//  [java]
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		String[] S = new String[N]; 
		String[] conc = {"AC", "WA", "TLE", "RE"};
      	for(int k = 0; k < N; k++){
          S[k] = sc.nextLine();
        }
		
		for(int i = 0; i < 4; i++){
			for(int j = 0; j < N; j++){
				if(S[j].equals(conc[i])){
					cnt++;
					System.out.println(conc[i]+" × "+cnt);
				}
			}
			cnt = 0;
		}
	}
}
//  [java]
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		String[] S = new String[N]; 
		String[] conc = {"AC", "WA", "TLE", "RE"};
      	for(int k = 0; k < N; k++){
          S[k] = sc.nextLine();
        }
		
		for(int i = 0; i < 4; i++){
			for(int j = 0; j < N; j++){
				if(S[j].equals(conc[i])){
					cnt++;
					System.out.println(conc[i]+"×"+cnt);
				}
			}
			cnt = 0;
		}
	}
}
//  [java]
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
		 int N = sc.nextInt();
		 int A = 0;
		 int W = 0;
		 int T = 0;
		 int R = 0;
		 for(int i =0; i < N; i++) {
			 String S = sc.next();
			 if(S.equals("AC")) {
				 A++;
			 }
			 else if(S.equals("WA")) {
				 W++;
			 }
			 else if(S.equals("TLE")) {
				 T++;
			 }
			 else if(S.equals("RE")) {
				 R++;
			 }
		 }
		 System.out.println("AC × " + A);
		 System.out.println("WA × " + W);
		 System.out.println("TLE × " + T);
		 System.out.println("RE × " + R);
		 sc.close();
	}
}
//  [cpp]
#pragma GCC optimize("Ofast")
#include<stdio.h>
int main(void)
{
    int n = 0;
    char c=getchar_unlocked();
    while(c<='9'&&c>='0') {n=(n<<1)+(n<<3)+c-'0'; c=getchar_unlocked();}
    int a = 0, b = 0, e = 0, d = 0;
    do
    {
        switch(getchar_unlocked())
        {
          case 'A': ++a;break;
          case 'W': ++b;break;
          case 'R': ++d;break;
          default: ++e;getchar_unlocked();
        }
        getchar_unlocked();
        getchar_unlocked();
    } while(--n);
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d", a, b, e, d);
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<string> S(N);
    int AC=0;
    int WA=0;
    int TLE=0;
    int RE=0;
    for (int i=0;i<N;i++){
        cin >> S.at(i);
        if (S.at(i)=="AC") {AC++;}
        if (S.at(i)=="WA") {WA++;}
        if (S.at(i)=="TLE") {TLE++;}
        if (S.at(i)=="RE") {RE++;}
    }// Your code here!
    cout << "AC x" << AC << endl;
    cout << "WA x" << WA << endl;
    cout << "TLE x" << TLE << endl;
    cout << "RE x" << RE << endl;
}
//  [cpp]
#include<iostream>
#include<string>
using namespace std;
int main(){
    string c;
    int n,ac=0,wa=0,tle=0,re=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>c;
        if(c="AC")ac++;
        if(c="WA")wa++;
        if(c="TLE")tle++;
        if(c="RE")re++;
    }
    cout<<"AC x "<<ac<<endl<<"WA x "<<wa<<endl<<"TLE x "<<tle<<endl<<"RE x "<<re<<endl;
    return 0;
}
//  [cpp]
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(void) {

    int n;
    int q = 0, p = 0, e = 0,g = 0;
    string s;
    // 検索先の文字列
    string a = "A"; // 検索文字列 // AC
    string w = "W"; // WA
    string t = "T"; // TLE
    string r = "R"; // RE

    cin >> n;


    for (int i = 0; i < n; i++) {

        cin >> s;

        
        if (s.find_first_of("A") == 0) {
            
            q++;

        }

        if (s.find_first_of("W") == 0) {

            p++;

        }

        if (s.find_first_of("T") == 0) {

            e++;

        }

        
        if (s.find_first_of("R") == 0) {

            g++;

        }


    }


    cout << "AC × " << q << endl;
    cout << "WA × " << p << endl;
    cout << "TLE × " << e << endl;
    cout << "RE × " << g << endl;

    
    return 0;
}
//  [c]
#pragma GCC optimize("Ofast")
#include<stdio.h>
int main(void)
{
    int n = 0;
    char c=getchar_unlocked();
    while(c<='9'&&c>='0') {n=(n<<1)+(n<<3)+c-'0'; c=getchar_unlocked();}
    int a = 0, b = 0, e = 0, d = 0;
    do
    {
        switch(getchar_unlocked())
        {
          case 'A': ++a;break;
          case 'W': ++b;break;
          case 'R': ++d;break;
          default: ++e;getchar_unlocked();
        }
        getchar_unlocked();
        getchar_unlocked();
    } while(--n);
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d", a, b, e, d);
    return 0;
}
//  [c]
#pragma GCC optimize("Ofast")
#include<stdio.h>
int main(void)
{
    int n = 0;
    char c=getchar_unlocked();
    while(c<='9'&&c>='0') {n=(n<<1)+(n<<3)+c-'0'; c=getchar_unlocked();}
    int a = 0, b = 0, e = 0, d = 0;
    while(--n)
    {
        switch(getchar_unlocked())
        {
          case 'A': ++a;break;
          case 'W': ++b;break;
          case 'R': ++d;break;
          default: ++e;getchar_unlocked();
        }
        getchar_unlocked();
        getchar_unlocked();
    }
        switch(getchar_unlocked())
        {
          case 'A': ++a;break;
          case 'W': ++b;break;
          case 'R': ++d;break;
          default: ++e;
        }
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d", a, b, e, d);
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
char x[10];
int a,w,t,r;
int main(){
	int n,i;
	scanf("%d",&n);
	while(n--){
		scanf("%s",x);
		if(s[0]=='A')a++;
		else if(s[0]=='W')w++;
		else if(s[0]=='T')t++;
		else if(s[0]=='R')r++;
	}
	printf("AC x %d\n",a);
	printf("WA x %d\n",w);
	printf("TLE x %d\n",t);
	printf("RE x %d\n",r);
	return 0;
}
//  [c]
#include<stdio.h>
int main(void){
    int n;
    int counta = 0;
    int countw = 0;
    int countt = 0;
    int countr = 0;
    char a[5];
    scanf("%d",&n);
    for (int i = 0; i < n; i++)
    {
        scanf("%s",a);
        if (a[0] == 'A' && a[1] == 'C')
        {
            counta++;
        }
        if (a[0] == 'W' && a[1] == 'A')
        {
            countw++;
        }
        if (a[0] == 'T' && a[1] == 'L' && 'E')
        {
            countt++;
        }
        if (a[0] == 'R' && a[1] == 'E')
        {
            countr++;
        }
    }
    printf("AC * %d\n",counta);
    printf("WA * %d\n",countw);
    printf("TLE * %d\n",countt);
    printf("RE * %d\n",countr);
    
    return 0;
}
//  [c]
#include <stdio.h>

int a, AC, WA, TLE, RE;
char b[10000], A[10]=("AC"), W[10]=("WA"), T[10]=("TLE"), R[10]=("RE");

int main(){
	scanf("%d", &a);
	for(int i=0; i+1<=a; i++){
		scanf("%s", &b[i]);
	}
	for(int j=0; j+1<=a; j++){
		if(b[j]==A[0]) AC=AC+1;
		else if(b[j]==W[0]) WA=WA+1;
		else if(b[j]==T[0]) TLE=TLE+1;
		else if(b[j]==R[0]) RE=RE+1;
	}
	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", AC, WA, TLE, RE);
	return 0;
}
//  [javascript]
const Main = input => {
    input = input.split("\n");
    const n = parseInt(input[0], 10);
    input.shift();
    const s = input;

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

    for(let i = 0; i < n; i++) {
        switch(s[i]) {
            case "AC":
                ac++;
                break;
            case "WA":
                wa++;
                break;
            case "TLE":
                tle++;
                break;
            case "RE":
                re++;
                break;
            default:
                break;
        }
    }

    console.log(`AC x ${ac}
WA x ${wa}
TLE x ${tle}
RE x ${re}`);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    let array = input.split("\n");
    let item = parseInt(array[0]);

    let countAC = 0;
    let countWA = 0;
    let countTLE = 0;
    let countRE = 0;
    for (let i =1;i<=item;i++){
        if (array[i] == "AC"){
            countAC++;
        } else if (array[i] == "WA"){
            countWA++;
        } else if (array[i] == "TLE"){
            countTLE++;
        } else if (array[i] == "RE"){
            countRE++;
        }
    }
    console.log("AC x "+countAC);
    console.log("WA x "+countWA);
    console.log("TLE x "+countTLE);
    console.log("RE x "+countRE);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(lines) {
  const input = lines.split('\n')
  
  let AC = 0;
  let WA = 0;
  let TLE = 0;
  let RE = 0;
  
  for(let i=1; i<input.length; i++){
      if(input[i] === 'AC') AC++
      if(input[i] === 'WA') WA++
      if(input[i] === 'TLE') TLE++
      if(input[i] === 'RE') RE++
  }
  console.log('AC' + ' x ' + AC)
  console.log('WA' + ' x ' + WA)
  console.log('TLE' + ' x ' + TLE)
  console.log('RE' + ' x ' + RE)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input) {
   var tmp = input.split("\n");
   var num = parseInt(tmp[0]);
   var ary = [];
   var pst = 0;
   var numAC = 0;
   var numWA = 0;
   var numTLE = 0;
   var numRE = 0;
   
   
   for(pst=1; pst<=num; pst++){
       ary.push(tmp[pst]);
   }
   for(pst=0; pst<ary.length; pst++){
       if(ary[pst]==="AC"){
           numAC+=1;
       }else if(ary[pst]==="WA"){
           numWA+=1;
       }else if(ary[pst]==="TLE"){
           numTLE+=1;
       }else if(ary[pst]==="RE"){
           numRE+=1;
       }
   }
   
   console.log("AC　×　"+numAC);
   console.log("WA　×　"+numWA);
   console.log("TLE　×　"+numTLE);
   console.log("RE　×　"+numRE);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
   var tmp = input.split("\n");
   var num = parseInt(tmp[0]);
   var ary = [];
   var pst = 0;
   var numAC = 0;
   var numWA = 0;
   var numTLE = 0;
   var numRE = 0;
   
   
   for(pst=1; pst<=num; pst++){
       ary.push(tmp[pst]);
   }
   for(pst=0; pst<ary.length; pst++){
       if(ary[pst]==="AC"){
           numAC+=1;
       }else if(ary[pst]==="WA"){
           numWA+=1;
       }else if(ary[pst]==="TLE"){
           numTLE+=1;
       }else if(ary[pst]==="RE"){
           numRE+=1;
       }
   }
   
   console.log("AC × "+numAC);
   console.log("WA × "+numWA);
   console.log("TLE × "+numTLE);
   console.log("RE × "+numRE);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
   var tmp = input.split("\n");
   tmp[0] = parseInt(tmp[0]);
   var ary = [];
   var pst;
   var numAC = 0;
   var numWA = 0;
   var numTLE = 0;
   var numRE = 0;
   
   
   for(pst=1; pst<=tmp[0]; pst++){
       ary.push(tmp[pst]);
   }
   
   for(pst=0; pst<ary.length; pst++){
       if(ary[pst]==="AC"){
           numAC+=1;
       }else if(ary[pst]==="WA"){
           numWA+=1;
       }else if(ary[pst]==="TLE"){
           numTLE+=1;
       }else if(ary[pst]==="RE"){
           numRE+=1;
       }
   }
   
   console.log("AC × "+numAC);
   console.log("WA × "+numWA);
   console.log("TLE × "+numTLE);
   console.log("RE × "+numRE);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

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

func main() {

	scanner := bufio.NewScanner(os.Stdin)
	var n, ac, wa, tle, re int
	scanner.Scan()
	fmt.Sscan(scanner.Text(), &n)
	for i := 0; i < n; i++ {
		scanner.Scan()
		switch scanner.Text() {
		case "AC":
			ac++
		case "WA":
			wa++
		case "TLE":
			tle++
		case "RE":
			re++
		}
	}
	fmt.Printf("AC x %d\n", ac)
	fmt.Printf("WA x %d\n", wa)
	fmt.Printf("TLE x %d\n", tle)
	fmt.Printf("RE x %d\n", re)
}
//  [go]
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var n, ac, wa, tle, re int
	scanner.Scan()
	fmt.Sscan(scanner.Text(), &n)

	for i := 0; i < n; i++ {
		scanner.Scan()
		switch scanner.Text() {
		case "AC":
			ac++
		case "WA":
			wa++
		case "TLE":
			tle++
		default:
			re++
		}
	}

	fmt.Println("AC x", ac)
	fmt.Println("WA x", wa)
	fmt.Println("TLE x", tle)
	fmt.Println("RE x", re)
}
//  [go]
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var N int
	var AC, WA, TLE, RE int
	scanner.Scan()
	fmt.Sscan(scanner.Text(), &N)

	for i := 0; i < N; i++ {
		scanner.Scan()
		switch scanner.Text() {
		case "AC":
			AC++
		case "WA":
			WA++
		case "TLE":
			TLE++
		default:
			RE++
		}
	}
	line := `AC x %d
WA x %d
TLE x %d
RE x %d
`
	fmt.Printf(line, AC, WA, TLE, RE)
}
//  [go]
ackage main

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

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	a, err := strconv.Atoi(sc.Text())
	if err != nil {
		fmt.Println(err)
	}
	return a
}
func scanText() string {
	sc.Scan()
	return sc.Text()
}
func main() {
	sc.Split(bufio.ScanWords)

	N := scanInt()

	var (
		ACi  int
		WAi  int
		TLEi int
		REi  int
	)
	for i := 0; i < N; i++ {
		str := scanText()
		switch str {
		case "AC":
			ACi++
		case "WA":
			WAi++
		case "TLE":
			TLEi++
		default:
			REi++
		}
	}
	fmt.Printf("AC x %v\n", ACi)
	fmt.Printf("WA x %v\n", WAi)
	fmt.Printf("TLE x %v\n", TLEi)
	fmt.Printf("RE x %v\n", REi)
}
//  [go]
package main

import "fmt"

func main() {
  var n int
  _, err := fmt.Scanf("%d", &n)
  if err != nil {
    panic("error")
  }

  s := map[string]int{
    "AC":  0,
    "WA":  0,
    "TLE": 0,
    "RE":  0,
  }

  for i := 0; i < n; i++ {
    var cs string
    _, err := fmt.Scanf("%s", &cs)
    if err != nil {
      panic("error2")
    }
    if cs == "AC" {
      s["AC"] = s["AC"] + 1
    } else if cs == "WA" {
      s["WA"] = s["WA"] + 1
    } else if cs == "TLE" {
      s["TLE"] = s["TLE"] + 1
    } else if cs == "RE" {
      s["RE"] = s["RE"] + 1
    }
  }

  fmt.Printf("AC x %d\n", s["AC"])
  fmt.Printf("WA x %d\n", s["WA"])
  fmt.Printf("TLE x %d\n", s["TLE"])
  fmt.Printf("RE x %d\n", s["RE"])
}
~
//  [go]
AC
package main

import "fmt"

func main() {
  var n int
  _, err := fmt.Scanf("%d", &n)
  if err != nil {
    panic("error")
  }

  s := map[string]int{
    "AC":  0,
    "WA":  0,
    "TLE": 0,
    "RE":  0,
  }

  for i := 0; i < n; i++ {
    var cs string
    _, err := fmt.Scanf("%s", &cs)
    if err != nil {
      panic("error2")
    }
    if cs == "AC" {
      s["AC"] = s["AC"] + 1
    } else if cs == "WA" {
      s["WA"] = s["WA"] + 1
    } else if cs == "TLE" {
      s["TLE"] = s["TLE"] + 1
    } else if cs == "RE" {
      s["RE"] = s["RE"] + 1
    }
  }

  fmt.Printf("AC x %d\n", s["AC"])
  fmt.Printf("WA x %d\n", s["WA"])
  fmt.Printf("TLE x %d\n", s["TLE"])
  fmt.Printf("RE x %d\n", s["RE"])
}
//  [ruby]
h=$<.tally
%w(AC WA TLE RE).map{puts"#{_1} x #{h[_1+?\n]||0}"}
//  [ruby]
gets
S = $<.read.split.tally
%w(AC WA TLE RE).each {|c| puts "#{c} x #{S[c]||0}"}
//  [ruby]
gets
h = $<.tally
["AC\n", "WA\n", "TLE\n", "RE\n"].each{|k|
	puts"#{k.chomp} x #{h[k]||0}"
}
//  [ruby]
n = gets.to_i
i = 0
s = []

while i < n
  s << gets
  i += 1
end

ac = s.count("AC")
wa = s.count("WA")
tle = s.count("TLE")
re = s.count("RE")

puts "AC x #{ac}"
puts "WA x #{wa}"
puts "TLE x #{tle}"
puts "RE x #{re}"
//  [ruby]
n = gets.chomp.to_i
#p n
s = readlines.map(&:chomp)
#p s
ac = 0
wa = 0
tle = 0
re = 0
n.times{ |i|
	if s[i] == 'AC'
		ac += 1
	elsif s[i] == 'WA'
		wa +=1
	elsif s[i] == 'TLE'
		tle += 1
	elsif s[i] == 'RE'
		re += 1
	end
}
p "AC x #{ac}"
p "WA x #{wa}"
p "TLE x #{tle}"
p "RE x #{re}"
//  [ruby]
a={}
%w!AC WA TLE RE!.map{a[-1]=0}
gets.to_i{
  a[gets.chomp]+=1
  }
 
%w!AC WA TLE RE!.each do |n|
  puts "#{n} × #{a[n]}"
end
//  [rust]
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();

    let mut ac: usize = 0;
    let mut wa: usize = 0;
    let mut tle: usize = 0;
    let mut re: usize = 0;
    for _ in 0..n {
        let s = iterator.next().unwrap();
        if s == "AC" {
            ac += 1;
        } else if s == "WA" {
            wa += 1;
        } else if s == "TLE" {
            tle += 1;
        } else if s == "RE" {
            re += 1;
        }
    }

    return format!("AC x {}\nWA x {}\nTLE x {}\nRE x {}", ac, wa, tle, re);
}
//  [rust]
#![allow(unused_imports, dead_code, unused_variables, unused_mut)]
use std::cmp;
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::mem::swap;
use permutohedron::LexicalPermutation;
const INF: i32 = std::i32::MAX;
const MOD: i32 = 1e9 as i32 + 7;

struct Get<R: std::io::BufRead> {
    stdin: R,
    v: Vec<String>,
    i: usize,
}
impl<R: std::io::BufRead> Get<R> {
    pub fn new(stdin: R) -> Self {
        Get {
            stdin: stdin,
            v: Vec::new(),
            i: 0,
        }
    }
    fn split_line(&mut self) {
        self.i = 0;
        self.v.clear();
        let mut buf = String::new();
        self.stdin.read_line(&mut buf).unwrap();
        let buf = buf.trim().to_owned();
        let mut ws = buf.split_whitespace();
        loop {
            let x = ws.next();
            if x.is_none() {
                break;
            }
            let x = x.unwrap().to_owned();
            self.v.push(x);
        }
    }
    #[allow(dead_code)]
    pub fn once<T: std::str::FromStr>(&mut self) -> T {
        if self.i == self.v.len() {
            self.split_line();
        }
        let elem = &self.v[self.i];
        self.i += 1;
        elem.parse().unwrap_or_else(|_| panic!())
    }
    #[allow(dead_code)]
    pub fn line<T: std::str::FromStr>(&mut self) -> String {
        self.i = 0;
        self.v.clear();
        let mut buf = String::new();
        self.stdin.read_line(&mut buf).unwrap();
        let buf = buf.trim().to_owned();
        buf
    }
}

fn main() {
    let stdin = std::io::stdin();
    let stdin = std::io::BufReader::new(stdin.lock());
    let get = Get::new(stdin);
    solve(get);
}

fn solve<R: std::io::BufRead>(mut get: Get<R>) {
    let n: usize = get.once(); 
    let mut map = HashMap::new();
    map.insert("AC".to_string(), 0);
    map.insert("WA".to_string(), 0);
    map.insert("TLE".to_string(), 0);
    map.insert("RE".to_string(), 0);
    for i in 0..n {
        let s: String = get.once();
        *map.entry(s).or_insert_with(|| 0) += 1;
    }
    print!("AC\nx\n{}", map.get("AC").unwrap());
    print!("WA x {}", map.get("WA").unwrap());
    print!("TLE x {}", map.get("TLE").unwrap());
    print!("RE x {}", map.get("RE").unwrap());
}
//  [rust]
use proconio::input;

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

    let ac = 0;
    let wa = 1;
    let tle = 2;
    let re = 3;
    let mut ans = vec![0i64; 4];
    for s_i in s {
        match s_i.as_str() {
            "AC" => ans[ac] += 1,
            "WA" => ans[wa] += 1,
            "TLE" => ans[tle] += 1,
            "RE" => ans[tle] += 1,
            _ => unreachable!(),
        }
    }

    println!("AC x {}", ans[ac]);
    println!("WA x {}", ans[wa]);
    println!("TLE x {}", ans[tle]);
    println!("RE x {}", ans[re]);
}
//  [rust]
use proconio::input;

fn main() {
    abc173_b()
}

#[warn(dead_code)]
fn abc173_b() {
    input!(n: u16);
    let mut ac = 0;
    let mut wa = 0;
    let mut tle = 0;
    let mut re = 0;
    for _ in 1..n {
        input!(s: String);
        match &*s {
            "AC" => ac += 1,
            "WA" => wa += 1,
            "TLE" => tle += 1,
            "RE" => re += 1,
            _ => (),
        }
    }
    println!("AC x {}", ac);
    println!("WA x {}", wa);
    println!("TLE x {}", tle);
    println!("RE x {}", re);
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let n = Int(readLine()!)!
    var ac = 0
    var wa = 0
    var tle = 0
    var re = 0
    for _ in 0..<n {
        let s = readLine()!
        if s == "AC" {
            ac += 1
        } else if s == "WA" {
            wa += 1
        } else if s == "TLE" {
            tle += 1
        } else {
            re += 1
        }
    }
    print("AC x", ac)
    print("WA x", wa)
    print("TLE x", tle)
    print("RE x", re)
}

main()
//  [swift]
func readInt() -> Int {
    return Int(readLine()!)!
}

func mainB() {
    let N = readInt()

    var counts = [0, 0, 0, 0]
    let results = ["AC", "WA", "TLE", "RE"]
    (0..<N).forEach { _ in
        let result = readLine()!
        counts[results.firstIndex(of: result)!] += 1
    }

    (0...3).forEach { n in
        print(results[n], "x", counts[n])
    }
}

mainB()
//  [swift]
let N = Int(readLine()!)!
var res: [Int] = Array(repeating: 0, count: 4)

for _ in 1...N {
    let S: String = readLine()!
    if S == "AC" {
        res[0] += 1
    } else if S == "WA" {
        res[1] += 1
    } else if S == "TLE" {
        res[2] += 1
    } else {
        res[3] += 1
    }
}

print("""
AC x \(res[0])
WA x \(res[1])
TLE x \(res[2])
RE x \(res[3])
""")    // (๑•ૅㅁ•๑)
//  [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("TEL x", judge.2)
print("RE x", judge.3)
//  [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()

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("TEL 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()
//  [typescript]
{
  const run = (input: string) => {
    const split = input.trim().split("\n")
    const n = parseInt(split[0])

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

    return `AC x ${ac}
WA x ${wa}
TLE x ${tle}
RE x ${re}`
  }

  const Main = (input: string) => {
    console.log(run(input))
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}
//  [typescript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let N = parseInt(xs[0]);
   let AC = 0;
   let TLE = 0;
   let WA = 0;
   let RE = 0;
   for(let i=0; i<=N; i++){
     let tmp = xs[i];
     if(tmp=='TLE'){
       TLE++;
     }else if(tmp=='AC'){
       AC++;
     }else if(tmp=='WA'){
       WA++;
     }else if(tmp=='RE'){
       RE++;
     }
   } 
   console.log('AC x '+AC);
   console.log('WA x '+WA);
   console.log('TLE x '+TLE);
   console.log('RE x '+RE);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [typescript]
import * as fs from "fs"
const inp:string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n')
export const res = (inp) =>{

    interface obj {
        AC: number,
        WA: number,
        TLE: number,
        RE: number
    }

    let obj:obj = {
        AC: 0,
        WA: 0,
        TLE: 0,
        RE: 0
    }
    inp.shift()
    for (let element of inp){
        if (element === 'AC'){
            obj.AC += 1
        } else if (element === 'WA'){
            obj.WA += 1
        } else if (element === 'TLE'){
            obj.TLE += 1
        } else if (element === 'RE'){
            obj.RE += 1
        }
    }
    console.log(`AC × ${obj.AC}\nWA × ${obj.WA}\nTLE × ${obj.TLE}\nRE × ${obj.RE}`)
}
res(inp)
//  [typescript]
import * as fs from "fs"
const inp:string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n')

interface obj {
    AC: number,
    WA: number,
    TLE: number,
    RE: number
}

let obj:obj = {
    AC: 0,
    WA: 0,
    TLE: 0,
    RE: 0
}

inp.shift()
for (let element of inp){
    if (element === 'AC'){
        obj.AC += 1
    } else if (element === 'WA'){
        obj.WA += 1
    } else if (element === 'TLE'){
        obj.TLE += 1
    } else if (element === 'RE'){
        obj.RE += 1
    }
}
console.log(`AC × ${obj.AC}`)
console.log(`WA × ${obj.WA}`)
console.log(`TLE × ${obj.TLE}`)
console.log(`RE × ${obj.RE}`)
//  [python]
# ABC109C - Skip
def gcd(a: int, b: int) -> int:
    while a:
        a, b = b % a, a
    return b


def main():
    N, X, *A = map(int, open(0).read().split())
    ans = abs(X - A[0])
    for i in A:
        dif = abs(X - i)
        if dif % ans:
            ans = gcd(ans, dif)
    print(ans)


if __name__ == "__main__":
    main()
//  [python]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def main():
    N, X, *xn = map(int, open(0).read().split())
    ans = abs(X - xn[0])
    for x in xn:
        div = abs(X - x)
        if div % ans:
            ans = gcd(ans, div)
    print(ans)
    return


main()
//  [python]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def main():
    N, X, *xn = map(int, open(0).read().split())
    ans = None
    for x in xn:
        if ans is None:
            ans = abs(X - xn[0])
        elif abs(X - x) % ans:
            ans = gcd(ans, abs(X - x))
    print(ans)
    return


main()
//  [python]
import math
N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
x.append(X)
x.sort()

xdst = [x[i+1] - x[i] for i in range(N)]
print(xdst)

ans = 10**10
if len(xdst) == 1:
    #print(xdst[0])
    exit()

for i in range(N-1):
    ans = min(math.gcd(xdst[i], xdst[i+1]),ans)
print(ans)
//  [python]
n,x=map(int, input().split())
x_list=[int(i) for i in input().split()]

x_list.append(x)
x_list.sort()
sa=[]
for i in range(n):
    sa.append(x_list[i+1]-x_list[i])
    
print(min(sa))
//  [python]
from math import gcd
n, x = map(int, input().split())
ls = sorted(list(map(int, input().split())))
if x == 1:
    print(abs(x-ls[0]))
    exit()
distant = []
for i in range(n):
    diff = abs(ls[i]-x)
    distant.append(diff)
distant.sort()
a = distant[0]
for i in distant:
    g = gcd(a, i)
print(g)
//  [java]

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long x = sc.nextInt();
        ArrayList<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextLong());
        }
        list.add(x);
        Collections.sort(list);
        ArrayList<Long> list2 = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list2.add(list.get(i + 1) - list.get(i));
        }
        long ans = list2.get(0);
        for (int i = 1; i < list2.size() - 1; i++) {
            ans = gcd(ans, list2.get(i));
        }
        System.out.println(ans);
    }

    public static final long gcd(long a, long b) {
        if( b == 0 ) return a;
        return gcd(b, a % b);
    }
}
//  [java]

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long x = sc.nextInt();
        ArrayList<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextLong());
        }
        list.add(x);
        Collections.sort(list);
        ArrayList<Long> list2 = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list2.add(Math.abs(list.get(i + 1) - list.get(i)));
        }
        long ans = list2.get(0);
        for (int i = 1; i < list2.size() - 1; i++) {
            ans = gcd(ans, list2.get(i));
        }
        System.out.println(ans);
    }

    public static final long gcd(long a, long b) {
        if( b == 0 ) return a;
        return gcd(b, a % b);
    }
}
//  [cpp]
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint(), X = getint();

	int kotae = abs(getint() - X);
	rep(i, N - 1) {
		kotae = __gcd(kotae, abs(getint() - X));
	}
	printf("%d", kotae);


	Would you please return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(int x){
  char f[10];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class T> inline T GCD_L(T a,T b){
  T r;
  while(a){
    r=b;
    b=a;
    a=r%a;
  }
  return b;
}
int N;
int X;
int A;
int main(){
  int Lj4PdHRW, res=0;
  rd(N);
  rd(X);
  for(Lj4PdHRW=0;Lj4PdHRW<N;Lj4PdHRW++){
    rd(A);
    res =GCD_L(res, abs(X-A));
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190721-1

// --- original code ---
// int N, X, A;
// {
//   int res = 0;
//   rd(N,X);
//   rep(N){
//     rd(A);
//     res = gcd(res, abs(X-A));
//   }
//   wt(res);
// }
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
//最大公約数
long long GCD(long long a, long long b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(GCD(b, a%b));
   }
}
int main(){
  long long N,X;
  cin >> N >> X;
  if(N == 1){
    long long a;
    cin >> a;
    cout << a-X << endl;
    return 0;
  }
  vector<long long>vec(N+1);
  vec[N] = X;
  for(long long i=0; i<N; i++){
    cin >> vec[i];
  }
  sort(vec.begin(),vec.end());
  long long gccd = GCD(vec[2]-vec[1],vec[1]-vec[0]);
  for(long long i=0; i<N; i++){
    gccd = GCD(gccd,vec[i+1]-vec[i]);
  }
  cout << gccd << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
//最大公約数
long long GCD(long long a, long long b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(GCD(b, a%b));
   }
}
int main(){
  long long N,X;
  cin >> N >> X;
  if(N == 1){
    long long a;
    cin >> a;
    cout << a-X << endl;
    return 0;
  }
  vector<long long>vec(N+1);
  vec[N] = X;
  for(long long i=0; i<N; i++){
    cin >> vec[i];
  }
  sort(vec.begin(),vec.end());
  long long gccd = GCD(vec[1]-vec[0]);
  for(long long i=0; i<N; i++){
    gccd = GCD(gccd,vec[i+1]-vec[i];
  }
  cout << gccd << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define int long long
//最大公約数
long long GCD(long long a, long long b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(GCD(b, a%b));
   }
}
signed main(){
  int N,X;
  cin >> N >> X;
  if(N == 1){
    int a;
    cin >> a;
    cout << a-X << endl;
    return 0;
  }
  vector<int>vec(N+1);
  vec[N] = X;
  for(int i=0; i<N; i++){
    cin >> vec[i];
  }
  sort(vec.begin(),vec.end());
  int gccd = GCD(vec[1]-vec[0]);
  for(int i=0; i<N; i++){
    gccd = GCD(gccd,vec[i+1]-vec[i];
  }
  cout << gccd << endl;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#pragma GCC optimize ("O3")

inline static int gl(void){
    int x = 0;
    for(;;){
        unsigned int c = getchar_unlocked() - 48;
        if(c < 10){
            x = x*10 + c;
        }else{
            break;
        }
    }
    return x;
}

inline static int gcd(int a, int b){
    if(a==0) return b;
    if(b==0) return a;
    do{
        int t=a%b;
        a=b;
        b=t;
    }while(b!=0);
    return a;
}

int main(void){
    int n=gl(), s=gl(), g=0, t;
    for(long i=0; i<n; i++){
        t = gl();
        g=gcd(abs(t-s), g);
    }
    printf("%d\n", g);
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#pragma GCC optimize ("O3")

inline long gl(void){
    long x = 0;
    for(;;){
        unsigned int c = getchar_unlocked() - 48;
        if(c < 10){
            x = x*10 + c;
        }else{
            break;
        }
    }
    return x;
}

long gcd(long a, long b){
    if(a==0) return b;
    if(b==0) return a;
    do{
        long t=a%b;
        a=b;
        b=t;
    }while(b!=0);
    return a;
}

int main(void){
    long n=gl(), s=gl();
    long g=0;
    for(long i=0; i<n; i++){
        long t = gl();
        g=gcd(labs(t-s), g);
    }
    printf("%ld\n", g);
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

inline long gl(void){
    long x = 0;
    for(;;){
        int c=getchar_unlocked();
        if('0'<= c && c <='9'){
            x = x*10 + c-'0';
        }else{
            break;
        }
    }
    return x;
}

long gcd(long a, long b){
    if(a==0) return b;
    if(b==0) return a;
    do{
        long t=a%b;
        a=b;
        b=t;
    }while(b!=0);
    return a;
}

int main(void){
    long n=gl(), s=gl();
    long g=0;
    for(long i=0; i<n; i++){
        long t = gl();
        g=gcd(labs(t-s), g);
    }
    printf("%ld\n", g);
    return 0;
}
//  [c]
#include<stdio.h>
#include<math.h>
int main(){
  int n,x;
  int c[n];
  scanf("%d %d",&n,&x);
  for(int i = 0;i<n;i++){
      scanf("%d",&c[i]);
  }
  int m=abs(c[0]-x);
  for(int i = 0;i<n;i++){
    if(m >= abs(c[i]-x)){
       m = abs(c[i]-x);
    }
  }
  printf("%d",m);
  return 0;
}
//  [c]
#include<stdio.h>
#include<math.h>
int main(){
  int n,x;
  int c[n];
  for(int i = 0;i<n;i++){
      scanf("%d",&c[i]);
  }
  int m=abs(c[0]-x);
  for(int i = 1;i<n;i++){
    if(m > abs(c[i]-x)){
       m = abs(c[i]-x);
    }
  }
  printf("%d",m);
  return 0;
}
//  [c]
#include<stdio.h>
#include<math.h>
int main(){
  int n,x;
  int c[n];
  for(int i = 0;i<n;i++){
      scanf("%d",&c[i]);
  }
  int m=c[0];
  for(int i = 0;i<n;i++){
    scanf("%d",&c[i]);
    if(m > abs(c[i]-x)){
       m = abs(c[i]-x);
    }
  }
  printf("%d",m);
  return 0;
}
//  [javascript]
function Main(input){
    const arr = input.split('\n');
    const X = Number(arr[0].split(' ')[1]);
    const xi = arr[1].split(' ').map(Number);
    const xi_cal = xi.map(val => Math.abs(val-X));
    const GCD = (n, m) => {
        if(n % m === 0) return m;
        return GCD(m, n % m);
    }
    console.log(xi_cal.reduce((a,b) =>GCD(a,b)));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input){
	input = input.split("\n");
	var mem = input[0].split(" ").map(Number);
	var arr = input[1].split(" ").map(Number);
	var p = Math.abs(mem[1]-arr[0]);
	for(var i=1;i<arr.length;i++){
		p = gcd(p,Math.abs(arr[i]-mem[1]))
	}
	function gcd(a, b) {
    if (b === 0){
        return a
    }
    return gcd(b, a % b)
}
console.log(p)
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
console.log((args=>{
  const [[N,X],x] = args.trim().split('\n').map( r=>r.split(' ').map(v=>v|0) );
  const gcd = (a,b) => {while(a)[a,b]=[b%a,a]; return b;};
  let d = Math.abs(x[0]-X);
  for ( let i = 1; i < N; i++ ) {
    d = gcd( d, Math.abs(x[i]-X) );
  }
  return `${d}`;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));