Harryxun/stf_run huggingface dataset:
def main():
  import sys
  input = sys.stdin.readline
  
  n = int(input())
  s = [[],[]]
  for i in range(2):
    s[i] = tuple(map(int,input().split()))
  u = [[],[]]
  for i in range(2):
    u[i] = tuple(map(int,input().split()))
  
  val = [[0 for _ in range(n)] for _ in range(2)]
  d = [[0 for _ in range(n)] for _ in range(n)]
  ans = [[0 for _ in range(n)] for _ in range(n)]
  
  def flip():
    for i in range(n):
      for j in range(i,n):
        d[i][j],d[j][i] = d[j][i],d[i][j]
    
  def solve():
    for i in range(n):
      for j in range(n):
        d[i][j] = -1
    for k in range(1):
      for i in range(n):
        if s[k][i] != val[k][i]:
          for j in range(n):
            if d[i][j] != -1 and d[i][j] != val[k][i]:
              return False
            d[i][j] = val[k][i]
      flip()
    #print(d)
    for l in range(2):
      for k in range(2):
        for i in range(n):
          if s[k][i] == val[k][i]:
            p = []
            ok = False
            for j in range(n):
              if d[i][j] == val[k][i]:
                ok = True
              if d[i][j] == -1:
                p.append(j)
            if ok:
              continue
            if len(p) == 0:
              return False
            elif len(p) == 1:
              d[i][p[0]] = val[k][i]
        flip()
    #print(d)
    start = 0
    for i in range(n):
      num = start
      flag = False
      for j in range(n):
        if d[i][j] == -1:
          flag = True
          d[i][j] = num
          num ^= 1
      if flag:
        start ^= 1
    return True
  
  for b in range(64):
    for i in range(2):
      for j in range(n):
        val[i][j] = (u[i][j]>>b)&1
    if solve():
      for i in range(n):
        for j in range(n):
          ans[i][j] |= d[i][j]<<b
    else:
      print(-1)
      exit()
  
  for i in range(n):
    print(*ans[i])

main()


### FIXED CODE ###

from heapq import heappop, heappush

n,m,s = map(int,input().split())
e = [[] for _ in range(n)]
for i in range(m):
  u,v,a,b = map(int,input().split())
  u -= 1
  v -= 1
  e[u].append((v,a,b))
  e[v].append((u,a,b))
c = []
d = []
for i in range(n):
  x,y = map(int,input().split())
  c.append(x)
  d.append(y)

INF = float('inf')
def dijkstra(s,n,g): # sからの最短距離 頂点数n g[v]=[(u1,w1),(u2,w2)....]:vからuへの有向辺があり、重みw
  que = []
  d = [INF for _ in range(n)]
  d[s] = 0
  heappush(que,(0,s))
  while len(que) > 0:
    p = heappop(que)
    v = p[1]
    if d[v] < p[0]:
      continue
    for u,w in g[v]:
      if d[u] > d[v]+w:
        d[u] = d[v]+w
        heappush(que,(d[u],u))
  return d

def newv(v,s):
  return v*2500+s

s = min(s,2499)
e2 = [[] for _ in range(n*2500)]
for u in range(n):
  for j in range(2500):
    #if j+c[u] < 2500:
    #  e2[newv(u,j)].append((newv(u,j+c[u]),d[u]))
    e2[newv(u,j)].append((newv(u,min(j+c[u],2499)),d[u]))
    for v,a,b in e[u]:
      if j >= a:
        e2[newv(u,j)].append((newv(v,j-a),b))

l = dijkstra(newv(0,s),n*2500,e2)
for i in range(1,n):
  ans = INF
  for j in range(2500):
    ans = min(l[newv(i,j)],ans)
  print(ans)
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


def calc_rle_l(s):
    now_c = s[0]
    count = 1
    res = []
    for i in range(1, len(s)):
        if now_c == s[i]:  # 同じ文字が続く
            count += 1
        else:  # 手前まで続いた文字を集計
            res.append([now_c, count])
            now_c = s[i]
            count = 1
    res.append([now_c, count])  # 最後に続く文字
    return res


