Harryxun/stf_run huggingface dataset:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    S = list(_ for _ in input())
    # print(S)
    if S[0] != 'A':        
        print('WA')
        return
    S.pop(0)
    # print(S)
    if S[1:-1].count('C') != 1:
        print('WA')
        return
    S.pop(S.index('C',1,-2))
    # print(S)
    for s in S:
        if s.isupper():
            print('WA')
            return
    print('AC')
    return
    
if __name__ == '__main__':
    main()


### FIXED CODE ###

from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    S = list(_ for _ in input())
    # print(S)
    if S[0] != 'A':        
        print('WA')
        return
    S.pop(0)
    # print(S)
    if S[1:-1].count('C') != 1:
        print('WA')
        return
    S.pop(S.index('C',1,-1))
    # print(S)
    for s in S:
        if s.isupper():
            print('WA')
            return
    print('AC')
    return
    
if __name__ == '__main__':
    main()
A=[list(map(int,input().split())) for _ in range(3)]
N=int(input())
bn=[int(input()) for _ in range(N)]
ans=False
for ver in zip(*A):
    if all(item in bn for item in ver):
        ans=True
for wide in A:
    if all(item in bn for item in wide):
        ans=True
if all(A[i][i] in bn for i in range(3)):
    ans=True
if all(A[i][3-i] in bn for i in range(3)):
    ans=True
if ans==True:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A=[list(map(int,input().split())) for _ in range(3)]
N=int(input())
bn=[int(input()) for _ in range(N)]
ans=False
for ver in zip(*A):
    if all(item in bn for item in ver):
        ans=True
for wide in A:
    if all(item in bn for item in wide):
        ans=True
if all(A[i][i] in bn for i in range(3)):
    ans=True
if all(A[i][3-i-1] in bn for i in range(3)):
    ans=True
if ans==True:
    print("Yes")
else:
    print("No")
import sys
import re
import math
import collections
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===

def main():
    x, y, z, w = ns()
    a = na()
    b = na()
    c = na()

    a.sort(reverse=True)
    b.sort(reverse=True)
    c.sort(reverse=True)

    ans = []
    lim = 4000
    for i in range(x):
        if x > lim:
            break
        for j in range(y):
            if x * y > lim:
                break
            for k in range(z):
                if x * y * z > lim:
                    break
                ans.append(a[i] + b[j] + c[k])

    ans.sort(reverse=True)

    for i in range(w):
        print(ans[i])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import re
import math
import collections
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===

def main():
    x, y, z, w = ns()
    a = na()
    b = na()
    c = na()

    a.sort(reverse=True)
    b.sort(reverse=True)
    c.sort(reverse=True)

    ans = []
    for ai in a:
        for bi in b:
            ans.append(ai + bi)

    ans.sort(reverse=True)
    ans = ans[:3010]

    res = []
    for ci in c:
        for i in range(len(ans)):
            res.append(ci + ans[i])
    res.sort(reverse=True)

    for i in range(w):
        print(res[i])


if __name__ == '__main__':
    main()
def gcd(a,b):
        return b


def lcm(a,b):
    c=gcd(a,b);
    return a/c*b

n=int(input())
t=[0]*n

for lop2 in range(n):
    t[lop2]=int(input())

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

### FIXED CODE ###

N = input()
n=int(N)
n2=(n%10)*100
n2+=(n%100)-n%10
n2+=(n-n%100)/100
if n==n2 :
	print('Yes\n')
else:
	print('No\n')
quit()
A = int(input())
B = int(input())
socket = 0
count = 0
while socket < B :
    if socket + A < B :
        socket = socket + A - 1
        count += 1
    elif socket+A >= B :
        socket = socket + A
        count += 1
print(count)


### FIXED CODE ###

input1 = input()
x = []
y=[]
check=0

for i in input1:
    if i!=" " and check==0:
        x.append(i)
    elif i==" ":
        check=1
    elif i!=" " and check==1:
        check==1
        y.append(i)
xstring=''.join(x)
ystring=''.join(y)

xint=int(xstring)
yint=int(ystring)

if yint==1:
    print(0)
