Harryxun/stf_run huggingface dataset:
import math
n, X = map(int, input().split(' '))
x = list(map(int, input().split(' ')))
x = [abs(X-i) for i in x]
c = x[0]
for i in range(1, n):
    c = math.gcd(c, x[i])

print(c)

### FIXED CODE ###

n, X = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x = sorted(x)
y = [x[i+1]-x[i] for i in range(n)]

def eu(a, b):
    a, b = sorted([a,b])
    while a != 0:
        b, a = a, b%a
    return b
d = y[0]
for i in range(1, n):
    d = eu(d, y[i])
print(d)
nums = input().split(' ')
product = int(nums[0]) * int(num[1])
if product % 2 == 0:
  print(Even)
else:
  print(Odd)

### FIXED CODE ###

nums = input().split(' ')
product = int(nums[0]) * int(nums[1])
if product % 2 == 0:
    print('Even')
else:
    print('Odd')
import sys

def main():
    N = int(input())
    A = list(map(int, input().split()))

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 1:
                break
                 sys.exit
            else:
                A[i] = A[i]/2
                
        t += 1

main()

### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
import sys

N, M = map(int, input().split())
ab = (tuple(map(int, line.split())) for line in sys.stdin.readlines())
ab.sort(key = lambda x : x[1])

ans = 0
last = -1
for a, b in ab:
    if a < last:
        continue
    else:
        ans += 1
        last = b

print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(M)]
ab.sort(key = lambda x : x[1])

ans = 0
last = -1
for abTemp in ab:
    if abTemp[0] < last:
        continue
    else:
        ans += 1
        last = abTemp[1]

print(ans)
A,B  =map(int,input().split())
K = 50
S = [['.']*(2*K) for _ in range(2*K)]
for i in range(K):
    for j in range(2*K):
        S[i][j] ='#'
i,j = 0,0
A-=1
B-=1
while A>0:
    S[i][j] ='.'
    if j +2 <2*K:
        j +=2
    else:
        i += 1
    A-=1
i,j = 2*K-1,2*K-1
while B>0:
    S[i][j]='#'
    if j-2>0:
        j-=2
    else:
        i-=1
    B-=1
for s in S:
    print(''.join(s))

### FIXED CODE ###

A,B  =map(int,input().split())
K = 50
S = [['.']*(2*K) for _ in range(2*K)]
for i in range(K):
    for j in range(2*K):
        S[i][j] ='#'
i,j = 0,0
A-=1
B-=1
while A>0:
    S[i][j] ='.'
    if j +2 <2*K:
        j +=2
    else:
        i += 2
        j=0
    A-=1
i,j = 2*K-1,2*K-1
while B>0:
    S[i][j]='#'
    if j-2>0:
        j-=2
    else:
        i-=2
        j=2*K-1
    B-=1
print(str(2*K)+' '+str(2*K))
for s in S:
    print(''.join(s))
n,a,b,c,d = map(int,input().split())
s = input()
s = s + "."
cant = 0
sanrenzoku = 0
for i in range(a-1,max(c-1,d-1)):
    if s[i] == "#":
        if s[i+1] == "#":
            cant = 1

if c > d:
    for i in range(b-2,d-1)
    if s[i] == ".":
        if s[i+1] == ".":
            if s[i+2] == ".":
                if i > b-2:
                    if i < d:
                        sanrenzoku = 1

if cant == 1:
    print("No")
elif c > d:
    if sanrenzoku == 0:
        print("No")
    else:
        print("Yes")
else:
    print("Yes")

### FIXED CODE ###


n,a,b,c,d = map(int,input().split())
s = input()
s = s + "."
cant = 0
sanrenzoku = 0
for i in range(a-1,max(c-1,d-1)):
    if s[i] == "#":
        if s[i+1] == "#":
            cant = 1

if c > d:
    for i in range(b-2,d-1):
        if s[i] == ".":
            if s[i+1] == ".":
                if s[i+2] == ".":
                   sanrenzoku = 1