s = S()
if len(set(s)) < 2:  # B か W しかない
    print(0)
    sys.exit()

rle = calc_rle_l(s)
# print(rle)
if rle[0][1] == 'W':
    rle = rle[1:]
if rle[-1] == 'B':
    rle = rle[:-1]
ans = 0
for i in range(0, len(rle), 2):
    ans += rle[i][1] * rle[i + 1][1]
    if i + 2 < len(rle):
        rle[i + 2][1] += rle[i][1]
print(ans)


### FIXED CODE ###

import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


s = S()
ans = 0
w_cnt = 0
for i in range(len(s)):
    if s[i] == "W":
        ans += i - w_cnt  # その W の場所までにあった B の数
        w_cnt += 1

print(ans)
N = int(input())
balls = []
for i in range(N):
    x, y = map(int, input().split(' '))
    balls.append([x,y])

dic = {}
for i in range(N):
    for j in range(N-(i+1)):
        dx = balls[i][0] - balls[j][0]
        dy = balls[i][1] - balls[j][1]
        if (0>dx):
            dx *= -1
            dy *= -1
        if (dx,dy) not in dic.keys():
            dic[(dx,dy)] = 1
        else:
            dic[(dx,dy)] += 1

d_max = max(dic.values())
print(N-d_max)


### FIXED CODE ###

N = int(input())
balls = []
for i in range(N):
    x, y = map(int, input().split(' '))
    balls.append((x,y))

if N == 1:
    print("1")
    exit()

dic = {}
for i in range(N):
    for j in range(i+1,N):
        dx = balls[j][0] - balls[i][0]
        dy = balls[j][1] - balls[i][1]
        if (dx,dy) not in dic.keys():
            dic[(dx,dy)] = 1
        else:
            dic[(dx,dy)] += 1
        dx *= -1
        dy *= -1
        if (dx,dy) not in dic.keys():
            dic[(dx,dy)] = 1
        else:
            dic[(dx,dy)] += 1

d_max = max(dic.values())
print(N - d_max)
N=int(input())
X=[[0 for j in range(2)] for i in range(N)]


for i in range(N):
  X[i]=list(map(int,input().split()))


X.sort()
n=1
i=0
k=0
flag=0
while(1):
  if X[i][0]+X[i][1]>X[n][0]-X[n][1]:
    n+=1
    flag=0
  else:
    i+=1
    if flag==0:
      k+=1
      flag=1
  if i>=N-1 or n>=N:
    break
    
print(k+1)



### FIXED CODE ###

H=int(input())
W=int(input())
N=int(input())

X=max([W,H])
Y=N//X
if X*Y==N:
  print(Y)
else:
  print(Y+1)
l,n=map(int,input().split())
li=[input() for i in range(n)]
ans=sorted(li)
"""
for st in li :
  s += st
print(s)
"""
print(*ans,sep="")

### FIXED CODE ###

a,b,c=map(int,input().split())
l=[a,b,c]
l.sort()
if l==[5,5,7]:
  print("YES")
else:
  print("NO")
N = int(input())
X = input()
int_X = int(X, 2)


def bit_count(bits):
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff);


def pop_counter(n):
    return n % bit_count(n)


ans = 0
for n, i in enumerate(X):
    ans = 0
    tmp = int_X ^ pow(2, N - n - 1)
    while tmp != 0:
        tmp = pop_counter(tmp)
        ans += 1
    print(ans)


### FIXED CODE ###

N = int(input())
X = input()
bin_X = int(X, 2)
cnt = 0
for i in X:
    if i == '1':
        cnt += 1


def bit_count(bits):
    cnt = 0
    while bits:
        bits = bits & (bits - 1)
        bits >> 1
        cnt += 1
    return cnt


def pop_counter(n):
    return n % bit_count(n)


ans = 0
xp = bin_X % (cnt + 1)
if cnt != 1:
    xm = bin_X % (cnt - 1)
else:
    xm = 0
