Harryxun/stf_run huggingface dataset:
import math
a, b, c, d = map(int, input().split())

lcm = (c * d) // math.gcd(c, d)

Cstart = a - (a % c) + c if a % c != 0 else a
Cend = b - (b % c)
Dstart = a - (a % d) + d if a % d != 0 else a
Dend = b - (b % d)
LCMstart = a - (a % lcm) + lcm if a % lcm != 0 else a
LCMend = b - (b % lcm)

# print(Cstart, Cend)
# print(Dstart, Dend)
# print(LCMstart, LCMend)
# print()

Ccnt, Dcnt, LCMcnt = 0, 0, 0
if Cstart <= Cend:
	Ccnt = (Cend - Cstart) // c + 1
if Dstart <= Dend:
	Dcnt = (Dend - Dstart) // d + 1
if LCMstart <= LCMend:
	LCMcnt = (LCMend - LCMstart) // lcm + 1

# print(Ccnt, Dcnt, LCMcnt)
# print((Cend - Cstart)//4, Ccnt)

print((b-a+1) - Ccnt - Dcnt + LCMcnt)

### FIXED CODE ###

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a%b)

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

if c > d:
	tmp = c
	c = d
	d = tmp
lcm = (c * d) // gcd(c, d)

Cstart = a - (a % c) + c if a % c != 0 else a
Cend = b - (b % c)
Dstart = a - (a % d) + d if a % d != 0 else a
Dend = b - (b % d)
LCMstart = a - (a % lcm) + lcm if a % lcm != 0 else a
LCMend = b - (b % lcm)

# print(Cstart, Cend)
# print(Dstart, Dend)
# print(LCMstart, LCMend)
# print()

Ccnt, Dcnt, LCMcnt = 0, 0, 0
if Cstart <= Cend:
	Ccnt = (Cend - Cstart) // c + 1
if Dstart <= Dend:
	Dcnt = (Dend - Dstart) // d + 1
if LCMstart <= LCMend:
	LCMcnt = (LCMend - LCMstart) // lcm + 1

# print(Ccnt, Dcnt, LCMcnt)
# print((Cend - Cstart)//4, Ccnt)

print((b-a+1) - Ccnt - Dcnt + LCMcnt)
n = int(input())

if(n%2 == 0):
  print(n)
else:
  t=1
  while 1:
    t+=1
    n=n＊t
    if(n%2==0):
      print(n)
      break
      

### FIXED CODE ###

#!/usr/bin/env python3

n = int(input())

if(n % 2 == 0):
    print(n)
else:
    t = 1
    while True:
        t += 1
        n = n*t
        if(n % 2 == 0):
            print(n)
            break;
k=int(input())
count=1
if k%2==0:
  print(-1)
else:
  while True:
    if a%k==0:
      print(count)
      break
    else:
      a=a*10+7
      count+=1


### FIXED CODE ###

k=int(input())
a=0
for i in range(k):
  a=(a*10+7)%k
  if a==0:
    print(i+1)
    exit()
    
print(-1)
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())

if a<b and b-a <= (v-w)*t:
    print ("YES")
else:
    print("NO")


### FIXED CODE ###

a=[]
a=input()
print('%s%s%s'%(a[0],a[1],a[2]))
import sys
def input(): return sys.stdin.readline().strip()