if cant == 1:
    print("No")
elif c > d:
    if sanrenzoku == 0:
        print("No")
    else:
        print("Yes")
else:
    print("Yes")
n,m=map(int,input().split())
AB=[]
append=AB.append
for i in range(m):
  a,b=map(int,input().split())
  append([ra,b])
AB.sort(key=lambda x:x[1])
c,ans=0,0
for a,b in AB:
  if a>=c:
    ans+=1
    c=b
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
AB=[]
append=AB.append
for i in range(m):
  a,b=map(int,input().split())
  append([a,b])
AB.sort(key=lambda x:x[1])
c,ans=0,0
for a,b in AB:
  if a>=c:
    ans+=1
    c=b
print(ans)
N, M = map(int, input().split())
L = []
R = []
D = []
for i in range(M):
    l, r, d = map(int, input().split())
    L.append(l)
    R.append(r)
    D.append(d)

inf = float("inf")


class WDG():  # 重み付き有向グラフ(隣接リスト表現)
    class node():
        def __init__(self, index=0, weight=0, next=None):
            self.index = index
            self.weight = weight
            self.next = next

    def __init__(self, N, M, L, R, D):
        self.heads = []
        self.x = [None] * N
        self.N = N
        for i in range(N):
            head = WDG.node()
            head.next = head
            head.index = i
            self.heads.append(head)
        for i in range(M):
            new1 = WDG.node(R[i] - 1, D[i], head)
            new2 = WDG.node(L[i] - 1, -D[i], head)
            self.insert(L[i] - 1, new1)
            self.insert(R[i] - 1, new2)

    def insert(self, start, new):
        new.next = self.heads[start].next
        self.heads[start].next = new

    def show_graph(self):
        for i in self.heads:
            node = i.next
            print("{}=>".format(i.index + 1), end="")
            while node != i:
                print("{}({})".format(node.index + 1, node.weight), end=" ")
                node = node.next
            print("")

    def _DFS(self, s_head):  # 始点sから到達できる連結成分を深さ優先探索
        node = s_head.next
        while node != s_head:
            new_x = self.x[s_head.index] + node.weight
            if self.x[node.index] is None:
                #print("node{}".format(node.index + 1))
                self.x[node.index] = new_x
                if not self._DFS(self.heads[node.index]):
                    return False
            elif self.x[node.index] != new_x:
                #print("node{}NG".format(node.index + 1))
                return Falses
            node = node.next
        return True

    def DFS(self):  # すべての点を訪れるまで深さ優先探索
        for i in range(self.N):
            node = self.heads[i]
            if self.x[node.index] is None:
                self.x[node.index] = 0
                if not self._DFS(self.heads[node.index]):
                    return "No"
        return "Yes"


G = WDG(N, M, L, R, D)
# G.show_graph()
print(G.DFS())


### FIXED CODE ###

from collections import deque
N, M = map(int, input().split())
G = [[] for _ in range(N)]
for i in range(M):
    l, r, d = map(int, input().split())
    G[l - 1].append((r - 1, d))
    G[r - 1].append((l - 1, -d))
q = deque()

x = [None] * N


def _BFS(start):
    q.append(start)
    while len(q) != 0:
        p = q.popleft()
        for index, d in G[p]:
            if x[index] is None:
                x[index] = x[p] + d
                q.append(index)
            elif x[index] != x[p] + d:
                return False
    return True


def BFS():
    for i in range(N):
        if x[i] is None:
            x[i] = 0
            if not _BFS(i):
                return "No"
    return "Yes"


print(BFS())
import itertools

N, Y = (int(x) for x in input().split())
for x, y in itertools.product(range(N+1), range(N+1)):
  z = N - x - y
  if 0 <= z and 10000*x + 5000*y + 1000*z == Y:
    print('{} {} {}'.format(x, y, z))
    break