for n, i in enumerate(X):
    if i == '0':
        tmp = xp + pow(2, N - n - 1, cnt + 1)
        tmp %= cnt + 1
    elif cnt != 1:
        tmp = xm - pow(2,N-n-1,cnt-1)
        tmp %= cnt -1
    else:
        print(0)
        continue
    ans = 1
    while tmp != 0:
        tmp = pop_counter(tmp)
        ans += 1
    print(ans)
S = input()
if S[3] == S[4] and S[5] == S[6]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()
if S[2] == S[3] and S[4] == S[5]:
  print("Yes")
else:
  print("No")
lst=set(map(int,input().split(" ")))
if len(set)==2:
  print("Yes")
else:print("No")

### FIXED CODE ###

s = set(map(int, input().split()))
if len(s) == 2:
    print("Yes")
else:
    print("No")
from functools import reduce
n = input()

sum_ = reduce(lambda x,y:int(x)+int(y),n)
if sum_%9 == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = input()

sum_=0
for ni in N:
    sum_ += int(ni)

if sum_%9 == 0:
    print("Yes")
else:
    print("No")
import sys
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
ABC = [[int(x) for x in readline().split()] for _ in range(N)]

dp = [[0] * 3 for _ in range(10 * 5 + 10)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i + 1][j] = max(dp[i + 1][j], dp[i][k] + ABC[i][k])

ans = max(dp[N])
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
ABC = [[int(x) for x in readline().split()] for _ in range(N)]

dp = [[0] * 3 for _ in range(10 ** 5 + 10)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i + 1][j] = max(dp[i + 1][j], dp[i][k] + ABC[i][k])

ans = max(dp[N])
print(ans)
#!/usr/bin/env python3
# -*- coding:utf-8 -*-

from itertools import combinations
from functools import reduce
from collections import Counter

primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

def prime_factorization(x):
  # 100までの素数でしか動かない
  facters = []

  if x == 1:
    return [1]

  if x in primes:
    return [x]

  for p in primes:
    while x%p == 0:
      x /= p
      facters += [p]
  return facters


facters = {i:prime_factorization(i) for i in range(1, 100+1)}

def main():
  n = int(input())

  nn = []
  for i in range(2, n+1):
    nn += facters[i]
  nn = [x+1 for x in Counter(nn).values()]
  xx = reduce(lambda x, y: x*y, [n+1for n in nn])
  count_5 = 0
  count_3 = 0
  count_15 = 0
  count_25 = 0
  count_75 = 0
  f = lambda x: x*f(x-1) if x>1 else 1
  comb = lambda x,y: int(f(x) / (f(y)*f(x-y))) if y<=x else 0
  for x in nn:
    if 75 <= x:
      count_75 += 1
    if 25 <= x:
      count_25 += 1
    if 15 <= x:
      count_15 += 1
    if 5 <= x:
      count_5 += 1
    if 3 <= x:
      count_3 += 1

  counts = [count_3, count_5, count_15, count_25, count_75] # length: 5

  ans = comb(count_5, 2) * (count_3 - 2) \
      + count_15 * (count_5 - 1) \
      + count_25 * (count_3 - 1) \
      + count_75
  print(ans)

if __name__=='__main__':
  main()

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding:utf-8 -*-

from itertools import combinations
from functools import reduce
from collections import Counter

primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

def prime_factorization(x):
  # 100までの素数でしか動かない
  facters = []

  if x == 1:
    return [1]

  if x in primes:
    return [x]

  for p in primes:
    while x%p == 0:
      x /= p
      facters += [p]
  return facters


facters = {i:prime_factorization(i) for i in range(1, 100+1)}

def main():
  n = int(input())

  nn = []
  for i in range(2, n+1):
    nn += facters[i]
  nn = [x+1 for x in Counter(nn).values()]
  count_5 = 0
  count_3 = 0
  count_15 = 0
  count_25 = 0
  count_75 = 0
  f = lambda x: x*f(x-1) if x>1 else 1
  comb = lambda x,y: int(f(x) / (f(y)*f(x-y))) if y<=x else 0
  for x in nn:
    if 75 <= x:
      count_75 += 1
    if 25 <= x:
      count_25 += 1
    if 15 <= x:
      count_15 += 1
    if 5 <= x:
      count_5 += 1
    if 3 <= x:
      count_3 += 1

  counts = [count_3, count_5, count_15, count_25, count_75] # length: 5

  ans = comb(count_5, 2) * (count_3 - 2) \
      + count_15 * (count_5 - 1) \
      + count_25 * (count_3 - 1) \
      + count_75
  print(ans)

