Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
# 	入力
n=int(input())
t=0
x=0
y=0
s="Yes"
for i in range(n):
  t1,x1,y1=map(int,sys.stdin.readline().split())
  if abs(x1-x)+abs(y1-y) > (t1-t):
    s="No"
    break
  if ((x1 + y1) % 2) == (t1 % 2):
    x=x1
    y=y1
    t=t1
  else:
    s="No"
    break
# 出力
print(s)

### FIXED CODE ###

import sys
# -*- coding: utf-8 -*-
# 	入力
n=int(input())
t=0
x=0
y=0
s="Yes"
for i in range(n):
  t1,x1,y1=map(int,sys.stdin.readline().split())
  if abs(x1-x)+abs(y1-y) > (t1-t):
    s="No"
    break
  if ((x1 + y1) % 2) == (t1 % 2):
    x=x1
    y=y1
    t=t1
  else:
    s="No"
    break
# 出力
print(s)
S = input()
print(min(len(re.findall('0', S)), len(re.findall('1', S))) * 2 if len(S) > 1 else 0)

### FIXED CODE ###

A, B, C = map(int, input().split())
print(C if A * C < B else B //A)
import math
import itertools

n, m, q = map(int, input().split(" "))
aL = []
_max = 0

for i in range(q):
    aL.append(list(map(int, input().split(" "))))

li = []


def dfs(i, _n, p):
    if i == n:
        li.append(list(map(int, list(str(_n)))))
        return
    for j in range(p, m + 1):
        dfs(i + 1, _n * 10 + j, j)


if m != 1:
    for i in range(1, m + 1):
        dfs(1, i, i)
else:
    li = [[i] * m for i in range(1, n + 1)]

for t in li:
    if t[0] == 0:
        continue
    _sum = 0
    for a in aL:
        if t[a[1] - 1] - t[a[0] - 1] == a[2]:
            _sum += a[3]
    _max = max(_max, _sum)

print(_max)

### FIXED CODE ###

import math
import itertools

n, m, q = map(int, input().split(" "))
aL = []
_max = 0

for i in range(q):
    aL.append(list(map(int, input().split(" "))))

zLi = itertools.combinations_with_replacement(list(range(m + 1)), n)
for t in zLi:
    if t[0] == 0:
        continue
    _sum = 0
    for a in aL:
        if t[a[1] - 1] - t[a[0] - 1] == a[2]:
            _sum += a[3]
    _max = max(_max, _sum)

print(_max)
-*- coding: utf-8 -*- 
a = int(input())  # Nを入力 
b = input()  # a1,a2...anを入力 
b = map(int, b.split())  # a1,a2...anをint型でリストに入れる 
b = sorted(b)  # 大きい順に並べる b = b[::-1]  # リストの要素の順番を逆転する 
c = b[::2]  # Aliceのとる要素を抽出 
c_number = len(c) 
d = b[1::2]  # Bobのとる要素を抽出 
d_number = len(d) 
c_sum = 0 
d_sum = 0 
for i in range(c_number):
    c_sum += c[i] # Aliceのとる要素の合計  
for g in range(d_number):
　　d_sum += d[g]  # Bobのとる要素の合計  
print(c_sum - d_sum)  # 差分を出力


### FIXED CODE ###

# -*- coding: utf-8 -*-
a = int(input())  # Nを入力
b = input()  # a1,a2...anを入
b = map(int, b.split())
b = sorted(b)
b = b[::-1]
c = b[::2]
c_number = len(c)
d = b[1::2]
d_number = len(d)
c_sum = 0
d_sum = 0
for i in range(c_number):
    c_sum += c[i]

for g in range(d_number):
    d_sum += d[g]

print(c_sum - d_sum)
X, N = map(int, input().split())
nums = list(map(int, input().split()))
nums.sort()
low = nums[0]
high = nums[-1]
minDiff = 100000000
minNum = -1
for i in range(low+1, high):
  if i in nums:
    continue
  else:
    Dif = abs(X-i)
    if (Dif < minDiff):
      minDiff = Dif
      minNum=i

if (minNum == -1):
  print(X)
else:
  print(minNum)


  

### FIXED CODE ###

X, N = map(int, input().split())
if (N == 0):
  print(X)
else:
  nums = list(map(int, input().split()))
    
  nums.sort()
  low = nums[0]
  high = nums[-1]
  minDiff = 100000000
  minNum = -1
  for i in range(-10, 110):
    if i in nums:
      continue
    else:
      Dif = abs(X-i)
    if (Dif < minDiff):
      minDiff = Dif
      minNum=i
  print(minNum)
import numpy as np

S = input()
N = len(S)
arr = np.zeros((N, N), dtype=np.int)
for n, s in enumerate(S):
    i = n
    j = n + (1 if s == 'R' else -1)
    arr[i, j] += 1
mat = np.matrix(arr)
print(*(np.ones(N, dtype=np.int) * (mat ** 10 ** 100)).tolist()[0])


### FIXED CODE ###

import numpy as np
from scipy.sparse import csr_matrix

S = input()
N = len(S)
row = tuple(range(N))
col = [n + (1 if s == 'R' else -1) for n, s in enumerate(S)]
data = [1] * N
mat = csr_matrix((data, (row, col)), shape=(N, N))
print(*np.ones(N, dtype=np.int) * (mat ** 10 ** 100))
A = int(input())
B = int(input())

if A = 1 and B = 2:
  print(3)
elif A = 2 and B = 3:
  print(1)
else:
  print(2)

### FIXED CODE ###

A = int(input())
B = int(input())

if A == 1 and B == 2:
  print(3)
elif A == 1 and B == 3:
  print(2)
elif A == 2 and B == 1:
  print(3)
elif A == 2 and B == 3:
  print(1)
elif A == 3 and B == 1:
  print(2)
else:
  print(1)
import re
X=sorted(re.findall("[ACGT]+",input()), len=True)
print(len(X[-1]))

### FIXED CODE ###

S = str(input())
m=0
point=0
for i in S:
    if i == "A" or i == "G" or i == "C" or i == "T":
        point+=1
    else:
        point*=0
    m = max(m, point)
print(m)
a,b,c =map(int,input().split())
print(a+b+c)

### FIXED CODE ###

a=input()
print(a.count("1"))
def solve(h, w):
    if h == 0 and w == 0:
        return None

    a, b = '#', '.'

    for i in range(h):
        row = ''
        flag = True if i % 2 == 0 else False
        for j in range(w):
            if flag:
                row += a
            else:
                row += b
            flag = not flag
        print(row)
    print('')


if __name__ == '__main__':
    _input = map(int, input().split())

    for h, w in _input:
        solve(h, w)

### FIXED CODE ###

def solve(h, w):
    a, b = '#', '.'

    for i in range(h):
        row = ''
        flag = True if i % 2 == 0 else False
        for j in range(w):
            if flag:
                row += a
            else:
                row += b
            flag = not flag
        print(row)
    print('')


if __name__ == '__main__':
    # _input = [
    #     (3, 4),
    #     (5, 6),
    #     (3, 3),
    #     (0, 0)
    # ]
    while True:
        h, w = map(int, input().split())
        if h == 0 and w == 0:
            break
        solve(h, w)
import sys
sys.setrecursionlimit(100000)

n = int(input())
tree = [[] for i in range(n + 1)]
for i in range(n - 1):
    a, b, c = map(int, input().split())
    tree[a].append((b, c))
    tree[b].append((a, c))

depth = [0] * (n + 1)
def dfs(v, p, d):
    depth[v] = d
    for to, cost in tree[v]:
        if to != p:
            dfs(to, v, d + cost)

q, k = map(int, input().split())
dfs(k, 0, 0)
xy = [tuple(map(int, input().split())) for i in range(q)]

for x, y in xy:
    print(depth[x] + depth[y])


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n = int(input())
tree = [[] for i in range(n + 1)]
for i in range(n - 1):
    a, b, c = map(int, input().split())
    tree[a].append((b, c))
    tree[b].append((a, c))

depth = [0] * (n + 1)
def dfs(v, p, d):
    depth[v] = d
    for to, cost in tree[v]:
        if to != p:
            dfs(to, v, d + cost)

q, k = map(int, input().split())
dfs(k, 0, 0)
xy = [tuple(map(int, input().split())) for i in range(q)]

for x, y in xy:
    print(depth[x] + depth[y])
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i+1] == "D":
      S[i] = "P"
    elif S[i-1] == "D":
      S[i] = "P"
    else:
      S[i] = "D"


