Harryxun/stf_run huggingface dataset:
s=list(input())

s_odd=s[0::2] 
s_even=s[1::2]

if s_odd.find('L')=='-1' and s_even.find('R')=='-1':
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s=list(input())

s_odd=''.join(s[0::2]) #偶数項、奇数項に分類する
s_even=''.join(s[1::2])

if s_odd.find('L')==-1 and s_even.find('R')==-1:
    print('Yes')
else:
    print('No')
n=int(input())
l=list(map(int,input().split()))
l1={}
l2=[]
for i in l:
  if i in l1:
    if l1[i]%2==0:
      l1[i]+=1
    else:
      l2.append(i)
      l1[i]+=1
  else:
    l1[i]=1
l2=sorted(l2)
print(l2[-1]*l2[-2])

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
l1={}
l2=[]
for i in l:
  if i in l1:
    if l1[i]%2==0:
      l1[i]+=1
    else:
      l2.append(i)
      l1[i]+=1
  else:
    l1[i]=1
if len(l2)<2:
  print(0)
else:
  l2=sorted(l2)
  print(l2[-1]*l2[-2])
from math import factorial

N = int(input())
index = list(map(int, input().split()))
val = [0]*max(index)
for i in index:
    val[i-1] += 1
total = 0
for i in val:
    if i >= 2:
        total += comb(i, 2, exact=True)
for i in index:
    if val[i-1] >= 2:
        print(total-(comb(val[i-1], 2, exact=True)-comb(val[i-1]-1, 2, exact=True)))
    else:
        print(total)


### FIXED CODE ###

from scipy.special import comb

N = int(input())
index = list(map(int, input().split()))
val = [0]*max(index)
for i in index:
    val[i-1] += 1
total = 0
for i in val:
    if i >= 2:
        total += comb(i, 2, exact=True)
for i in index:
    if val[i-1] >= 2:
        print(total-(comb(val[i-1], 2, exact=True)-comb(val[i-1]-1, 2, exact=True)))
    else:
        print(total)
#!/usr/bin/python
# coding: utf-8

from sys import stdin

memo = {}

# それぞれ z 枚目, w 枚目を持っている局面での最適解
def solve(z, w, player):
  global a, memo
  n = max(z, w) + 1  # 取り終わっている枚数
  if n == len(a): return abs(a[z] - a[w])
  if (z, w, player) in memo: return memo[(z, w, player)]

  m      = 0   if player == 0 else 1000000000
  minmax = max if player == 0 else min
  for i in range(n, len(a)):
    if player == 0: zz = i; ww = w
    else:           ww = i; zz = z
    m = minmax(m, solve(zz, ww, 1 - player))
  memo[(z, w, player)] = m
  return m

N, Z, W = map(int, stdin.readline().split())
a       = map(int, stdin.readline().split())
if len(a) != N: raise

# Z, Wを山の先頭に置く
a = [Z, W] + a

print(solve(0, 1, 0))


### FIXED CODE ###

#!/usr/bin/python
# coding: utf-8

from sys import stdin

def solve(a):
  n = len(a)
  xmemo = [0 for i in range(n)]  # player X の手番での最適スコア
  ymemo = [0 for i in range(n)]  # player Y 　　　〃

  # 自分がj (< i) 枚目, 相手がi枚目を持っている
  for i in range(n - 2, -1, -1):
    # 自分が取り切ったときのスコア
    f = abs(a[i] - a[n - 1])
    # j, i の差が何枚でも同じ
    xmemo[i] = max([f] + [ymemo[jj] for jj in range(i + 1, n - 1)])
    ymemo[i] = min([f] + [xmemo[jj] for jj in range(i + 1, n - 1)])

  return xmemo[1]

N, Z, W = map(int, stdin.readline().split())
a       = map(int, stdin.readline().split())
if len(a) != N: raise

# Z, Wを山の先頭に置く
a = [Z, W] + a

print(solve(a))
a,b,c d = map(int,input().split())

print(max(a*c,b*d,b*c,a*d))

### FIXED CODE ###

a,b,c ,d = map(int,input().split())
     