else:
    cnt=0
    while ((xint-1)*(cnt))+xint<yint:
        cnt=cnt+1
    cnt=cnt+1
    print(cnt)
S = input()

if S == ABC :
  print(ARC)
else :
  print(ABC)

### FIXED CODE ###

S = input()

if S == "ABC" :
  print("ARC")
else :
  print("ABC")
# -*- coding: utf-8 -*-
def margin0(n):
    if n < 10:
        return "00{}".format(n)
    elif n < 100:
        return "0{}".fomrat(n)
    elif n < 1000:
        return "".format(n%1000)
    else:
        return "{}".format(n%1000 - 1)
n = int(input())
# print(n)
name = ""
if n < 1000:
    name = "ABC{}".format(margin0(n))
else:
    name = "ABD{}".format(margin0(n))
print(name[:3])

### FIXED CODE ###

# -*- coding: utf-8 -*-
def margin0(n):
    if n < 10:
        return "00{}".format(n)
    elif n < 100:
        return "0{}".format(n)
    elif n < 1000:
        return "".format(n%1000)
    else:
        return "{}".format(n%1000 - 1)
n = int(input())
# print(n)
name = ""
if n < 1000:
    name = "ABC{}".format(margin0(n))
else:
    name = "ABD{}".format(margin0(n))
print(name[:3])
n = input()
chars = "Xabcdefghijklmnopqrstuvwxyz"
n_rem = n
ans = ""

while True:
  x = n_rem % 26
  if x == 0:
    x = 26
  ans += chars[x]
  n_rem -= 26
  if n_rem == 0:
    break
  n_rem //= 26
print(ans[::-1])

### FIXED CODE ###

n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"
n_rem = n
ans = ""
 
while True:
  x = n_rem % 26
  if x == 0:
      x = 26
  ans += chars[x]
  n_rem -= x
  if n_rem == 0:
    break
  n_rem //= 26
  
print(ans[::-1])
import sys
memo = {}
sys.setrecursionlimit(40320)
def swap(state, a, b):
    state[a], state[b] = state[b], state[a]
def dfs(state, pos, c):
    key = "".join(map(str, state))
    if memo.has_key(key):
        return memo[key]
    memo[key] = c
    if pos!=0 and pos!=4:
        swap(state, pos-1, pos)
        dfs(state, pos-1, c+1)
        swap(state, pos-1, pos)
    if pos!=3 and pos!=7:
        swap(state, pos+1, pos)
        dfs(state, pos+1, c+1)
        swap(state, pos+1, pos)
    if pos<4:
        swap(state, pos+4, pos)
        dfs(state, pos+4, c+1)
        swap(state, pos+4, pos)
    else:
        swap(state, pos-4, pos)
        dfs(state, pos-4, c+1)
        swap(state, pos-4, pos)
    return c

dfs(range(8), 0, 0)
while True:
    try:
        state = raw_input().replace(" ","")
        print memo[state]
    except IOError:
        break

### FIXED CODE ###

import Queue
memo = {}
def swap(state, a, b):
    state2 = state[:]
    state2[a], state2[b] = state2[b], state2[a]
    return state2
gkey = lambda state: "".join(map(str, state))

que = Queue.Queue()

init = range(8)
que.put((init, 0, 0))
memo[gkey(init)] = 0
while not que.empty():
    state, pos, c = que.get()
    def next_state(nxt):
        state2 = swap(state, nxt, pos)
        key = gkey(state2)
        if not memo.has_key(key):
            memo[key] = c+1
            que.put((state2, nxt, c+1))
    if pos!=0 and pos!=4:
        next_state(pos-1)
    if pos!=3 and pos!=7:
        next_state(pos+1)
    if pos<4:
        next_state(pos+4)
    else:
        next_state(pos-4)
while True:
    try:
        print memo[raw_input().replace(" ", "")]
    except EOFError:
        break
from math import factorial
import sys

X, Y = map(int, input().split())
MOD = 10 ** 9 + 7

n1 = (2 * X - Y)
n2 = (2 * Y - X)

if n1 == 0 and n2 == 0:
    print(0)
    sys.exit()