if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

### FIXED CODE ###

S = list(input())
lon = len(S)
for i in range(lon):
  if S[i] == "?":
    S[i] = "D"
 
    

T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)
n = int(input())
h = list(map(input().split()))

count
max_count = 0
for i in range(n-1):
  if h[i]>=h[i+1]:
    count += 1
  else: count = 0
  
  if count > max_count: max_count = count
print(max_count)

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))

count = 0
max_count = 0
for i in range(n-1):
  if h[i]>=h[i+1]:
    count += 1
  else: count = 0
  
  if count > max_count: max_count = count
print(max_count)
S=list(input())
T=list(input())
S=S+S
ans='No'
fot i in range(len(T)):
  if S[i:len(T)]==T:
    ans='Yes'
    break
print(ans)

### FIXED CODE ###

S=list(input())
T=list(input())
S=S+S
ans='No'
for i in range(len(T)):
  if S[i:len(T)+i]==T:
    ans='Yes'
    break
print(ans)
n=int(input())
a=[]
for i in range(n):
    s=input()
    if s not in a:
        a.append(s)

print(len(a))


### FIXED CODE ###

s,w=map(int,input().split())

if s<=w:
    print('unsafe')
else:
    print('safe')
from collections import Counter

s = input()

ans = ['Second', 'First']
c = Counter(s)
flag = 0 if len(c) == 2 else 1
same = 1 if s[0] == s[-1] else 0
print(ans[(len(s) % 2 + same) * flag])