print(max(a*c,b*d,b*c,a*d))
import copy
import sys
input = sys.stdin.readline
n,k = map(int, input().split())
data = []
bit_k = format(k, 'b')
len_k = len(bit_k)
for i in range(n):
    a, b = map(int, input().split())
    if a <= k:
        tmp = format(a, 'b')
        tmp = tmp.zfill(len_k)
        data.append([tmp,b])
def check_value(bit):
    res = 0
    for i in range(len(data)):
        flag = True
        dd = data[i][0]
        for j in range(len_k):
            if bit[j] == '0' and dd[j] == '1':
                flag = False
                break
        if flag:
            #print("tmp:{} bit{}".format(tmp, bit))
            res += data[i][1]
    return res
ans = 0
tmp = []
for i in range(len_k):
    p = []
    if bit_k[i] == '1':
        p = tmp + ['0'] + ['1']*(len_k-1-i)
    else:
        continue
    p = "".join(p)
    ans = max(ans, check_value(p))
    tmp += bit_k[i]
print(ans)


### FIXED CODE ###

import copy
import sys
input = sys.stdin.readline
n,k = map(int, input().split())
data = []
bit_k = format(k, 'b')
len_k = len(bit_k)
for i in range(n):
    a, b = map(int, input().split())
    if a <= k:
        tmp = format(a, 'b')
        tmp = tmp.zfill(len_k)
        data.append([tmp,b])
def check_value(bit):
    res = 0
    for i in range(len(data)):
        flag = True
        dd = data[i][0]
        for j in range(len_k):
            if bit[j] == '0' and dd[j] == '1':
                flag = False
                break
        if flag:
            #print("tmp:{} bit{}".format(tmp, bit))
            res += data[i][1]
    return res
ans = check_value(bit_k)
tmp = []
for i in range(len_k):
    p = []
    if bit_k[i] == '1':
        p = tmp + ['0'] + ['1']*(len_k-1-i)
    else:
        tmp += bit_k[i]
        continue
    p = "".join(p)
    ans = max(ans, check_value(p))
    tmp += bit_k[i]
print(ans)
n=int(input())
a=list(map(int,input().split()))
b=[]
sum_=0
for i in a:
  sum_a+=i
  b.append(sum_a)
ans=10**18
for i in range(n-1):
  ans=min(ans,abs(b[-1]-b[i]))
print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=[]
sum_=0
for i in a:
  sum_+=i
  b.append(sum_)
ans=10**18
for i in range(n-1):
  ans=min(ans,abs(b[-1]-b[i]*2))
print(ans)
# AOJ 1518: Last One
# Python3 2018.7.13 bal4u

ans = 0;
n = int(input())
for i in range(n):
	p, ms = input().split();
	ms = list(ms)
	s = 0
	for m in ms:
		if m.isdigit(): s += int(m)
		elif m.isupper(): s += ord(m)-ord('A')+10
		else: s += ord(m)-ord('a')+36
	ans ^= s
print("win" if ans else "lose")


### FIXED CODE ###

# AOJ 1518: Last One
# Python3 2018.7.13 bal4u

ans = 0;
for i in range(int(input())):
	p = input().split();
	if len(p) == 1: ms = []
	else: ms = list(p[1])
	s = 0
	for m in ms:
		if m.isdigit(): s += int(m)
		elif m.isupper(): s += ord(m)-ord('A')+10
		else: s += ord(m)-ord('a')+36
	ans ^= s
print("win" if ans else "lose")
N = int(input())
S = input()
min = N
for i in range(N-1):
    if S.find('.') == -1 or S.find('#') == -1:
        min = 0
        break
    if S[i] == '.' and S[i+1] == '#':
        left = S.count('#',0,i)
        right = S.count('.',i+1)
    elif S[i] == '#' and S[i+1] =='.':
        left = S.count('#',0,i)
        right = S.count('.',i)
    if left + right < min:
        min = left + right
print(min)

### FIXED CODE ###