if n1 % 3 != 0 or n2 % 3 != 0:
    print(0)
    sys.exit()
else:
    n1 = n1 // 3
    n2 = n2 // 3



P = 10**9 + 7
N = 333335
inv_t = [0]+[1]
for i in range(2,N):
    inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

m = 10**9+7
res = 1
for i in range(1, n1 + n2 + 1):
    res = res * i % m
for i in range(1, n2 + 1):
    res = res * inv_t[i] % m
for i in range(1, n1 + 1):
    res = res * inv_t[i] % m
print(res)

### FIXED CODE ###

import sys

X, Y = map(int, input().split())
MOD = 10 ** 9 + 7

if (X + Y) % 3 != 0:
    print(0)
    sys.exit()

n1 = (2 * X - Y) // 3
n2 = (2 * Y - X) // 3

if n1 < 0 or n2 < 0:
    print(0)
    sys.exit()

P = 10 ** 9 + 7
N = 10 ** 6 + 5
inv_t = [0]+[1]
for i in range(2, N):
    inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

m = 10 ** 9 + 7
res = 1
for i in range(2, n1 + n2 + 1):
    res = res * i % m
for i in range(1, n2 + 1):
    res = res * inv_t[i] % m
for i in range(1, n1 + 1):
    res = res * inv_t[i] % m
print(res)
a,b,c=map(int,input().split())
from math import gcd
print("NO")if c%gcd(a,b) else print("YES")

### FIXED CODE ###

a,b,c=map(int,input().split())
from fractions import gcd
print("NO")if c%gcd(a,b) else print("YES")
def main():
    from collections import deque

    h, w = map(int, input().split())
    ch, cw = map(lambda x: int(x) - 1, input().split())
    dh, dw = map(lambda x: int(x) - 1, input().split())

    m = [list(input()) for _ in range(h)]
    vis = [[False for _ in range(w + 2)] for _ in range(h + 2)]

    def walk(i, j, q):
        if vis[i][j]:
            return []
        vis[i][j] = True
        q.append((i, j))

        for s, t in [(1, 0), (0, 1), (-1, 0), (0, -1)]:
            if not 0 <= i + s <= h - 1 or not 0 <= j + t <= w - 1:
                continue
            if m[i + s][j + t] == '#':
                continue
            tmp = walk(i + s, j + t, q)

        return q

    def jump(i, j, c):
        tmp = walk(i, j, [])
        if (dh, dw) in tmp:
            return c
        res = []
        for s in range(-2, 3):
            for t in range(-2, 3):
                if not 0 <= i + s <= h - 1 or not 0 <= j + t <= w - 1:
                    continue
                if (i + s, j + t) in tmp:
                    continue
                if m[i + s][j + t] == '#':
                    continue

                res += walk(i + s, j + t, [])
        if (dh, dw) in res:
            return c + 1
        else:
            for i, j in res:
                tmp = jump(i, j, c + 1)
                if tmp is not None:
                    return tmp

    ans = jump(ch, cw, 0)
    print(ans if ans is not None else -1)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    from collections import deque

    h, w = map(int, input().split())
    ch, cw = map(lambda x: int(x) - 1, input().split())
    dh, dw = map(lambda x: int(x) - 1, input().split())

    m = [list(input()) for _ in range(h)]
    vis = [[False for _ in range(w + 2)] for _ in range(h + 2)]

    def walk(i, j):
        q = deque()
        q.append((i, j))
        edge = []
        while q:
            y, x = q.popleft()
            if vis[y][x]:
                continue
            vis[y][x] = True
            for s, t in [(1, 0), (0, 1), (-1, 0), (0, -1)]:
                if not 0 <= y + s <= h - 1 or not 0 <= x + t <= w - 1:
                    continue
                if m[y + s][x + t] == '#':
                    edge.append((y, x))
                    continue
                q.appendleft((y + s, x + t))
        return edge

    def jump(i, j, c):
        q = walk(i, j)
        if vis[dh][dw]:
            return c
        nx = []
        c += 1
        while q:
            y, x = q.pop()
            for s in range(-2, 3):
                for t in range(-2, 3):
                    if not 0 <= y + s <= h - 1 or not 0 <= x + t <= w - 1:
                        continue
                    if vis[y + s][x + t]:
                        continue
                    if m[y + s][x + t] == '#':
                        continue
                    nx += walk(y + s, x + t)
                    if vis[dh][dw]:
                        return c
            if len(q) == 0:
                c += 1
                q = nx
                nx = []

    ans = jump(ch, cw, 0)
    print(ans if ans is not None else -1)