if __name__=='__main__':
  main()
N=int(input())
K=int(input())
h=list(map(int,input().split()))
for i in range(N):
    if h[i]>=K:
        ans+=1
print(ans)


### FIXED CODE ###

N,K=map(int,input().split())
h=list(map(int,input().split()))
ans=0
for i in range(N):
    if h[i]>=K:
        ans+=1
print(ans)
s=list(map(int,input().split()))
if s[1]==1:
	print(0)
else:
  	num=1
	cost=s[0]
	while cost < s[1]:
    	num+=1
    	cost+=(s[0]-1)
print(num)

### FIXED CODE ###

s=input()
t=input()
result=0
if s[:1]==t[:1]:
    result=result+1

if s[1:2]==t[1:2]:
    result=result+1

if s[2:3]==t[2:3]:
    result=result+1
print(result)
inf = 10**9+7

import sys

def nCr(n, r):
    r = min(r, n - r)
    if r == 0: return 1;
    if r == 1: return n;
    numerator = [n - r + i + 1 for i in range(r)]
    denominator  = [i + 1 for i in range(r)]
    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
    result = 1
    for k in range(r):
        if numerator[k] > 1: 
            result = (result * numerator[k])%inf
    return result

x, y = map(int, input().split())
key = 0
if x == 2*y:
    print(1)
    sys.exit()
if y == 2*x:
    print(1)
    sys.exit()
while x>0 and y>0:
    x, y = x-3, y-3
    key += 1
    if x == 2*y:
        a = 1
        break
    if y == 2*x:
        a = -1
        break

if x < 0 or y < 0:
    print(0)
    sys.exit()

if a == 1:
    print(int(nCr(key*2+y ,key)))
else:
    print(int(nCr(key*2+x ,key)))
    

### FIXED CODE ###

inf = 10**9+7
import sys
a = 0
def nCr(n, r):
    r = min(r, n - r)
    if r == 0: return 1;
    if r == 1: return n;
    numerator = [n - r + i + 1 for i in range(r)]
    denominator  = [i + 1 for i in range(r)]
    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
    result = 1
    for k in range(r):
        if numerator[k] > 1: 
            result = (result * numerator[k])%inf
    return result

x, y = map(int, input().split())
key = 0
if x == 2*y:
    print(1)
    sys.exit()
if y == 2*x:
    print(1)
    sys.exit()
while x>0 and y>0:
    x, y = x-3, y-3
    key += 1
    if x == 2*y:
        a = 1
        break
    if y == 2*x:
        a = -1
        break

if x < 0 or y < 0:
    print(0)
    sys.exit()

if a == 0:
    print(0)
elif a == 1:
    print(int(nCr(key*2+y ,key)))
else:
    print(int(nCr(key*2+x ,key)))
a, b, c = map(input().split())
if a + b + c == 17:
  if (a == b == 5 and c == 7) or (a == c == 5 and b == 7) or (b == c == 5 and a == 7):
    print("Yes")
  else: print("No")

### FIXED CODE ###

li = list(map(int, input().split()))
if li == [5,5,7] or li == [5,7,5] or li == [7,5,5]:
  print('YES')
else:
  print('NO')
# -*- coding: utf-8 -*-
n=int(input())
A=[]
for i in range(n):
    a=(i+1,)+tuple(input().split())
    A.append(a)
A.sort(key=lambda x:(-x[1],x[2]),reverse=True)
for m in range(n):
    print(A[m][0])

### FIXED CODE ###

# -*- coding: utf-8 -*-
N=int(input())
restaurant=[]
for i in range(N):
    s,p=input().split()
    restaurant.append((i+1,s,int(p)))
restaurant.sort(key=lambda x:(x[1],-x[2]))
for j in range(N):
    print(restaurant[j][0])