N = int(input())
S = input()
min = N
clm_sum = [0]
for s in S:
    if s == '#':
        clm_sum.append(clm_sum[-1] + 1)
    else:
        clm_sum.append(clm_sum[-1])
for i in range(1,len(clm_sum)):
    if clm_sum[i-1] + ((N - i) - (clm_sum[-1] - clm_sum[i])) < min:
        min = clm_sum[i-1] + ((N - i) - (clm_sum[-1] - clm_sum[i]))
print(min)
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(A: int, B: int, K: int):

    if A <= K:
        a = 0
        b = B-(K-A)
    else:
        a = A-K
    print("{} {}".format(a, b))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, K)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(A: int, B: int, K: int):

    if A <= K:
        a = 0
        b = max(B-(K-A), 0)
    else:
        a = A-K
        b = B
    print(a, b, sep=" ")
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, K)


if __name__ == '__main__':
    main()
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

b = [list(map(int, input().split())) for _ in range(m)]
b.sort(key=lambda x: x[1], reverse=True)

x = 0
y = 0
for i in range(m):
    for j in range(b[i][0]):
        if (a[x] < b[i][1]):
            a[x] = b[i][1]
            x += 1
        else:
            y = 1
            break
    if (y==1):
        break
print(sum(a))

### FIXED CODE ###

n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

b = [list(map(int, input().split())) for _ in range(m)]
b.sort(key=lambda x: x[1], reverse=True)

x = 0
y = 0
for i in range(m):
    for j in range(b[i][0]):
        if (a[x] < b[i][1]):
            a[x] = b[i][1]
            x += 1
            if (x == n):
                y = 1
                break
        else:
            y = 1
            break
    if (y==1):
        break
print(sum(a))
import sys
input=sys.stdin.readline
input = open(sys.argv[1], "r").readline

def main():
    N = int(input())
    A = list(map(int, input().split()))
    tmp = A.copy()
    mi = -1
    for j in range(2):
        A = tmp.copy()
        s = 0
        n = 0
        if j == 0: # 偶数番目までの和が正 ⇒ A[0] を負にする
            if A[0] > 0:
                n += abs(A[0] +1)
                A[0] = -1
        else:   # 奇数番目までの和が正 ⇒ A[0] を正にする
            if A[0] < 0:
                n += abs(A[0] -1)
                A[0] = 1
        s = A[0]
#        print(A)
        for i in range(1,N):
            if s * (s+A[i]) >= 0:
                if s < 0:
                    n += abs(-s+1 -A[i])
                    A[i] = -s+1
                else:
                    n += abs(-s-1 -A[i])
                    A[i] = -s-1
            s += A[i]
        if mi == -1:
            mi = n
        else:
            mi = min(mi, n)
    print(mi)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input=sys.stdin.readline
#input = open(sys.argv[1], "r").readline

def main():
    N = int(input())
    A = list(map(int, input().split()))
    tmp = A.copy()
    mi = -1
    for j in range(2):
        A = tmp.copy()
        s = 0
        n = 0
        if j == 0: # 偶数番目までの和が正 ⇒ A[0] を負にする
            if A[0] >= 0:
                n += abs(A[0] +1)
                A[0] = -1
        else:   # 奇数番目までの和が正 ⇒ A[0] を正にする
            if A[0] <= 0:
                n += abs(A[0] -1)
                A[0] = 1
        s = A[0]
#        print(A)
        for i in range(1,N):
            if s * (s+A[i]) >= 0:
                if s < 0:
                    n += abs(-s+1 -A[i])
                    A[i] = -s+1
                else:
                    n += abs(-s-1 -A[i])
                    A[i] = -s-1
            s += A[i]
        if mi == -1:
            mi = n
        else:
            mi = min(mi, n)
    print(mi)

if __name__ == '__main__':
    main()
q=input()
x=[int(i) for i in input().split()]
cnt=input()
y=[int(i) for i in input().split()]

if max(x) >= max(y):
    MAX=max(x)
else:
    MAX=max(y)

z=[0]*MAX

print('YES')

### FIXED CODE ###


q=input()
x=[int(i) for i in input().split()]
cnt=input()
y=[int(i) for i in input().split()]