if __name__ == '__main__':
    main()
import numpy as np
N, K, Q  = map(int, input().split())
score = np.zeros(N)
for i in range(Q):
  num = int(input())
  score[num] += 1

for i in range(N):
  if score[i] > Q-K:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

a = input()
if a == "Sunny":
  print("Cloudy")
elif a == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
inp1 = input().split()
a = int(inp1[0])
b = int(inp1[1])

c = a%b
if c == 0:
  print("Yes")
else:
  print("No")
  

### FIXED CODE ###

inp1 = input().split()
a = int(inp1[0])
b = int(inp1[1])

if b ==0:
  print("No")
else:
  c = a%b
  if c == 0:
    print("Yes")
  else:
    print("No")
N=int(input())
if N[0]!=7 and N[1]!=7 and N[2]!=7:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

N=input()
if N[0]!='7' and N[1]!='7' and N[2]!='7':
    print('No')
else:
    print('Yes')
inf = input().split()
N = int(inf[0])
K = int(inf[1])
line = [int(v) for v in input().split()]

ans = 0
if K<N:
  for k in range(K+1):
    for i in range(k+1):
      item = line[:i]+line[N-k+i:]
      item.sort()
      count = 0
      while count<K-k and item:
        if item[0]>0:
          break
        item = item[1:]
        count += 1
      s = sum(item)
      if s>ans:
        ans = s
else:
  line.sort()
  count = 0
  while line[0]<0 and count<K:
    line = line[1:]
    count+=1
  s = sum(line)
  if s>ans:
    ans = s

print(ans)

### FIXED CODE ###

inf = input().split()
N = int(inf[0])
K = int(inf[1])
line = [int(v) for v in input().split()]

ans = 0
if K<N:
  for k in range(K+1):
    for i in range(k+1):
      item = line[:i]+line[N-k+i:]
      item.sort()
      count = 0
      while count<K-k and item:
        if item[0]>0:
          break
        item = item[1:]
        count += 1
      s = sum(item)
      if s>ans:
        ans = s
else:
  line = [i for i in line if i>0]
  ans = sum(line)

print(ans)
n,k,q = map(int,input().split())
ans_list =[]
point = []
for i in range(n):
  point.append(k)
#print(point)      
for j in range(q):
  ans_list.append(int(input()))
#print(ans_list)
for k in ans_list:
  point[k] += 1
for l in range(n):
  point[l] -= q
  if point[l]>0:
    print("Yes")
  else:
    print("No")
#print(point)

### FIXED CODE ###

n,k,q = map(int,input().split())
ans_list =[]
point = []
for i in range(n):
  point.append(k)
#print(point)      
for j in range(q):
  ans_list.append(int(input()))
#print(ans_list)
for k in ans_list:
  point[k-1] += 1
#print(point)
for l in range(n):
  point[l] -= q
  if point[l]>0:
    print("Yes")
  else:
    print("No")
#print(point)
n,m=map(int,input().split())
p1=n
p2=m//2
if p1>p2:
 	print(p2)