if not(x + y + z == N and 10000*x + 5000*y + 1000*z == Y):      
  print('-1 -1 -1')

### FIXED CODE ###

S = input()
print('2018'+S[4:])
from functools import lru_cache


N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

mod = 10 ** 9 + 7

i = 0
b = []
for ai in a:
    b.append(ai - i)
    i = ai + 1
b.append(N + 1 - i)


@lru_cache(maxsize=None)
def f(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return f(n - 2) + f(n - 1)


ans = 1
for bi in b:
    ans *= f(bi)
print(ans % mod)


### FIXED CODE ###

import sys
from functools import lru_cache

sys.setrecursionlimit(1000000)

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

mod = 10**9 + 7

i = 0
b = []
for ai in a:
    b.append(ai - i)
    i = ai + 1
b.append(N + 1 - i)


@lru_cache(maxsize=None)
def f(n):
    if n < 2:
        return n
    else:
        return f(n - 2) + f(n - 1)


ans = 1
for bi in b:
    ans *= f(bi) % mod
print(ans % mod)
n=int(input(""))
a=[]
b=[]
for i in range(n):
    cc=input("").split(" ")
    a+=[int(cc[i])]
    b+=[int(cc[i])]
s=0
a.sort()
b.sort()
if (n%2==0):
    s=(a[n/2]+a[n/2-1]-b[n/2]-b[n/2-1])/2
else:
    s=a[(n+1)/2]-b[(n+1)/2]
print(s+1)

### FIXED CODE ###

n=int(input(""))
a=[]
b=[]
for i in range(n):
    cc=input("").split(" ")
    a+=[int(cc[0])]
    b+=[int(cc[1])]
s=0
a.sort()
b.sort()
if (n%2==0):
    s=(a[int(n/2)]+a[int(n/2)-1]-b[int(n/2)]-b[int(n/2)-1])
else:
    s=a[int((n-1)/2)]-b[int((n-1)/2)]
print(int(-s+1))
S = list(input())
cnt = 0
for i in S:
    if i == '+':
        cnt += 1
    else:
        cnt -= 1
@rint(cnt)

### FIXED CODE ###

S = list(input())
cnt = 0
for i in S:
    if i == '+':
        cnt += 1
    else:
        cnt -= 1
print(cnt)
n, m = [int(i) for i in input().split(" ")]
e = []
par = [i for i in range(0, n + 1)]
count = [1] * (n + 1)
unu = [0] * (n + 1)

for i in range(0, m):
    e.append([int(j) for j in input().split(" ")])

def root(x):
    if par[x] == x:
        return x
    else:
        r = root(par[x])
        par[x] = r
        return r

def unite(x, y, e):
    x = root(x)
    y = root(y)
    if x == y:
        return
    else:
        unu[e] = count[x] * count[y]
        count[y] += count[x]
        par[x] = y

for i in reversed(range(0, m)):
    unite(e[i][0], e[i][1], i)

s = 0
for i in range(0, m):
    s += unu[i]
    print(s)

### FIXED CODE ###

import sys

n, m = [int(i) for i in input().split(" ")]
e = []
par = [i for i in range(0, n + 1)]
count = [1] * (n + 1)
unu = [0] * m

sys.setrecursionlimit(10**6)

for i in range(0, m):
    e.append([int(j) for j in input().split(" ")])

def root(x):
    if par[x] == x:
        return x
    else:
        r = root(par[x])
        par[x] = r
        return r

def unite(x, y, e):
    x = root(x)
    y = root(y)
    if x == y:
        return
    else:
        unu[e] = count[x] * count[y]
        count[y] += count[x]
        par[x] = y

for i in reversed(range(0, m)):
    unite(e[i][0], e[i][1], i)

s = 0
for i in range(0, m):
    s += unu[i]
    print(s)
N = int(input())
A = list(map(int, input().split()))
dct = {}
for i in range(10**5):
  dct[i] = 0
for i in A:
  dct[i-1] += 1
  dct[i] += 1
  dct[i+1] += 1

sorted_dct = sorted(dct.items(), key=lambda x:-x[1])
print(sorted_dct[0][1])

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
dct = {}
for i in range(-1,10**5+1):
  dct[i] = 0
for i in A:
  dct[i-1] += 1
  dct[i] += 1
  dct[i+1] += 1

sorted_dct = sorted(dct.items(), key=lambda x:-x[1])
print(sorted_dct[0][1])
import numpy as np
a = [list(input()) for i in range(3)]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]