if max(x) >= max(y):
    MAX=max(x)
else:
    MAX=max(y)

dic = {}

for k in x :
    if k in dic.keys() :
        dic[k] += 1
    else :
        dic[k] = 1
    
for i in y :
    if i in dic.keys() :
        dic[i] -= 1
        if dic[i] == -1 :
            print('NO')
            exit()
    else :
        print('NO')
        exit()
print('YES')
a,b,k=[int(i) for i in input().split()]
c=list(range(a,b+1))

head=c[:k]
tail=c[::-1][:k]
d=head+tail
# e=list(set(d))
# e.sort()
# for i in e:
#     print(i)

### FIXED CODE ###

a,b,k=[int(i) for i in input().split()]

if b-a+1>=2*k:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)
else:
    for i in range(a,b+1):
        print(i)
s = input()
print('Second' if len(s) % 2 == 0 ^ s[0] != s[-1] else 'First')


### FIXED CODE ###

s = input()
print('Second' if (len(s) % 2 == 0) ^ (s[0] == s[-1]) else 'First')
import sys
sys.setrecursionlimit(1000000000000000)
def doritto(vrijednost):
    global kameni
    global memo
    if memo[vrijednost] != -1:
        return memo[vrijednost]
    if vrijednost == len(kameni) -2:
        return abs(kameni[vrijednost] - kameni[vrijednost+1])
    elif vrijednost == len(kameni) -1:
        return 0
    a = abs(kameni[vrijednost] - kameni[vrijednost+1]) + doritto(vrijednost+1)
    b = abs(kameni[vrijednost] - kameni[vrijednost+2]) + doritto(vrijednost+2)
    memo[vrijednost] = min(a,b)
    return memo[vrijednost]
N = int(input())
kameni = list(map(int,input().split()))
memo = []
for i in range(N):
    memo.append(-1)
print(doritto(0))

### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)
def doritto(vrijednost):
    global kameni
    global memo
    if memo[vrijednost] != -1:
        return memo[vrijednost]
    if vrijednost == len(kameni) -2:
        return abs(kameni[vrijednost] - kameni[vrijednost+1])
    elif vrijednost == len(kameni) -1:
        return 0
    a = abs(kameni[vrijednost] - kameni[vrijednost+1]) + doritto(vrijednost+1)
    b = abs(kameni[vrijednost] - kameni[vrijednost+2]) + doritto(vrijednost+2)
    memo[vrijednost] = min(a,b)
    return memo[vrijednost]
N = int(input())
kameni = list(map(int,input().split()))
memo = []
for i in range(N):
    memo.append(-1)
print(doritto(0))
#N = input("スライムの数 : ")
#S = input("対応する文字列 : ")
result = int(N)
for i in range(len(S) - 1):
  if S[i] == S[i + 1]:
    result -= 1
print(result)

### FIXED CODE ###

N = input("")
S = input("")
result = int(N)
for i in range(len(S) - 1):
  if S[i] == S[i + 1]:
    result -= 1
print(result)
a = [list(map(int, input().split())) for i in range(2)]

even = a[1][0::2]
odd = a[1][1::2]

evendic = {}
odddic = {}

evenmax = []
oddmax = []

ans = 0

for i in even:
    if i in evendic:
        evendic[i] += 1
    else:
        evendic[i] = 1
  
for i in odd:
    if i in odddic:
        odddic[i] += 1
    else:
        odddic[i] = 1

evennum = max(evendic.values())
oddnum = max(odddic.values())

for k, v in evendic.items():
    if v == evennum :
        evenmax.append(k)

for k, v in odddic.items():
    if v == oddnum:
        oddmax.append(k)

if evennum == oddnum:
    if len(evenmax) >= 2 or len(oddmax) >= 2:
        ans = a[0][0] - evennum * 2
    elif max(evendic.items(), key = lambda x:x[1])[0] != max(odddic.items(), key = lambda x:x[1])[0]:
        ans = a[0][0] - evennum * 2
    else:
        ans = a[0][0] - evennum - max([sorted(odddic.values())[-2], sorted(evendic.values())[-2]])