def main():
    A, B, C, D, E, F = map(int, input().split())
    weight = 0.1
    sugar = 0

    for p in range(F // (100 * A) + 1):
        for q in range((F - 100 * A) // (100 * B) + 1):
            upper = (A * p + B * q) * E
            water = (A * p + B * q) * 100
            if water == 0: continue
            for r in range(upper // C + 1):
                if water + r > F: continue
                s = min((upper - C * r) // D, F - (water + r))
                if s < 0: continue
                if sugar * (water + C * r + D * s) < (C * r + D * s) * weight:
                    weight = water + C * r + D * s
                    sugar = C * r + D * s
    if sugar = 0:
        print("0 0")
    else:
        print("{} {}".format(weight, sugar))

    


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()

def main():
    A, B, C, D, E, F = map(int, input().split())
    weight = 0.1
    sugar = 0

    for p in range(F // (100 * A) + 1):
        for q in range(0, (F - 100 * A * p) // (100 * B) + 1):
            upper = (A * p + B * q) * E
            water = (A * p + B * q) * 100
            if water == 0: continue
            for r in range(0, upper // C + 1):
                if water + C * r > F: continue
                s = (upper - C * r) // D
                while s >= 0 and water + C * r + D * s > F: s -= 1
                if s < 0: continue
                if sugar * (water + C * r + D * s) < (C * r + D * s) * weight:
                    weight = water + C * r + D * s
                    sugar = C * r + D * s
    if sugar == 0:
        print("{} 0".format(100 * A))
    else:
        print("{} {}".format(weight, sugar))

    


if __name__ == "__main__":
    main()
S = input()
w = int(input())
s = ''
for i in range((len(S) // w) + 1):
  s += S[i * w]
print(s)

### FIXED CODE ###

S = input()
w = int(input())
s = ''
if w == 1:
  print(S)
else:
  if len(S) % w == 0:
    for i in range(len(S) // w):
      s += S[i * w]
    print(s)
  else:
    for i in range((len(S) // w) + 1):
      s += S[i * w]
    print(s)
n=int(input())
a=26
b=1
import string
array=list(string.ascii_lowercase)
while n>a:
  b+=1
  a+=26**b
if b==1:
  print(array[n-1])
else:
  c=b-1
  d=n-26**c
  brray[0]
  crray[d]
  for i in range(c-1):
    brray[i+1]=crray[i]//(26**(c-i))
    crray[i+1]=crray[i]%(26**(c-i))
  ans=[]
  for j in range(1,c):
    ans[j]=array[brray[j]]
  ans.append(array[crray[c]-1])
  print( ''.join( ans ) )

### FIXED CODE ###

n=int(input())
a=26
b=1
import math
import string
array=list(string.ascii_lowercase)
while n>a:
  b+=1
  a+=26**b
if b==1:
  print(array[n-1])
else:
  c=b-1
  d=n-a
  brray=[0]
  crray=[d]
  for i in range(c):
    brray.append(math.ceil(crray[i]/(26**(c-i))))
    crray.append(crray[i]%(26**(c-i)))
  ans=array[brray[1]-1]
  if c>1:
    for j in range(2,b):
      ans=ans+array[brray[j]-1]
  ans=ans+array[crray[c]-1]
  print(ans)
n = int(input())
a = list(map(int, input().split()))
s = [0]
if (n == 2):
    printf(abs(a[0] - a[1]))
else:
    for i in range(n):
        s.append(a[i] + s[i])

    b = 1e+9

    for j in range(n+1):
        if (abs(s[j] - (s[n] - s[j])) < b):
            b = abs(s[j] - (s[n] - s[j]))
    print(b)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
s = [0]
if (n == 2):
    print(abs(a[0] - a[1]))
else:
    for i in range(n):
        s.append(a[i] + s[i])

    b = 1e+9
    j = 1
    
    while(j < n):
        if (abs(s[j] - (s[n] - s[j])) < b):
            b = abs(s[j] - (s[n] - s[j]))
        j += 1
    print(b)
# Import
from collections import deque

# I/O
def read(): return input()
def read_int(): return int(input())
def read_array(type=int): return list(map(type, input().split()))
def read_tupple(type=None):
    tmp = input().split()
    if type is None: return map(int, tmp)
    assert len(tmp) == len(type)
    return [type[i](tmp[i]) for i in range(len(tmp))]

# Implementation
class PrimeNumber:
    def __init__(self, N):
        self.N = N
        self.compute()

    def compute(self):
        self.isP, self.P = [True] * N+1, []
        for i in range(2,N+1):
            if self.isP[i]:
                self.P.append(i)
                for j in range(2*i,N+1,i):
                    self.isP[j] = False

N = read_int()

pn = PrimeNumber(1000006)
ans = 0
for p in pn.P:
    cnt = 0
    while N % p == 0:
        N /= p
        cnt += 1
    dec = 1
    while cnt >= dec:
        cnt -= dec
        dec += 1
        ans += 1
if N > 1:
    ans += 1
print(ans)

### FIXED CODE ###

# Import
from collections import deque

# I/O
def read(): return input()
def read_int(): return int(input())
def read_array(type=int): return list(map(type, input().split()))
def read_tupple(type=None):
    tmp = input().split()
    if type is None: return map(int, tmp)
    assert len(tmp) == len(type)
    return [type[i](tmp[i]) for i in range(len(tmp))]

# Implementation
N = read_int()

MAX_P = 1000006
isP = [True] * MAX_P
for i in range(2,MAX_P):
    if isP[i]:
        for j in range(2*i,MAX_P,i):
            isP[j] = False

P = [i for i in range(2,MAX_P) if isP[i]]
ans = 0
for p in P:
    cnt = 0
    while N % p == 0:
        N /= p
        cnt += 1
    dec = 1
    while cnt >= dec:
        cnt -= dec
        dec += 1
        ans += 1
if N > 1:
    ans += 1
print(ans)
h,w = list(map(int,input().split()))
s = []
for i in range(h):
    s.append(input())

con = []

for i in range(h):
    for j in range(i+1,h):
        ij = []
        ji = []
        for k in range(w):
            ij.append(s[i][k]+s[j][k])
            ji.append(s[j][k]+s[i][k])
        if sorted(ij) == sorted(ji):
            con.append([i,j])

rest = set()
for i in range(h):
    rest.add(i)
for x in con:
    if x[0] in rest and x[1] in rest:
        rest -= {x[0],x[1]}

if len(rest) == 0:print('YES')
elif len(rest) == 1 and [rest[0],rest[0]] in con:print('YES')
else:print('NO')


### FIXED CODE ###

H, W = map(int, input().split())
S = [input() for i in range(H)]
 
def check(l):
    u = [0]*W
    mid = W % 2
    for i in range(W):
        if u[i]:
            continue
        for j in range(i+1, W):
            for p, q in l:
                sp = S[p]; sq = S[q]
                if sp[i] != sq[j] or sp[j] != sq[i]:
                    break
            else:
                u[j] = 1
                break
        else:
            if mid:
                for p, q in l:
                    sp = S[p]; sq = S[q]
                    if sp[i] != sq[i]:
                        break
                else:
                    mid = 0
                    continue
            break
    else:
        return 1
    return 0
 
def make(c, l, u, p):
    while c in u:
        c += 1
    if c == H:
        if check(l):
            print("YES")
            exit(0)
        return
    if p:
        l.append((c, c))
        make(c+1, l, u, 0)
        l.pop()
    for i in range(c+1, H):
        if i in u:
            continue
        u.add(i)
        l.append((c, i))
        make(c+1, l, u, p)
        l.pop()
        u.remove(i)
 
make(0, [], set(), H%2)
print("NO")
import sys, math
from collections import defaultdict
from copy import deepcopy
import itertools
input = sys.stdin.readline
# 文字列の場合は普通のinput()を使うか下を使う
# input = sys.stdin.readline().rstrip()


N = int(input())
if N % 2 == 1:
    print(0)
else:
    k = N // 2
    a = int(math.log(k, 5))
    ans = 0
    for i in range(1, a + 1):
        ans += k // (5 ** i)
    print(ans)

### FIXED CODE ###

import sys
from collections import defaultdict
from copy import deepcopy
import itertools
input = sys.stdin.readline
# 文字列の場合は普通のinput()を使うか下を使う
# input = sys.stdin.readline().rstrip()


def log(k, b):
    a = 0
    while b ** a <= k:
        a += 1
    return a - 1



N = int(input())
if N % 2 == 1:
    print(0)
else:
    k = N // 2
    a = log(k, 5)
    ans = 0
    for i in range(1, a + 1):
        ans += k // (5 ** i)
    print(ans)
import math
n,a,b=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
x.reverse()

j=a+1
moto=0
h=0
d=x[a-1]
asd=0
l=x.count(d)
for i in range(a):
  moto+=x[i]
  if x[i]==x[a-1]:
    h+=1
print(moto/a)
if moto/a==x[a-1]:
  for i in range(a,b+1):
    asd+=math.factorial(l)//(math.factorial(l-i)*math.factorial(i))
  print(asd)
else:
  print(math.factorial(l)//(math.factorial(l-h)*math.factorial(h)))   

### FIXED CODE ###

import math
n,a,b=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
x.reverse()

j=a+1
moto=0
h=0
d=x[a-1]
asd=0
l=x.count(d)
for i in range(a):
  moto+=x[i]
  if x[i]==x[a-1]:
    h+=1
print(moto/a)
if moto/a==x[a-1]:
  for i in range(a,b+1):
    if l-i>=0:
      asd+=math.factorial(l)//(math.factorial(l-i)*math.factorial(i))
  print(asd)
else:
  print(math.factorial(l)//(math.factorial(l-h)*math.factorial(h)))
import collections
import math

n = int(input())
m = 0
mod = 10 ** 6 + 7
c = []
d = []
frac = {}
tmp = 0
for _ in range(n):
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        tmp += 1
        m += 1
        continue
    try:
        if a == 0:
            frac['0'] += 1
        elif b == 0:
            frac['inf'] += 1
        else:
            gcd = abs(math.gcd(a, b))
            sign = 1 if a * b > 0 else -1
            a = sign * abs(a) // gcd
            b = abs(b) // gcd
            frac['{}/{}'.format(a, b)] += 1
    except KeyError:
        if a == 0:
            frac['0'] = 1
        elif b == 0:
            frac['inf'] = 1
        else:
            gcd = abs(math.gcd(a, b))
            sign = a * b // abs(a * b)
            a = sign * abs(a) // gcd
            b = abs(b) // gcd
            frac['{}/{}'.format(a, b)] = 1

n -= tmp

def inverse(key):
    if key[0] != '-':
        a, b = key.split('/')
        return '-{}/{}'.format(b, a)
    else:
        a, b = key[1:].split('/')
        return '{}/{}'.format(b, a)

for key, value in frac.items():
    if key == '0': continue
    if key[0] == '-': continue
    try:
        if key == float('inf'):
            d.append(frac['inf'])
        else:
            d.append(frac[inverse(key)])
        c.append(value)
    except KeyError:
        continue

ans = pow(2, n - sum(c) - sum(d), mod)
for i, j in zip(c, d):
    tmp = (pow(2, i, mod) + pow(2, j, mod) - 1)
    ans = (ans * (pow(2, i, mod) + pow(2, j, mod) - 1)) % mod
ans = (ans * (m + 1) - 1) % mod

print(ans)

### FIXED CODE ###

import collections
import math

n = int(input())
m = 0
mod = 10 ** 9 + 7
c = []
d = []
frac = []

for _ in range(n):
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        n -= 1
        m += 1
        continue
    if a == 0:
        frac.append('0/1')
    elif b == 0:
        frac.append(('1/0'))
    else:
        gcd = abs(math.gcd(a, b))
        sign = 1 if a * b > 0 else -1
        a = sign * abs(a) // gcd
        b = abs(b) // gcd
        frac.append('{}/{}'.format(a, b))

frac = collections.Counter(frac)

def inverse(key):
    if key == '0/1':
        return '1/0'
    elif key == '1/0':
        return '0/1'
    elif key[0] != '-':
        a, b = key.split('/')
        return '-{}/{}'.format(b, a)
    else:
        a, b = key[1:].split('/')
        return '{}/{}'.format(b, a)

for key, value in frac.items():
    if key[0] == '-' or key[0] == '0': continue
    if frac[inverse(key)] > 0:
        c.append(value)
        d.append(frac[inverse(key)])

ans = pow(2, n - sum(c) - sum(d), mod)
for i, j in zip(c, d):
    tmp = (pow(2, i, mod) + pow(2, j, mod) - 1) % mod
    ans = ans * tmp % mod
ans = (ans - 1 + m) % mod

print(ans)
from sys import stdin                                                                                                                                                
from sys import stdout

A,B,C = stdin.readline().split()

if A%2 == 0 or B%2 == 0 or C%2 == 0 : 
        print 0
        exit()

AB = int(A) * int(B)
BC = int(C) * int(B)
AC = int(A) * int(C)
ABC = AB * int(C)

area = (AB,BC,AC).sort().reverse()[0]
print area

### FIXED CODE ###

from sys import stdin
from sys import stdout

A,B,C = stdin.readline().split()

if int(A)%2 == 0 or int(B)%2 == 0 or int(C)%2 == 0 :
        print 0
        exit()

AB = int(A) * int(B)
BC = int(C) * int(B)
AC = int(A) * int(C)
ABC = AB * int(C)

area = sorted([AB,BC,AC])[0]                                                                                                                                         
print area
s = input()

if s[0] == s[1] or s[1] == s[2] or s[2] = s[3] :
  print("Bad")
else:
  print("Good")

### FIXED CODE ###

s = input()

if s[0] == s[1] or s[1] == s[2] or s[2] == s[3] :
  print("Bad")
else:
  print("Good")
import sys
input = sys.stdin.readline
N = int(input())
A = [int(x) for x in input().split()]
import fractions
mod = 7 + 10 ** 9
lcm = int(A[0] * A[1] // fractions.gcd(A[0], A[1])) 
for i in range(2, N):
    lcm = int(lcm * A[i] // fractions.gcd(lcm, A[i]))
ans = 0
for i in A:
    ans += lcm // i
    ans %= mod
print(ans) 

### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
A = [int(x) for x in input().split()]
A = sorted(A, reverse=True)
import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
mod = 7 + 10 ** 9
lcm = lcm(*A)
ans = 0
for i in A:
    ans += lcm // i
print(ans % mod)
def swapThree(a, b, c):  
    a = a + b + c  
   
    b = a - (b+c) 
   
    c = a - (b+c) 
   
    a = a - (b+c) 
      
    print("After swapping a =",a,", b =",b,", c =",c) 
  
if __name__ == '__main__': 
    a = int(input())
    b = int(input())
    c = int(input())
  
    print("Before swapping a =",a,", b =",b,", c =",c) 
  
    swapThree(a, b, c)

### FIXED CODE ###

a,b,c = map(int, input().split())
print(c,a,b)
N,L = list(map(int,input().split()))


i = 1
taste = []

while i == N:
        taste.append(L + i - 1)
        i += 1

if L > 0 :
        print(sum(taste[1:N]))
elif L < N and N + L < 0:
        print(sum(taste[0:N-1]))
elif L <= 0 and N - L >= 0:
        print(sum(taste))


### FIXED CODE ###

A = list(map(int,input()))


if A[0] == A[1] or A[1] == A[2] or A[2] == A[3]:
        print("Bad")
else:
        print("Good")
from collections import deque

mod = 10**9+7
n, k = map(int, input().split())
edges = [[] for i in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    a-=1
    b-=1
    edges[a].append(b)
    edges[b].append(a)

start = None
for i in range(n):
    if len(edges[i]) == 1:
        start = i
        break

ans = 1
kumi = [0]*n
q = deque()
q.append((start,-1, 1, 0, 0))
while q:
    now, par, par_cnt,par2,child_cnt = q.popleft()
    a = par_cnt
    a *= k - par2 - child_cnt
    a %= mod
    cnt = 0
    for to in edges[now]:
        if to != par:
            if cnt == 0:
                q.append((to, now, a, min(par2+1, 2), 0))
            else:
                q.append((to, now, 1, min(par2+1, 2), cnt))
            cnt += 1
    if cnt == 0:
        ans *= a
        ans %= mod
print(ans)


### FIXED CODE ###

from collections import deque

mod = 10**9+7
n, k = map(int, input().split())
edges = [[] for i in range(n)]
if n == 1:
    print(k)
    exit()
for i in range(n-1):
    a, b = map(int, input().split())
    a-=1
    b-=1
    edges[a].append(b)
    edges[b].append(a)

start = None
for i in range(n):
    if len(edges[i]) == 1:
        start = i
        break

ans = 1
kumi = [0]*n
q = deque()
q.append((start,-1, 1, 0, 0))
while q:
    now, par, par_cnt,par2,child_cnt = q.popleft()
    a = par_cnt
    a *= k - par2 - child_cnt
    a %= mod
    cnt = 0
    for to in edges[now]:
        if to != par:
            if cnt == 0:
                q.append((to, now, a, min(par2+1, 2), 0))
            else:
                q.append((to, now, 1, min(par2+1, 2), cnt))
            cnt += 1
    if cnt == 0:
        ans *= a
        ans %= mod
print(ans)
# input
n, k = map(int, input().split())
A = list(map(int, input().split()))

ones = [0] * 40 # 各桁で1が立っている数
for a in A:
    for i in range(40):
        if a & (1 << k):
            ones[i] += 1

x = 0
for i in range(39, -1, -1):
    if x + (1 << k) > K:
        continue
    if ones[k] < n - ones[k]: # 1が立っている数 < 0が立っている数 -> 1を立てる
        x += (1 << k)

ans = 0
for a in A:
    ans += x ^ a

print(ans)

### FIXED CODE ###

# input
n, k = map(int, input().split())
A = list(map(int, input().split()))

ones = [0] * 40 # 各桁で1が立っている数
for a in A:
    for i in range(40):
        if a & (1 << i):
            ones[i] += 1

x = 0
for i in range(39, -1, -1):
    if x + (1 << i) > k:
        continue
    if ones[i] < n - ones[i]: # 1が立っている数 < 0が立っている数 -> 1を立てる
        x += (1 << i)

ans = 0
for a in A:
    ans += x ^ a

print(ans)
n = int(raw_input)
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format((i,j))
#discard the given cards
for i in xrange(0,n):
	a = raw_input()
	if a in lst:
		lst.remove(a)
#print the result
for i in xrange(0,len(lst)):
	print a[i]

### FIXED CODE ###

n = int(raw_input())
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format(i,j))
#discard the given cards
for i in range(n):
	a = raw_input()
	lst.remove(a)
#print the result
for i in range(len(lst)):
	print lst[i]
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    N, W = map(int, input().split())
    w = [0]
    v = [0]
    for i in range(N):
        weight, value = map(int, input().split())
        w.append(weight)
        v.append(value)

    dp = [[0] * (W + 1) for _ in range(N + 1)]



    for i in range(1, N + 1):
        for j in range(1, W + 1):
            if j - w[i] < 0:
                dp[i][j] = dp[i - 1][j]
            else:
                dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + v[i])
    # print(w, v, dp)
    print(dp[N][W])


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys

# import numpy as np

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

INF = 10 ** 18


def main():
    N, W = map(int, input().split())
    w = []
    v = []
    for i in range(N):
        weight, value = map(int, input().split())
        w.append(weight)
        v.append(value)

    """    
    dp[ i ] : 価値 i における重さの最小値
    　
    品物一つ w,v を見ていくたびに、
    dp[ i ] = (その品物を使うパターン) or (その品物を使わないパターン)
    = min( dp[i -v] + w , dp[ i ] ) 
    を更新していけばよい。
    """

    dp = [0] + [INF] * 10 ** 5

    for i in range(N):
        for j in range(10 ** 5, v[i] - 1, -1):
            dp[j] = min(dp[j - v[i]] + w[i], dp[j])

    # print(dp[:30])

    ans = 0

    for i, j in enumerate(dp):
        if j <= W:
            ans = i
    print(ans)


if __name__ == "__main__":
    main()
import math
n, x = map(int, input().split())
xl = [int(_) for _ in input().split()]
for i in range(n):
    if x > xl[i]:
        xl[i] = x - xl[i]
    else:
        xl[i] = xl[i] - x
x_gcd = xl[0]
for i in range(1, n):
    x_gcd = math.gcd(x_gcd, xl[i])
print(x_gcd)


### FIXED CODE ###

n, x = map(int, input().split())
xl = [int(_) for _ in input().split()]
for i in range(n):
    if x > xl[i]:
        xl[i] = x - xl[i]
    else:
        xl[i] = xl[i] - x


def gcd(a, b):
    if a < b:
        x_a = b
        x_b = a
    else:
        x_a = a
        x_b = b
    while(1):
        if x_a < x_b:
            tmp = x_a
            x_a = x_b
            x_b = tmp
        x_a %= x_b
        if x_a == 0:
            break
    return x_b

    
x_gcd = xl[0]
if n > 1:
    for i in range(1, n):
        x_gcd = gcd(x_gcd, xl[i])
print(x_gcd)
l = []

count = 0


for s in input():
    if s == "R":
        count += 1
    else:
        l.append(count)
        count = 0

print(max(l))


### FIXED CODE ###


flag = True
count = 0
l = []

for s in input():
    if flag:
        if s == "R":
            count += 1
            l.append(count)
        else:
            l.append(0)
            count = 0


print(max(l))
import sys
import os
import math
from functools import reduce
from fractions import gcd

def test(x,k,m):
    #print("i=",k)
    tmp=[0]*len(x)
    for j in range(m):
        tmp[j]=x[j]
    #print('a=',x)
    #print('tmp=',tmp)
    del tmp[k]
    #print('tmp=',tmp)
    #print("a==",x)
    XX=gcd(*tmp)
    #print("XX=",XX)
    return XX

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

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

yakusu=[0]*len(a)
for i in range(n):
    yakusu[i]=test(a,i,n)

ans=max(yakusu)
print(ans)

### FIXED CODE ###

a,b,t = map(int,input().split())
count=1
sum=0
while a*count < t+0.5:
    sum=sum + b
    count+=1
print(sum)
n=input()
count=0
if n.len()==1:
  count=int(n)
else:
  count+=9
  if n.len()==3:
    count+=(int(n)//100)*100+int(n)%100+1
  else:
    count+=900
    if n.len()==5:
      count+=(int(n)//10000)*10000+int(n)%10000+1


### FIXED CODE ###

n=input()
count=0
if len(n)==1:
  count=int(n)
if len(n)==2:
  count+=9
if len(n)==3:
    count+=(int(n)//100-1)*100+int(n)%100+10
if len(n)==4:
    count+=909
if len(n)==5:
      count+=(int(n)//10000-1)*10000+int(n)%10000+910
if len(n)==6:
      count+=90909
print(count)