### FIXED CODE ###

from collections import Counter

s = input()

ans = ['Second', 'First']
c = Counter(s)
flag = 0 if len(c) == 2 else 1
same = 1 if s[0] == s[-1] else 0
print(ans[((len(s) + same) % 2) * flag])
import sys
import re
def line():return sys.stdin.readline().strip()

while True:

    e = re.findall(r"[0-9X]+",line())

    ans = -1
    for i in range(10):
        a,b,c = [int(_.replace("X",str(i))) for _ in e]
        if a + b == c :
            ans = i
            break

    if ans == -1:
        print("NA")
    else:
        print(ans)

### FIXED CODE ###

import sys
import re
def line():return sys.stdin.readline().strip()

while True:
    try:
        e = re.findall(r"[0-9X]+",line())

        ans = -1
        for i in range(10):
            a,b,c = [_.replace("X",str(i)) for _ in e]
            if i == 0 \
                and (\
                (a[0] == "0" and len(a) != 1)\
                or (b[0] == "0" and len(b) != 1)\
                or (c[0] == "0" and len(c) != 1)\
                ):
                continue 
            if int(a) + int(b) == int(c) :
                ans = i
                break

        if ans == -1:
            print("NA")
        else:
            print(ans)
    except:
        break
import sys
import collections