else:
    if max(evendic.items(), key = lambda x:x[1])[0] != max(odddic.items(), key = lambda x:x[1])[0]:
        ans = a[0][0] - evennum - oddnum
    else:
        if evennum > oddnum:
            ans = a[0][0] - evennum - sorted(odddic.values())[-2]
        else:
            ans = a[0][0] - oddnum - sorted(evendic.values())[-2]

    
print(ans)

### FIXED CODE ###

a = [list(map(int, input().split())) for i in range(2)]

even = a[1][0::2]
odd = a[1][1::2]

evendic = {}
odddic = {}

evenmax = []
oddmax = []

ans = 0

for i in even:
    if i in evendic:
        evendic[i] += 1
    else:
        evendic[i] = 1
  
for i in odd:
    if i in odddic:
        odddic[i] += 1
    else:
        odddic[i] = 1

evennum = max(evendic.values())
oddnum = max(odddic.values())

for k, v in evendic.items():
    if v == evennum :
        evenmax.append(k)

for k, v in odddic.items():
    if v == oddnum:
        oddmax.append(k)

if len(set(even)) == 1 and len(set(odd)) == 1:
    if even == odd:
        ans = a[0][0] // 2

elif evennum == oddnum:
    if len(evenmax) >= 2 or len(oddmax) >= 2:
        ans = a[0][0] - evennum * 2
    elif max(evendic.items(), key = lambda x:x[1])[0] != max(odddic.items(), key = lambda x:x[1])[0]:
        ans = a[0][0] - evennum * 2
    else:
        ans = a[0][0] - evennum - max([sorted(odddic.values())[-2], sorted(evendic.values())[-2]])

else:
    if max(evendic.items(), key = lambda x:x[1])[0] != max(odddic.items(), key = lambda x:x[1])[0]:
        ans = a[0][0] - evennum - oddnum
    else:
        if evennum > oddnum:
            ans = a[0][0] - evennum - sorted(odddic.values())[-2]
        else:
            ans = a[0][0] - oddnum - sorted(evendic.values())[-2]

    
print(ans)
n=int(input())
j=10201
l=[0 for i in range(x)]
for x in range(101):
  for y in range(101):
    for z in range(101):
      v=x*x+y*y+z*z+y*x+x*z+z*y
      l[v]+=1
for i in range(n+1):
  print(l[i+1]

### FIXED CODE ###

n=int(input())
j=10501
l=[0 for i in range(j)]
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      v=x*x+y*y+z*z+y*x+x*z+z*y
      if(v<j):
        l[v]+=1
for i in range(n):
  print(l[i+1])
#C_Repsept
import math
K = int(input())
if K % 7 == 0 :
    L = 9 * K / 7
else:
    L = 9 * K
X = 0
kekka = 1
total = -1
if L % 2 == 1:
    if L % 5 != 0:
        for i in range(L): 
 #           X = pow(10,i) % L
            kekka = kekka * 10 % L
            if kekka == 1:
                total = i+1
                break
# 出力
print(total)


### FIXED CODE ###

#C_Repsept
K = int(input())
if K % 7 == 0 :
    L = int( 9 * K / 7 )
else:
    L = 9 * K
X = 0
kekka = 1
total = -1
if L % 2 == 1:
    if L % 5 != 0:
        for i in range(L): 
            kekka = kekka * 10 % L
            if kekka == 1:
                total = i+1
                break
# 出力
print(total)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
  
x = int(input())
lis = make_divisors(x)
for i in range(0, len(lis)):

  for j in range(-100,100):
    if (j+lis[i])**5 -j**5 ==x:
      ans = str(j+lis[i])+' '+str(j)
      break

print(ans)

### FIXED CODE ###

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
  
x = int(input())
lis = make_divisors(x)
flg = False

for i in range(0, len(lis)):

  for j in range(-1000,1000):
    if (j+lis[i])**5 -j**5 ==x:
      ans = str(j+lis[i])+' '+str(j)
      #flg = False
      break


if flg:
  for i in range(0, len(lis)):
    for j in range(-1000,1000):
      if (j+lis[i])**5 -j**5 ==x:
        ans = str(j+lis[i])+' '+str(j)
        break

  
print(ans)
n, m = map(int, input().split(' '))
ai = list(sorted(map(int, input().split(' '))))
required_maches = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}