else:
	delta=p2-p1
    print(delta//2+p1)


### FIXED CODE ###

n,m=map(int,input().split())
p1=n
p2=m//2
if p1>p2:
    print(p2)
else:
    delta=p2-p1
    print(delta//2+p1)
N ,M = map(int,input().split( ))
P = []
Y = []
for i in range(M):
	p, y = map(int,input().split( ))
	P.append(p)
	Y.append(y)

l = []

for i in range(N):
	l.append([])

for i in range(M):
	l[P[i]-1].append(Y[i])

for i in range(N):
	l[i].sort()

for i in range(M):
	Y[i] = l[P[i]-1].index(Y[i]) + 1

for i in range(M):
	while len(str(P[i])) < 6 :
		P[i] = '0' + str(P[i])

for i in range(M):
	while len(str(Y[i])) < 6 :
		Y[i] = '0' + str(Y[i])

for i in range(M):
	print(P[i] + Y[i])




### FIXED CODE ###

N ,M = map(int,input().split( ))
l = []
for i in range(M):
	p, y = map(int,input().split( ))
	l.append((y, p, i))
l.sort()


p_count  = [0 for i in range(N)]

l_2 = []
for i in range(M):
	p_count[l[i][1]-1] += 1
	l_2.append((l[i][2], l[i][1], p_count[l[i][1]-1]))
l_2.sort()
for i in range(M):
	print(str(l_2[i][1]).zfill(6)+str(l_2[i][2]).zfill(6))
def gcd(a,b):
    while b:
        a,b = b,a%b
    return a

def lcm(a,b):
    return (a*b)/int(gcd(a,b))

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

ans = T[0]
for i in range(1,N):
    ans = int(lcm(ans,T[i]))
print(int(ans))


### FIXED CODE ###

def gcd(a,b):
    while b:
        a,b = b,a%b
    return a


def lcm(a,b):
    return (a*b) // gcd(a,b)


N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

t = T[0]
for i in range(N - 1):
    t = lcm(t,T[i+1])
print(t)
#coding:utf-8
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))

p1 = 0
p2 = 0
p3 = 0

for i in p:
  if i <= a:
    p1 += 1
  elif i >= (a+1) and i <= b:
    p2 += 1
  elif i >= (b+1)
    p3 += 1

print(min(min(p1, p2), p3))

### FIXED CODE ###

#coding:utf-8
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))

p1 = 0
p2 = 0
p3 = 0

for i in p:
  if i <= a:
    p1 += 1
  elif i >= (a+1) and i <= b:
    p2 += 1
  elif i >= (b+1):
    p3 += 1

print(min(min(p1, p2), p3))
l,r,d = map(int, input().split())
var=l//d
var1=r//d
ans=var1-var
if l%d==0:
ans+=1
print(ans)

### FIXED CODE ###

l,r,d = map(int, input().split())
var=l//d
var1=r//d
ans=var1-var
if l%d==0:
    ans+=1
print(ans)
i = input()
if i[0] == i[1] == i[2]:
    print('Yes')
elif i[1] == i[2] == i[e]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

i = input()
if i[0] == i[1] == i[2]:
    print('Yes')
elif i[1] == i[2] == i[3]:
    print('Yes')
else:
    print('No')
s = int(input())

if A in s and B in s:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = input()
 
if "A" in s and "B" in s:
  print("Yes")
else:
  print("No")
#query=10**4*2
#alph=26
#insert=500000
#O(|insert*query*alph|)?
def main():
	import bisect,sys
	input=sys.stdin.readline
	n=int(input())
	s=list(input().rstrip())
	q=int(input())
	word=[[]for _ in range(26)]
	for i,j in enumerate(s):
		ch=ord(j)-ord("a")
		word[ch].append(i)
	for _ in range(q):
		query=input().split()
		if query[0]=="1":
			i,x=int(query[1])-1,ord(query[2])-ord("a")
			old=ord(s[i])-ord("a")
			word[old].remove(i)
			new=bisect.bisect_left(word[x],i)
			word[x].insert(new,i)
			s[i]=x
		else:
			l,r=int(query[1])-1,int(query[2])-1
			kind=0
			for i in range(26):
				l=bisect.bisect_left(word[i],l)
				if l==len(word[i]):
					continue
				if word[i][l]<=r:
					kind+=1
			print(kind)
if __name__ == '__main__':
	main()

### FIXED CODE ###

import sys
input=sys.stdin.readline
n=int(input())
BIT=[[0]*n for i in range(26)]
w=[ord(x)-ord("a") for x in input()]
for i in range(n):
	k=i+1
	while k<=n:
		BIT[w[i]][k-1]+=1
		k=k+(k&-k)