def main():
    [n, q] = [int(s) for s in sys.stdin.readline().strip().split()]
    a = [-1] * (n-1)
    b = [-1] * (n-1)
    tree = collections.defaultdict(set)
    for i in range(n-1):
        a[i], b[i] = [int(s) for s in sys.stdin.readline().strip().split()]
        tree[a[i]-1].add(b[i]-1)

    p = [-1] * q
    x = [-1] * q
    adds = [0] * n
    for i in range(q):
        p[i], x[i] = [int(s) for s in sys.stdin.readline().strip().split()]
        adds[p[i]-1] += x[i]

    results = [0] * n
    seen = set()

    def rec_add(node, cur):
        if node in seen:
            return
        cur += adds[node]
        results[node] = cur
        seen.add(node)
        for child in tree[node]:
            rec_add(child, cur)

    rec_add(0, 0)
    print(' '.join([str(n) for n in results]))


main()


### FIXED CODE ###

import sys
import collections


def main():
    [n, q] = [int(s) for s in sys.stdin.readline().strip().split()]
    a = [-1] * (n-1)
    b = [-1] * (n-1)
    tree = collections.defaultdict(set)
    for i in range(n-1):
        a[i], b[i] = [int(s) for s in sys.stdin.readline().strip().split()]
        tree[a[i]-1].add(b[i]-1)
        tree[b[i]-1].add(a[i]-1)

    p = [-1] * q
    x = [-1] * q
    adds = [0] * n
    for i in range(q):
        p[i], x[i] = [int(s) for s in sys.stdin.readline().strip().split()]
        adds[p[i]-1] += x[i]

    results = [0] * n
    seen = set()

    # def rec_add(node, cur, c):
    #     if c > 1000:
    #         return
    #     cur += adds[node]
    #     results[node] = cur
    #     seen.add(node)
    #     for child in tree[node]:
    #         if child in seen:
    #             continue
    #         rec_add(child, cur, c+1)
    #
    # rec_add(0, 0, 0)

    for i in range(n):
        results[i] = adds[i]
        for child in tree[i]:
            adds[child] += results[i]
    print(' '.join([str(n) for n in results]))


main()
# d
N,K = map(int, input().split())
xy = []
for _ in range(N):
    xy.append( tuple(map(int, input().split())) )
xs,ys = map(list, zip(*xy))
xs.sort()
ys.sort()
ans = float('inf')
for l in range(N):
    for r in range(l+1,N):
        for b in range(N):
            for t in range(t+1,N):
                xl,xr = xs[l],xs[r]
                yb,yt = ys[b],ys[t]
                cnt = 0
                for xi,yi in xy:
                    if xl<=xi<=xr and yb<=yi<=yt: 
                        cnt += 1
                if cnt>=K:
                    ans = min(ans, (xr-xl)*(yt-yb))
print(ans)

### FIXED CODE ###

# d
N,K = map(int, input().split())
xy = []
for _ in range(N):
    xy.append( tuple(map(int, input().split())) )
xs,ys = map(list, zip(*xy))
xs.sort()
ys.sort()
ans = float('inf')
for l in range(N):
    for r in range(l+1,N):
        for b in range(N):
            for t in range(b+1,N):
                xl,xr = xs[l],xs[r]
                yb,yt = ys[b],ys[t]
                cnt = 0
                for xi,yi in xy:
                    if xl<=xi<=xr and yb<=yi<=yt: 
                        cnt += 1
                if cnt>=K:
                    ans = min(ans, (xr-xl)*(yt-yb))
print(ans)
i = j = k = 0
n = ''
m = ''
l = ''

line = input()

while line[i] != ' ':
    n = n + line[i]
    i += 1
    
while line[i] != ' ':
    l = l + line[i]
    i += 1

while i < len(line):
    m = m + line[i]
    i += 1
    
n = int(n)
l = int(l)
m = int(m)

if n < l and l < m:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

i = j = k = 0
n = ''
m = ''
l = ''

line = input()

while line[i] != ' ':
    n = n + line[i]
    i += 1

i += 1
while line[i] != ' ':
    l = l + line[i]
    i += 1

while i < len(line):
    m = m + line[i]
    i += 1
    
n = int(n)
l = int(l)
m = int(m)

if n < l and l < m:
    print("Yes")