used_numbers = dict()

def evaluate(l):
    if l == None:
        return -9999999999999999999999999999999
    if l == []:
        return 0
    return int(''.join(reversed([str(i) for i in sorted(l)])))

min_maches = min([required_maches[x] for x in ai])
def find(matches_count_to_use):
    if matches_count_to_use not in used_numbers:
        if matches_count_to_use == 0:
            used_numbers[matches_count_to_use] = []
        elif matches_count_to_use < min_maches:
            used_numbers[matches_count_to_use] = None
        else:
            number_to_use = max(ai,
                key=lambda x: evaluate(find(matches_count_to_use - required_maches[x])))
            prev = find(matches_count_to_use - required_maches[number_to_use])
            if prev == None:
                used_numbers[matches_count_to_use] = None
            else:
                used_numbers[matches_count_to_use] = prev + [number_to_use]
    return used_numbers[matches_count_to_use]
    
print(evaluate(find(n)))

### FIXED CODE ###

n, m = map(int, input().split())
a = [int(a) for a in input().split()]    
required_matches = {
    1: 2,
    2: 5,
    3: 5,
    4: 4,
    5: 5,
    6: 6,
    7: 3,
    8: 7,
    9: 6
}

dp = [0] + [-1] * n
for used_matches in range(1, n+1):
    usable_digits = [ai for ai in a if used_matches - required_matches[ai] >= 0]
    if usable_digits != []:
        dp[used_matches] = max([dp[used_matches-required_matches[ai]]*10 + ai
            for ai in usable_digits])
print(dp[n])
import math
a, b, c = map(int, input().split())
if math.fsum(a**(1/2) + b**(1/2)) < math.fsum(c**(1/2)):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

d = c - a - b
if d**2 > 4*a*b and d > 0:
# if a + 2 * d +b - c < 1e-20:
    print("Yes")
else:
    print("No")
def read_pair():
    return map(int, input().split())

# Read graph
N, M = read_pair()
adj = [[] for i in range(N + 1)]
for i in range(M):
    x, y = read_pair()
    adj[x].append(y)

memo = [None] * (N + 1)

def longest_path(x, memo):
    if memo[x] is not None:
        return memo[x]

    result = 0
    for y in adj[x]:
        result = max(result, 1 + longest_path(y, memo))
    memo[x] = result
    return result

result = 0
for x in range(1, N + 1):
    result = max(result, longest_path(x, memo))
print(result)


### FIXED CODE ###

from collections import deque

def read_pair():
    return map(int, input().strip().split())

# Read graph
N, M = read_pair()
adj = [[] for x in range(N)]
rev = [[] for y in range(N)]

outdegree = [0] * N
for i in range(M):
    x, y = read_pair()

    # Use 0-indexed labels
    x -= 1
    y -= 1

    adj[x].append(y)
    rev[y].append(x)
    outdegree[x] += 1

maxpath = [0] * N
q = deque()

for x in range(N):
    if outdegree[x] == 0:
        q.append(x)

while q:
    x = q.popleft()
    for y in adj[x]:
        maxpath[x] = max(maxpath[x], 1 + maxpath[y])
    for z in rev[x]:
        outdegree[z] -= 1
        if outdegree[z] == 0:
            q.append(z)

print(max(maxpath))
N,X = map(int,input().split())
x = list(map(int,input().split()))

x.append(X)
x.sort()
ans = x[1]-x[0]
for i in range(1,N):
    ans = math.gcd(ans,x[i+1]-x[i])
print(ans)


### FIXED CODE ###

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
N,X = map(int,input().split())
x = list(map(int,input().split()))

x.append(X)
x.sort()
ans = x[1]-x[0]
for i in range(1,N):
    ans = gcd(ans,x[i+1]-x[i])
print(ans)