q=int(input())
for i in range(q):
	a,b,c=input().split()
	if a=="1":
		k=int(b)
		while k<=n:
			BIT[ord(c)-ord("a")][k-1]+=1
			k=k+(k&-k)
		k=int(b)
		while k<=n:
			BIT[w[int(b)-1]][k-1]-=1
			k=k+(k&-k)	
		w[int(b)-1]=ord(c)-ord("a")
	else:
		b=int(b);c=int(c)
		ans=0
		for i in range(26):
			cnt=0
			k=c
			while k!=0:
				cnt+=BIT[i][k-1]
				k=k-(k&-k)
			k=b-1
			while k!=0:
				cnt-=BIT[i][k-1]
				k=k-(k&-k)
			if cnt>0:
				ans+=1
		print(ans)
while True:
    h, w = [int(i) for i in input().split()]

        if (h + w) % 2 = 0:
            print('#')
        else:
            print('.')

    print

        

### FIXED CODE ###

while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
       break

    for h in range(H):
        for w in range(W):
            if (h + w) % 2 == 0:
                print('#', end='')
            else:
                print('.', end='')

        print()
    print()
while True:
	n, m = (int(x) for x in raw_input().split(" "))
	if n == 0 and m == 0: break
	p = [int(x) for x in raw_input().split(" ")]
	s = sum(p)
	p.sort(reverse=True)
	for x in p[m - 1::m]:
		s -= x
	print s

### FIXED CODE ###

while True:
	try:
		n, m = (int(x.strip()) for x in raw_input().split())
		if n == 0 and m == 0: break
		p = [int(x.strip()) for x in raw_input().split()]
		s = sum(p)
		p.sort(reverse=True)
		for x in p[m - 1::m]:
			s -= x
		print s
	except:
		pass
import math
import functools

def main():
    N,X = (int(i) for i in input().split())
    x=list(map(int,input().split()))

    gcd_l = []
    gcd_l.append(abs(X-x[0]))

    for i in range(1,N):
        gcd_l.append(abs(x[i-1]-x[i]))

    print(functools.reduce(math.gcd,gcd_l))

main()

### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def main():
    N,X = (int(i) for i in input().split())
    x=list(map(int,input().split()))

    gcd_l = []
    #gcd_l.append(abs(X-x[0]))

    for i in range(0,N):
        gcd_l.append(abs(X-x[i]))
    if N==1:
        ans = gcd_l[0]
    else:
        a = [gcd_l[0],gcd_l[1]]
        ans = gcd(max(a),min(a))
        for n in range(2,len(gcd_l)):
            a = [ans,gcd_l[n]]
            ans = gcd(max(a),min(a))
    print(ans)

main()
n=int(input())
#4
#7
ans=False
if n%7==0:
    ans==True


for i in range(n/7):
    if (n-i*7)%4==0:
        ans=True
        

if ans:
    print("Yes")
else:
    print("No")    


### FIXED CODE ###

n=int(input())


ans=False

if n%7==0:
    ans=True


for i in range((int(1+(n/7)))):
    
    if (n-i*7)%4==0:
        ans=True
        

if ans:
    print("Yes")
else:
    print("No")
n = input()
ans = ""
	for c in n:
		if c == "1":
            ans += "9"
        elif c == "9":
            ans += "1"
        else:
            ans += c
print(ans)

### FIXED CODE ###

S = input()

ans = ""

for i in S:
  if i == "1":
    ans += "9"
  else:
    ans += "1"

print(ans)
import sys
N,Y=map(int,input().split())
ans=0
for x in range (N):
    for y in range(N):
        if 10000*x+5000*y+1000*(N-x-y)==Y:
            print(x+' '+y+' '+N-x-y)
            sys.exit()
print(-1,-1,-1)

### FIXED CODE ###

import sys
N,Y=map(int,input().split())
ans=0
for x in range (N+1):
    for y in range(N+1-x):
        if 10000*x+5000*y+1000*(N-x-y)==Y:
            print(str(x)+' '+str(y)+' '+str(N-x-y))
            sys.exit()
print(-1,-1,-1)
n = int(input)
if n%2 == 0:
  print(n)
else:
  print(2*n)

### FIXED CODE ###

n = int(input())
if n%2 == 0:
  print(n)
else:
  print(2*n)