else:
    print("No")
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
dp=[np.inf]*n
dp[0]=0
dp[1]=abs(a[1]-a[0])

for i in range(2,n):
    for j in range(max(0,i-k),i):
        dp[i]=min(dp[j]+abs(a[i]-a[j]),dp[i])
print(dp[-1])

### FIXED CODE ###

n,k=map(int,input().split())
a=[int(i) for i in input().split()]
dp=[10**9]*n
dp[0]=0
dp[1]=abs(a[1]-a[0])
for i in range(2,n):
    for j in range(max(0,i-k),i):
        dp[i]=min(dp[j]+abs(a[i]-a[j]),dp[i])
print(dp[-1])
n,l=map(int,input().split())
s=[int(input()) for _ in range(n)]
s.sort()

print(i for i in s,end="")

### FIXED CODE ###

n,l=map(int,input().split())
s=[input() for _ in range(n)]
s.sort()

for i in s:
  print(i,end="")
x, a = input()
x = int(x)
a = int(a)

if x < a:
  print(0)
else:
  print(10)

### FIXED CODE ###

x, a = input().split()
x = int(x)
a = int(a)

if x < a:
  print(0)
else:
  print(10)
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
G = [set() for _ in range(N+1)]
for _ in range(M):
    A, B = map(int, input().split())
    G[A].add(B)
    G[B].add(A)
if M % 2 == 1:
    print(-1)
    exit()
G2 = [set() for _ in range(N+1)]
parent = [0] * (N+1)
depth = [-1] * (N+1)
depth[1] = 0
stack = [1]
while stack:
    v = stack.pop()
    if len(G[v]) > 0 and v != 1:
        if parent[v] < 0 or N < parent[v]:
            print(-1)
        depth[v] = depth[parent[v]] + 1
    for c in G[v]:
        G2[v].add(c)
        parent[c] = v
        if v not in G[c]:
            print(-1)
        G[c].remove(v)
        stack.append(c)
nodes = sorted(list(range(1, N+1)), key=lambda v: -depth[v])
ans = []
for v in nodes:
    for c in G2[v]:
        ans.append((v, c))
    if len(G2[v]) % 2 == 1:
        p = parent[v]
        ans.append((v, p))
        G2[p].remove(v)
for u, v in ans:
    print(u, v)


### FIXED CODE ###

import sys
input = sys.stdin.readline

N, M = map(int, input().split())
G = [set() for _ in range(N+1)]
for _ in range(M):
    A, B = map(int, input().split())
    G[A].add(B)
    G[B].add(A)
if M % 2 == 1:
    print(-1)
    exit()
G2 = [set() for _ in range(N+1)]
parent = [0] * (N+1)
depth = [-1] * (N+1)
depth[1] = 0
stack = [1]
while stack:
    v = stack.pop()
    if len(G[v]) > 0 and v != 1:
        depth[v] = depth[parent[v]] + 1
    for c in G[v]:
        G2[v].add(c)
        parent[c] = v
        if v in G[c]:
            G[c].remove(v)
        stack.append(c)
    G[v] = set()
nodes = sorted(list(range(1, N+1)), key=lambda v: -depth[v])
ans = []
for v in nodes:
    for c in G2[v]:
        ans.append((v, c))
    if len(G2[v]) % 2 == 1:
        p = parent[v]
        ans.append((v, p))
        G2[p].remove(v)
for u, v in ans:
    print(u, v)
n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
flg = True
import numpy as np
num = np.array(A)
while flg:
  if all([a>0 for a in num]):
    flg = all([0==a%2 for a in num])
    num = num//2
  else:
    break
A = np.array(A)//2
A = A.tolist()
def gcd(a, b):
  if b == 0:
    return a
  else:
    return gcd(b, a%b)

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

def gcd_many(l):
  if len(l) == 2:
    return gcd(l[0],l[1])
  else:
    return gcd_many(l[2:]+[gcd(l[0],l[1])])