ans = 'No'
def check(a,b):
    return set(a).issubset(b)

for i in range(3):
    if check(a[j*3:j*3+2],b) or check(a[j:j+6:3],b) or check(a[0:8:4],b) or check(a[2:6:2],b):
        ans = 'Yes'

print(ans)

### FIXED CODE ###

# ABC157 B
import numpy as np
a = [[input().split() for l in range(3)]]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]
ans = 'No'

def check(a,b):
    return set(a).issubset(b)

for i in range(3):
    if check(a[i*3:(i*3)+3],b) or check(a[i:i+7:3],b) or check(a[0:9:4],b) or check(a[2:7:2],b):
        ans = 'Yes'

print(ans)
# -*- config: utg-8 -*-

n = int(input())
s = [input() for i in range(n)]

sort_list = []

for i in s:
	str_sort_list = sorted(i)
	new_str = ''.join(str_sort_list)
	sort_list.append(new_str)

count = 0
for i in sort_list:
  hoge = sort_list.pop(0)
  chohuku_count = sort_list.count(hoge)
  sort_list.remove(hoge)
  
  sum = 0
  for i in range(chohuku_count+1):
    sum += i
  count += chohuku_count
  

print(count)

### FIXED CODE ###

import collections
N = (int(input()))

ans = 0
counter_list = []

for _ in range(N):
    s = input()
    counter_list.append("".join(sorted(s)))

ans = 0
wordcount = {}
for word in counter_list:
    if word in wordcount:
        wordcount[word] += 1
        ans += (wordcount[word])
    else:
        wordcount[word] = 0

print(ans)
inport math
n = int(input())
print (math.ceil(n/2)/n)

### FIXED CODE ###

import math
n = int(input())
print(math.ceil(n/2)/n)
n = input()
A = map(int, raw_input().split())
m = input()

def solve(i,j):
  if m == 0:
    return 1
  if i >= n:
    return 0
  res = solve(i + 1, m) or solve(i + 1, m - A[i])
for k in range(n)
  if solve(0,m):
    print 'Yes'
  else:
    print 'No'

### FIXED CODE ###

num_n = int(input())
n = map(int, raw_input().split())
num_m = int(input())
m = map(int, raw_input().split())
     
def solve(i, m):
   if m == 0:
      return True
   if i >= num_n or m > sum(n):
      return False
   res = solve(i + 1, m) or solve(i + 1,m - n[i])
   return res
      
for k in range(num_m):
   if solve(0, m[k]):
      print "yes"
   else:
      print "no"
import copy
L = list(map(int, input().split())) # N, M, K=map(int,input().split())
N=L[0]
M=L[1]
K=L[2]
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = 0
b = 0
p=N
q=M
for i in range(N):
    a=a+A[i]
    if a>K:
        a=a-A[i]
        p=i
        break
if a<K:
    X=K-a
    for j in range(M):
        b=b+B[j]
        if b>X:
            b=b-B[j]
            q=j
            break
c=a+b
count=p+q
F=[p+q]
u=0
for i in range(p):
    u=0
    c=c-A[p-i-1]
    count=count-1
    for j in range(M-q):
        c=c+B[q+j]
        if K<c:
            c=c-B[q]
            F.append(copy.copy(count))
            u=1
            break
        else:
            count=count+1
            q=q+1
    if u==0:
        F.append(copy.copy(count))
        break