n = int(input())
a = list(map(int, input().split()))
a.sort()

for i in range(len(a)):
    if a[i] == a[i-1]
    print("NO")
else:
    print("YES")

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
length1 = len(a)
length2 = len(set(a))
# print(length1, length2)
if length1 == length2:
    print("YES")
else:
    print("NO")
import numpy as np
import math
from decimal import *
import sympy
#from numba import njit

def getVar():
    return map(int, input().split())
def getArray():
    return list(map(int, input().split()))
def getNumpy():
    return np.array(list(map(int, input().split())), dtype='int64')

def main():
    N = int(input())
    d = sympy.factorint(N)
    count = 0

    for v in d.values():
        i = 1
        while(v >= i):
            v -= i
            i += 1
            count += 1
        
    print(count)


main()

### FIXED CODE ###

import numpy as np
import math
from decimal import *
#from numba import njit

def getVar():
    return map(int, input().split())
def getArray():
    return list(map(int, input().split()))
def getNumpy():
    return np.array(list(map(int, input().split())), dtype='int64')

def factorization(n):
    d = {}
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            d.update({i: cnt})

    if temp!=1:
        d.update({temp: 1})

    if d==[]:
        d.update({n:1})

    return d

def main():
    N = int(input())
    d = factorization(N)
    count = 0

    for v in d.values():
        i = 1
        while(v >= i):
            v -= i
            i += 1
            count += 1
        
    print(count)


main()
import math
# input process
inputData = input().split()
A = int(inputData[0])
B = int(inputData[1])
C = int(inputData[2])
D = int(inputData[3])