def lcm_many(l):
  if len(l) == 2:
    return lcm(l[0],l[1])
  else:
    return lcm_many([lcm(l[0],l[1])] + l[2:])
if flg:
  print(0)
else:
  lc = lcm_many(A)
  ans = (m // lc) // 2 if lc < m else 0
  if lc % 2 != 0:
    ans += 1
  print(ans)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
from fractions import gcd
from functools import reduce
 
N,M,*A = map(int,read().split())
 
# 「奇数倍」に帰着
A = [x >> 1 for x in A]
 
def merge(a,b):
    g = gcd(a,b)
    a //= g; b //= g
    if a % 2 == 0:
        return 0
    if b % 2 == 0:
        return 0
    n = a * b * g
    if n > 10 ** 9:
        return 0
    return n
 
x = reduce(merge, A)
if x == 0:
    answer = 0
else:
    answer = (M//x) - (M//(x+x))
 
print(answer)
import numpy as np
n,m=map(int,input().split())
L=list(map(int,input().split()))
L.sort()

d=np.array([L[i+1]-L[i] for i in range(m-1)])
ans=L[m-1]-L[0]

for i in range(n-1):
  a=argmax(d)
  ans-(L[a+1]-L[a])
  d[a]=0
  




print(ans)


### FIXED CODE ###

n,m=map(int,input().split())
L=list(map(int,input().split()))
L.sort()
if n>=m:
  print(0)
elif m!=1:

  d=[L[i+1]-L[i] for i in range(m-1)]
  d.sort()
  d.reverse()
  ans=L[-1]-L[0]


  ans-=sum(d[:n-1])
  print(ans)
  

else:
  print(0)
a,b=map(str,input().split())
if a<=b:
  s=a
  for _ in range(b-1):
    s+=a
  print (s)
else:
  s=b
  for _ in range(a-1):
    s+=b
  print(s)
  

### FIXED CODE ###

a,b=map(str,input().split())
if int(a)<=int(b):
  s=a
  for i in range(int(b)-1):
    s+=a
  print (s)
else:
  s=b
  for j in range(int(a)-1):
    s+=b
  print(s)
# Problem E - Red and Green Apples

from collections import deque

# input
X, Y, A, B, C = map(int, input().split())
red_list = list(map(int, input().split())) # red apple
green_list = list(map(int, input().split())) # green apple
transparent_list = list(map(int, input().split())) # transparent apple

# initialization
red_list = deque(sorted(red_list, reverse=True))
green_list = deque(sorted(green_list, reverse=True))
transparent_list = deque(sorted(transparent_list, reverse=True))
ans_list = deque([])

# count
while X>0 or Y>0:
    red = -1
    green = -1
    toumei = -1
    if C>=0:
        toumei = transparent_list[0]
    max_v = 0

    if X>0:
        red = red_list[0]

    if Y>0:
        green = green_list[0]

    # max value check
    if red>=green and red>=toumei:
        max_v = red_list.popleft()
        X -= 1
    elif green>=red and green>=toumei:
        max_v = green_list.popleft()
        Y -= 1
    else:
        # min value check
        if X>0 and Y>0:
            if red<=green:
                max_v = transparent_list.popleft()
                X -= 1
                C -= 1
                red_list.popleft()
            else:
                max_v = transparent_list.popleft()
                Y -= 1
                C -= 1
                green_list.popleft()
        elif X>0:
            max_v = transparent_list.popleft()
            X -= 1
            C -= 1
            red_list.popleft()
        else:
            max_v = transparent_list.popleft()
            Y -= 1
            C -= 1
            green_list.popleft()

    # list insert
    ans_list.append(max_v)

# output
ans = sum(ans_list)
print(ans)


### FIXED CODE ###

# Problem E - Red and Green Apples

from collections import deque

# input
X, Y, A, B, C = map(int, input().split())
red_apples = sorted(list(map(int, input().split())), reverse=True)
green_apples = sorted(list(map(int, input().split())), reverse=True)
mushoku_apples = sorted(list(map(int, input().split())), reverse=True)

# initialization
red_apples = red_apples[:X]
green_apples = green_apples[:Y]
ans_list = deque([])
for r in red_apples:
    ans_list.append(r)
for g in green_apples:
    ans_list.append(g)
for m in mushoku_apples:
    ans_list.append(m)
ans_list = sorted(ans_list, reverse=True)

# output
i = X+Y
ans = sum(ans_list[:i])
print(ans)
s = input()
old = ''
flag = 0
sample = [chr(i) for i in range(97, 97+26)]
if len(s) == 26:
    u = {s[-1]}
    for i in range(len(s) - 1)[::-1]:
        x = [c for c in u if s[i] < c]
        if x:
            print(s[:i] + min(x))
            break
        u.add(s[i])
    else:
        print(-1)
else:
    out = s + min(set(sample)-set(s))

print(out)

### FIXED CODE ###

s = input()
t = set(map(chr, range(ord('a'), ord('z')+1))) - set(s)
if t:
    print(s + min(t))
else:
    u = {s[-1]}
    for i in range(len(s)-1)[::-1]:
        x = [c for c in u if s[i]<c]
        if x:
            print(s[:i] + min(x))
            break
        u.add(s[i])
    else:
        print(-1)
a,b,c = map(int,input().split())
if (b-a)==(c-b):
    print("YES")
else:
    print("NO")a,b,c = map(int,input().split())

### FIXED CODE ###

a,b,c = map(int,input().split())
if (b-a)==(c-b):
    print("YES")
else:
    print("NO")
N = input()
charlist = list(N)
hoge = 0
maxscore = 0
def onon(char, hogehoge):
    nowscore = 0
    while char[hogehoge] == "A" or char[hogehoge] == "T" or char[hogehoge] == "G" or char[hogehoge] == "C" :
        hogehoge = hogehoge + 1
        nowscore += 1
    return nowscore 
for i in charlist:
    score = 0
    if i == "A" or i == "T" or i == "G" or i == "C"  :
        score = onon(charlist,hoge)
    if maxscore <= score:
        maxscore = score
    hoge = hoge + 1
print(maxscore)


### FIXED CODE ###

N = input()
charlist = list(N)
hoge = 0
maxscore = 0
def onon(char, hogehoge):
    nowscore = 0
    while char[hogehoge] == "A" or char[hogehoge] == "T" or char[hogehoge] == "G" or char[hogehoge] == "C" :
        hogehoge = hogehoge + 1
        nowscore += 1
        if hogehoge  >= len(char):
            break
    return nowscore 
for i in charlist:
    score = 0
    if i == "A" or i == "T" or i == "G" or i == "C"  :
        score = onon(charlist,hoge)
    if maxscore <= score:
        maxscore = score
    hoge = hoge + 1
print(maxscore)
def gcd(x, y):
    r = modlog(x, y)
    while r != 0:
        x = y
        y = r
        r = modlog(x, y)
    return y

def modlog(x, y):
    r = x % y
    return r

if __name__ == '__main__' :
    N,X = map(int, input().split())
    x = list(map(int, input().split()))

    dist_list = [abs(d-X) for d in x]

    alpha = gcd(dist_list[0],dist_list[1])
    for d in dist_list:
        alpha = gcd(alpha,d)

    print(alpha)

### FIXED CODE ###

def gcd(x, y):
    r = modlog(x, y)
    while r != 0:
        x = y
        y = r
        r = modlog(x, y)
    return y

def modlog(x, y):
    r = x % y
    return r

if __name__ == '__main__' :
    N,X = map(int, input().split())
    x = list(map(int, input().split()))

    dist_list = [abs(d-X) for d in x]

    if len(dist_list) == 1:
        print (dist_list[0])
        exit()
        
    alpha = gcd(dist_list[0],dist_list[1])
    for d in dist_list:
        alpha = gcd(alpha,d)

    print(alpha)