print(max(F))

### FIXED CODE ###

N, M, K=map(int,input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
LA = [0]
LB = [0]
for i in range(N):
    C=LA[i]+A[i]
    if C>K:
        N=i
        break
    else:
        LA.append(C)
for j in range(M):
    C=LB[j]+B[j]
    if C>K:
        M=j
        break
    else:
        LB.append(C)
r=N
for i in range(N+1):
    u=0
    for j in range(r-N+i,M+1):
        if LA[N-i]+LB[j]>K:
            r=max(r,N-i+j-1) # 最大のrを求めたいので結果をrefineする場合だけで回す
            u=1
            break
    if u==0:
        r=max(r,N-i+M)
        break
print(r)
n = int(input())
v_lst = list(map(int,input().split()))
c_lst = list(map(int,input().split()))
ans_lst = []


for i in range(n):
    ans_lst.append(v_lst[i]-c_lst[i])
ans_lst.sort(reverse=True)

ans = 0
i = 0
while(ans_lst[i] > 0):
    ans += ans_lst[i]
    i += 1

print(ans)


### FIXED CODE ###

n = int(input())
v_lst = list(map(int,input().split()))
c_lst = list(map(int,input().split()))
ans_lst = []


for i in range(n):
    ans_lst.append(v_lst[i]-c_lst[i])
ans_lst.sort(reverse=True)

ans = 0
for a in ans_lst:
    if a > 0:
        ans += a

print(ans)
s = s0 = input()
d = {chr(c) for c in range(97, 123)}
for c in s:
    d.remove(c)
if d:
    s += min(d)
else:
    for c in reversed(s):
        s = s[:-1]
        if d and c < min(d):
            s += min(d)
            break
        d.add(c)
print(s if s else -1)
assert s0 < s


### FIXED CODE ###

s = s0 = input()
d = {chr(c) for c in range(97, 123)}
for c in s:
    d.remove(c)
if d:
    s += min(d)
else:
    for c in reversed(s):
        s = s[:-1]
        if d and any(c < e for e in d):
            s += min(e for e in d if c < e)
            break
        d.add(c)
print(s if s else -1)
if s:
    assert s0 < s
There is an N-car train.

You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."

### FIXED CODE ###

n, i = map(int, input().split())
print(n-i+1)
from fraction import gcd
def main(): #startline-------------------------------------------
    k = int(input())
    ans = 0
    for i in range(1,k+1):
        for j in range(1,k+1):
            for l in range(1,k+1):
                ans += gcd(gcd(i,j),l)

    print(ans)
if __name__ == "__main__":
    main() #endline===============================================

### FIXED CODE ###

from math import gcd
def main(): #startline-------------------------------------------
    k = int(input())
    ans = 0
    for i in range(1,k+1):
        for j in range(1,k+1):
            for l in range(1,k+1):
                ans += gcd(gcd(i,j),l)

    print(ans)
if __name__ == "__main__":
    main() #endline===============================================
n,a,b = list(map(int, input().split()))
divisor = 10 ** 9 + 7

dp = [-1] * (n+1)
total = 0

for i in range(0, n+1):
    if(i > 0):
        dp[i] = (i * dp[i - 1]) % divisor
    else:
        dp[0] = 1

def factorial(n):
    return dp[n]

if n > 2:
    for i in range(1, n+1):
        if(i != a and i != b):
            total += dp[n] // (dp[i] * dp[n-i])

else:
    print(0)
    

print(total)

### FIXED CODE ###

n, a, b = list(map(int, input().split()))
p = (10 ** 9) + 7

def powmod(x, exp, mod):
    if(exp == 1):
        return x % mod

    if(exp % 2 == 1):
        return (x * powmod(x, exp - 1, mod)) % mod

    x = powmod(x, exp / 2, mod)

    return (x * x) % mod

# nCrを計算するが、nもrも巨大なためフェルマーの小定理を利用する
# x = nPr
# y = r!
# x / y ≡ x * y^-1
# p を法とした時、掛けるたびにmodをとった数同士の割り算はうまくいかない
# フェルマーの小定理から
# y^(p-1) ≡ 1
# y * y^(p-2) ≡ 1
# y^(p-2)がyの逆元と同じ振る舞いをするのでy^(p-2)を掛ける
def combination(n, r, mod):
    x = 1
    y = 1

    for i in range(r):
        x *= n - i # n * (n - 1) * (n - 2) * ... * (n - i + 1)
        x %= mod
        y *= i + 1 # r * (r - 1) * (r - 2) * ... * 2 * 1 を逆さまにかけていく
        y %= mod

    return x * powmod(y, mod - 2, mod) % mod


total = powmod(2, n, p) - 1 #1本も花を選ばないパターンは除外する
comb_a = combination(n, a, p)
comb_b = combination(n, b, p)


print((total - comb_a - comb_b) % p)
s = input()
rs = reversed(s)
count = 0

for i in range((len(s) // 2):
    if s[i] != rs[i]:
        count += 1
print(count)

### FIXED CODE ###

s = input()

a = len(s) // 2
count = 0

for i in range(a):
    if s[i] != s[-(i+1)]:
        count += 1
            
print(count)
n = int(input())
a = map(int,input().split())
b = map(int,input().split())



c = [0]*n
for i in range(n):
    if  i > 0 and b[i - 1] > a[i] + a[i - 1]:
        c[i] = min(a[i] + a[i + 1] + a[i - 1] - c[i - 1], b[i])
    else:
        c[i] = min(a[i] + a[i + 1], b[i])

print(sum(c))

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
cnt = 0
for i in range(n):
  c = min(a[i] + a[i+1],b[i])
  if b[i] > a[i]:
    a[i+1] = a[i] + a[i+1] - c
  cnt += c
print(cnt)
def resolve():
    import numpy as np
    N = int(input())
    A = np.array([list(map(int, input().split())) for __ in range(N)])
    l = A[np.argsort(A[:, 1])]

    t = 0
    for i in l:
        t += i[0]
        if t > i[1]:
            print('No')
            return
    print('Yes')

resolve()

### FIXED CODE ###

def resolve():
    import numpy as np
    N = int(input())
    A = np.array([list(map(int, input().split())) for __ in range(N)])
    l = A[np.argsort(A[:, 1])]

    t = 0
    for i in l:
        t += i[0]
        if t > i[1]:
            print('No')
            return
    print('Yes')

resolve()
n=int(input())
if n%2=0:
  print(1/2)
else:
  print((n+1)/(2*n))


### FIXED CODE ###

n=int(input())
if n%2==0:
  print(0.5)
else:
  print((n+1)/(2*n))
S = input()

if int(S[0:2])<=12 and int(S[0:2])!=0:
    if int(S[2:4])<=12 and int(S[2:4])!=0:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if int(S[2:4])<=12 and int(S[2:4])!=0:
        print('YYMM')
    else:
        print('NA')

### FIXED CODE ###

S = input()

if int(S[0:2])<=12 and int(S[0:2])!=0:
    if int(S[2:4])<=12 and int(S[2:4])!=0:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if int(S[2:4])<=12 and int(S[2:4])!=0:
        print('YYMM')
    else:
        print('NA')
def main():
	n, q = map(int, input().split())
	s = f".{input()}."
	pm = [input().split() for _ in range(q)]

	def is_outside(x:int) -> int:
		for point, move in pm:
			if s[x] == point:
				if move == "L":
					x -= 1
				else:
					x += 1
			if x == 0:
				return -1
			if x == n+1:
				return 1
		return 0

	ok, ng = 0, n+1
	while ng - ok > 1:
		mid = (ng + ok) >> 1
		if is_outside(mid) == -1:
			ok = mid
		else:
			ng = mid
	l = ok

	ng, ok = 0, n+1
	while ok - ng > 1:
		mid = (ng + ok) >> 1
		if is_outside(mid) == 1:
			ok = mid
		else:
			ng = mid
	r = ng

	print(max(r-l, 0))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
	n, q = map(int, input().split())
	s = "."+input()+"."
	pm = [input().split() for _ in range(q)]

	def is_outside(x:int) -> int:
		for point, move in pm:
			if s[x] == point:
				if move == "L":
					x -= 1
				else:
					x += 1
			if x == 0:
				return -1
			if x == n+1:
				return 1
		return 0

	ok, ng = 0, n+1
	while ng - ok > 1:
		mid = (ng + ok) >> 1
		if is_outside(mid) == -1:
			ok = mid
		else:
			ng = mid
	l = ok

	ng, ok = 0, n+1
	while ok - ng > 1:
		mid = (ng + ok) >> 1
		if is_outside(mid) == 1:
			ok = mid
		else:
			ng = mid
	r = ng

	print(max(r-l, 0))

if __name__ == '__main__':
    main()
L = list(map(int,input().split()))
K = int(input())
max = max(L)
print(L-max + max* (2 ** k))


### FIXED CODE ###

L = [list(map(int,input().split()))]
K = int(input())
import copy

def peice_double(L):
    l = []
    for x in L:
        tmp = copy.copy(x)
        for i in range(3):
            tmp[i] = tmp[i] * 2
            l.append(copy.copy(tmp))
            tmp[i] = tmp[i] // 2
    return l
for i in range(K):
    L = peice_double(L)
ans = 0
for x in L:
    ans = max(ans, sum(x))
print(ans)
a = list(map(int,input().split()))

k = 0
ans = 0
for i in range(N):
    k += a[i]
find = k/N
now = 1000000
for i in range(N):
    if abs(a[i]-find) < now - 0.00001:
        ans = i
        now = abs(a[i]-find)
print(ans)

### FIXED CODE ###

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

k = 0
ans = 0
for i in range(N):
    k += a[i]
find = k/N
now = 1000000
for i in range(N):
    if abs(a[i]-find) < now - 0.00001:
        ans = i
        now = abs(a[i]-find)
print(ans)
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math

l = map(int, raw_input().split())
A = map(int, raw_input().split())

sm = l[2]
la = l[2]
while(True):
    sm = sm - 1
    la = la + 1
    if sm in A and la in A:
    	ix = A.index(sm) + A.index(la)
        ix = ix / 2 + 0.5
        break
    if sm in A:
        ix = A.index(sm)
	break
    if la in A:
	ix = A.index(la)
	break
    if sm = 0:
        print 0
    if la = l[0]:
        print 0
M = l[1] - ix - 1
if M > ix:
    print int(math.ceil(ix))
else:
    print int(math.ceil(M))


### FIXED CODE ###

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

import math

l = map(int, raw_input().split())
A = map(int, raw_input().split())

sm = l[2]
la = l[2]
while(True):
    if sm == 0:
        print 0
    if la == l[0]:
        print 0
    sm = sm - 1
    la = la + 1
    if sm in A and la in A:
    	ix = A.index(sm) + A.index(la)
        ix = ix / 2 + 0.5
        break
    if sm in A:
        ix = A.index(sm) + 0.5
	break
    if la in A:
	ix = A.index(la) - 0.5
	break
M = l[1] - ix - 1
if M > ix:
    print int(math.ceil(ix))
else:
    print int(math.ceil(M))
S=input()
if S[0]==S[1] or S[1]==S[2] or S[3]==S[4]:
    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')
N, A, B = map(int, input().split())
elif (B - A) % 2 == 0:
  print('Alice')
else:
  print('Borys')


### FIXED CODE ###

N, A, B = map(int, input().split())
if (B - A) % 2 == 0:
  print('Alice')
else:
  print('Borys')