C_q_num = (B // C) - (A // C)
D_q_num = (B // D) - (A // D)
CD_lcm = (C * D) // math.gcd(C, D)
CD_q_num = (B // CD_lcm) - (A // CD_lcm) + 1
print((B-A) - C_q_num - D_q_num + CD_q_num)


### FIXED CODE ###

import fractions
# input process
inputData = input().split()
A = int(inputData[0])
B = int(inputData[1])
C = int(inputData[2])
D = int(inputData[3])

C_q_num = (B // C) - (A // C)
if (A % C) == 0:
    C_q_num += 1
D_q_num = (B // D) - (A // D)
if (A % D) == 0:
    D_q_num += 1
CD_lcm = (C * D) // fractions.gcd(C, D)
CD_q_num = (B // CD_lcm) - (A // CD_lcm)
if (A % CD_lcm) == 0:
    CD_q_num += 1
print((B - A + 1) - C_q_num - D_q_num + CD_q_num)
str=input()
if str=="ABC":
    print("ARC")
    elif str=="ARC":
        print("ABC")
    else:
      

### FIXED CODE ###

str=input()
if str=="ABC":
    print("ARC")
elif str=="ARC":
    print("ABC")
a,b = int(input().split())
print(str(a*b))

### FIXED CODE ###

a,b = map(int,input().split())
print(str(a*b))
# 問題文
# 高橋君は九九を覚えたので、1以上 9以下の 2つの整数の積を計算することができます。それ以外の計算はできません。
# 2つの整数 A, Bが与えられます。
# 高橋君が A×Bを計算できるならその結果を、できないなら代わりに -1 を出力してください。
# 制約
# 1≤A≤20
# 1≤B≤20
# 入力中のすべての値は整数である。
A = int(input())
B = int(input())
if (1 <= A <= 9) & (1 <= B <= 9):
    s = A*B
    print(s)

else:
    print(-1)

### FIXED CODE ###

A, B = map(int, input().split())
if (1 <= A <= 9) & (1 <= B <= 9):
    s = A*B
    print(s)

else:
    print(-1)
a=list(inout().split())
b=int(a[0])+int(a[1])/2
print(b)

### FIXED CODE ###

a=list(input().split())
X=int(a[0])
Y=int(a[1])
z=int(X+Y/2)
print(z)
a, b = list(map(int, input()).split())

if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")


### FIXED CODE ###

a, b = list(map(int, input().split()))

if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")
a,b = map(int, input(9.split()))
if 0 < a < 10 and 0 < b < 10:
  print(a * b)
else:
  print(-1)

### FIXED CODE ###

a,b = map(int, input().split())
if 0 < a < 10 and 0 < b < 10:
  print(a * b)
else:
  print(-1)
import sys
input = sys.stdin.readline


def main():
    x, n = [int(i) for i in input().split()]
    p = set([int(i) for i in input().split()])

    for i in range(1, 101):
        if i in p:
            continue

        if i <= x:
            ans = i
        elif x - ans > i - x:
            ans = i
            break

    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

# import numpy as np
import sys
input = sys.stdin.readline


def main():
    x, n = [int(i) for i in input().split()]
    p = set([int(i) for i in input().split()])

    ans = x
    for i in range(-1, 102):
        if i in p:
            continue

        if i <= x:
            ans = i
        else:
            if x - ans > i - x:
                ans = i
            break

    print(ans)


if __name__ == '__main__':
    main()
N, M = map(int, input().split())
Digit = [0] * N
Count = 0
for i in range(M):
    s, c = map(int, input().split())
    if Digit[s - 1] == c or Digit[s - 1] == 0:
        Digit[s - 1] = c
        Count += 1
    else:
        print("-1")
        exit()
if Digit[0] == 0 and M >= 1:
    if Digit[1] == 0 and M >=2:
        if Digit[2] == 0 and Count == 0:
            print("".join(map(str,Digit)))
            exit()
        else:
            print("-1")
            exit()
    else:
        print("-1")
        exit()
print("".join(map(str,Digit)))

### FIXED CODE ###

N, M = map(int, input().split())
st = 1 * 10 ** (N-1)
en = st * 10
SC = []
for i in range(M):
    sc = list(map(int,input().split()))
    SC.append(sc)
if N == 1:
    for i in range(0, 10):
        t = str(i)
        judge = True
        for j in range(M):
            if t[SC[j][0] - 1] != str(SC[j][1]):
                judge = False
        if judge:
            print(i)
            exit()
    print("-1")
    exit()
    
for i in range(st,en):
    t = str(i)
    judge = True
    for j in range(M):
        if t[SC[j][0]-1] != str(SC[j][1]):
            judge = False
    if judge:
        print(i)
        exit()
print("-1")
import fractions from gcd
N,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
m = x[1]-x[0]

for i in range(1,N+1):
    n = x[i]-x[i-1]
    v = gcd(m,n)
    m = v

print(m)






### FIXED CODE ###

from fractions import gcd
N,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
m = x[1]-x[0]

for i in range(1,N+1):
    n = x[i]-x[i-1]
    v = gcd(m,n)
    m = v

print(m)
from sys import stdin
A, B, C, K = [int(_) for _ in stdin.readline().rstrip().split()]
L = [1]*A+[0]*B+[-1]*C
print(sum(L[:K]))

### FIXED CODE ###

from sys import stdin
A, B, C, K = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
if K <= A:
    ans = K
elif K <= A+B:
    ans = A
else:
    ans = A-K+A+B
print(ans)
c=input()
l=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
print(l[l.index(c)+1])

### FIXED CODE ###

c=input()
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
print(l[l.index(c)+1])
import sys
input_lines = sys.stdin.readline()
y,m,d = input_lines.split("/")

if(m>4):
    print(Heisei)
else:
    print(TBD)

### FIXED CODE ###

import sys
input_lines = sys.stdin.readline()
y,m,d = input_lines.split("/")


if(int(m)<=4):
    print("Heisei")
else:
    print("TBD")
w=raw_input()
W=w.lower()
Text=[]
while True:
    text=raw_input()
    if text=='END_OF_TEXT':
        break
    Text.extend(text.split())
for i in range(len(Text)):
    Text[i]=Text[i].lower()
print('%d'%Text.count(W))

### FIXED CODE ###

w=input()
W=w.lower()
Text=[]
while True:
    text=input()
    if text=='END_OF_TEXT':
        break
    Text.extend(text.split())
for i in range(len(Text)):
    Text[i]=Text[i].lower()
print('%d'%Text.count(W))