Harryxun/stf_run huggingface dataset:
import bisect

#%%
a,b,q = map(int, input().split())
INF = 10**18
shrines = [-INF] + [int(input() for _ in range(a))] + [INF]
temples = [-INF] + [int(input() for _ in range(b))] + [INF]

for _ in range(q):

    start = int(input())

    # スタート位置より右にある神社のうち、もっともスタート位置に近いもの
    shrine_east = shrines[bisect.bisect_right(shrines, start)]
    # スタート位置より右にある寺のうち、もっともスタート位置に近いもの
    temple_east = temples[bisect.bisect_right(temples, start)]

    # スタート位置より左にある神社のうち、もっともスタート位置に近いもの
    shrine_west = shirines[bisect.bisect_right(shrines, start) - 1]
    # スタート位置より左にある寺のうち、もっともスタート位置に近いもの
    temple_west = temples[bisect.bisect_right(temples, start) - 1]

    ans = INF

    for shrine in [shrine_east, shrine_west]:
        for temple in [temple_east,temple_west]:
            cur = min(abs(shrine-start), abs(temple-start)) + abs(shrine-temple)
            ans = min(ans,cur)

    print(ans)


### FIXED CODE ###

#%%
import bisect

#%%
a,b,q = map(int, input().split())
INF = 10**18
shrines = [-INF] + [int(input()) for _ in range(a)] + [INF]
temples = [-INF] + [int(input()) for _ in range(b)] + [INF]

for _ in range(q):

    start = int(input())

    # スタート位置より右にある神社のうち、もっともスタート位置に近いもの
    shrine_east = shrines[bisect.bisect_right(shrines, start)]
    # スタート位置より右にある寺のうち、もっともスタート位置に近いもの
    temple_east = temples[bisect.bisect_right(temples, start)]

    # スタート位置より左にある神社のうち、もっともスタート位置に近いもの
    shrine_west = shrines[bisect.bisect_right(shrines, start) - 1]
    # スタート位置より左にある寺のうち、もっともスタート位置に近いもの
    temple_west = temples[bisect.bisect_right(temples, start) - 1]

    ans = INF

    for shrine in [shrine_east, shrine_west]:
        for temple in [temple_east,temple_west]:
            cur = min(abs(shrine-start), abs(temple-start)) + abs(shrine-temple)
            ans = min(ans,cur)

    print(ans)
import math
from functools import reduce
def main():
    N, X = map(int, input().split())
    x = list(map(int, input().split()))
    x.sort()
    l = []
    for i in range(N-1):
        l.append(x[i+1]-x[i])
    print(reduce(math.gcd, l))
main()


### FIXED CODE ###

import fractions
from functools import reduce
def main():
    N, X = map(int, input().split())
    x = list(map(int, input().split()))
    x.append(X)
    x.sort()
    l = []
    for i in range(N):
        l.append(x[i+1]-x[i])
    print(reduce(fractions.gcd, l))
main()
input_string = input()
while n < len(input_string):
  if n == '7':
    print('Yes')
    n += 1
    break
  

### FIXED CODE ###

input_string = input()
yes = 0
for n in input_string:
  if n == '7':
    print('Yes')
    yes = 1
    break
if not yes:
  print('No')
def resolve():
    lines = sys.stdin.readlines()

    n, m, k = tuple(map(int, lines[0].strip().split(' ')))
    A = list(map(int, lines[1].strip().split(' ')))
    B = list(map(int, lines[2].strip().split(' ')))

    a = [0]
    b = [0]

    for i in range(n):
        a.append(a[i] + A[i])
    for i in range(m):
        b.append(b[i] + B[i])

    res = 0
    j = m
    for i in range(n+1):
        if a[i] > k:
            break
        while a[i] + b[j] > k:
            j -= 1
        res = max(res, i+j)
    print(res)

resolve()

### FIXED CODE ###

import sys

def resolve():
    lines = sys.stdin.readlines()

    n, m, k = tuple(map(int, lines[0].strip().split(' ')))
    A = list(map(int, lines[1].strip().split(' ')))
    B = list(map(int, lines[2].strip().split(' ')))

    a = [0]
    b = [0]

    for i in range(n):
        a.append(a[i] + A[i])
    for i in range(m):
        b.append(b[i] + B[i])

    res = 0
    j = m
    for i in range(n+1):
        if a[i] > k:
            break
        while a[i] + b[j] > k:
            j -= 1
        res = max(res, i+j)
    print(res)

resolve()
N = int(input())
list=[]
for i in range(1, N+1):
    for j in range(2, N):
        tmp = i ** j
        if tmp <= N:
            list.append(tmp)
        else:
            break

print(max(list))



### FIXED CODE ###

N = int(input())
list=[]
for i in range(1, N+1):
    for j in range(2, N + 2):
        tmp = i ** j
        if tmp <= N:
            list.append(tmp)
        else:
            break

print(max(list))
a,b,c = map(int,input())
if a+b+c <= 21:
  print("win")
else:
  print("bust")

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b+c <= 21:
  print("win")
else:
  print("bust")
n=int(input())
for nn in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=list(map(float,input().split()))
    if x1==x2 and x3==x4:
        print("YES")
    else:
        if (y2-y1)/(x2-x1)==(y4-y3)/(x4-x3):
            print("YES")
        else:
            print("NO")


### FIXED CODE ###

n=int(input())
for nn in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=list(map(float,input().split()))
    if x2-x1==0 or x4-x3==0:
        if x1==x2 and x3==x4:
            print("YES")
        else:
            print("NO")
    else:
        if abs((y2-y1)/(x2-x1)-(y4-y3)/(x4-x3))<10**-10:
            print("YES")
        else:
            print("NO")
def era(M):
    p = [1] * M
    p[0] = p[1] = 0
    for x in range(2, int(~-M**.5) + 1):
        if p[x]:
            for y in range(x*x, M, x):
                p[y] = 0
    return p
INF = 10**5 + 1
E = erat(INF)
Q = [0] * INF
from itertools import*
for i in range(INF):
    q[i] = i%2 * p[i] * p[-~i//2]
*a, = accumulate([0] + q)
for _ in [None] * int(input()):
    l, r = map(int, input().split())
    print(a[-~r] - a[l])

### FIXED CODE ###

#!/usr/bin/env python3
from itertools import accumulate
def erat(m):
    p = [1] * m
    p[0] = p[1] = 0
    for x in range(2, int((~-m)**.5) + 1):
        if p[x]:
            for y in range(x*x, m, x):
                p[y] = 0
    return p

INF = 10**5 + 1
p = erat(INF)
q = [0] * INF
for n in range(INF):
    q[n] = n%2 * p[n] * p[-~n//2]
*a, = accumulate([0] + q)
for _ in [None] * int(input()):
    l, r = map(int, input().split())
    print(a[r + 1] - a[l])
a,b,x=map(int,input().split())
import math
if a*a*b/2==x:
  c=math.pi/2
elif a*a*b/2>=x:
  c=math.atan((2*x)/(a*b*b))
else:
  c=math.atan(a**3/(2*a*a*b-2*x))
d=math.degrees(c)
print(90-d)

### FIXED CODE ###

a,b,x=map(int,input().split())
import math
if a*a*b==x:
  c=math.pi/2
elif a*a*b/2>=x:
  c=math.atan((2*x)/(a*b*b))
else:
  c=math.atan(a**3/(2*a*a*b-2*x))
d=math.degrees(c)
print(90-d)
N=int(input())
s = [input() for i in range(N)]

print('AC x '+'s.count('AC')')
print('WA x '+'s.count('WA')')
print('TLE x '+'s.count('TLE')')
print('RE x '+'s.count('RE')')


### FIXED CODE ###

N=int(input())
s=[]
for i in range(N):
    s.append(input())
a=s.count('AC')
b=s.count('WA')
c=s.count('TLE')
d=s.count('RE')
print('AC x ' +str(a))
print('WA x ' +str(b))
print('TLE x ' +str(c))
print('RE x ' +str(d))
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
x = abs(a-b) / (v - w)
if v <= w:
    print('NO')

else:
    if x >= t:
        print('YES')
    else:
        print('NO')

### FIXED CODE ###

a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if a <= b:
    total_a = a + v * t
    total_b = b + w * t
    if total_a >= total_b:
        print('YES')
    else:
        print('NO')
else:
    total_a = a - v * t
    total_b = b - w * t
    if total_a <= total_b:
        print('YES')
    else:
        print('NO')
def main():
    import sys
    input = sys.stdin.readline

    N, M, K = map(int, input().split())

    fs = tuple(set() for _ in range(N))
    for _ in range(M):
        a, b = (int(x) - 1 for x in input().split())
        fs[a].add(b)
        fs[b].add(a)

    bs = tuple(set() for _ in range(N))
    for _ in range(K):
        a, b = (int(x) - 1 for x in input().split())
        bs[a].add(b)
        bs[b].add(a)

    roots = [-1] * N
    sizes = [-1] * N

    def dfs(v):
        """
        return: 連結成分のサイズを返す
        roots: 連結成分の各成分に根のindexを割り当てる
        """
        sz = 1
        for u in fs[v]:
            if ~roots[u]: continue
            roots[u] = roots[v]
            sz += dfs(u)
        return sz

    for v in range(N):
        if ~roots[v]: continue
        roots[v] = v
        sizes[v] = dfs(v)

    ans = []
    for v in range(N):
        r = roots[v]
        res = sizes[r] - 1 - len(fs[v]) - sum(1 for u in bs[v] if roots[u] == r)
        ans.append(res)

    print(*ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    from collections import defaultdict, deque
    import sys
    input = sys.stdin.readline

    N, M, K = map(int, input().split())

    g = tuple(set() for _ in range(N))
    direct_friend = [0] * N
    for _ in range(M):
        a, b = (int(x) - 1 for x in input().split())

        g[a].add(b)
        g[b].add(a)

        direct_friend[a] += 1
        direct_friend[b] += 1

    bk = tuple(set() for _ in range(N))
    for _ in range(K):
        c, d = (int(x) - 1 for x in input().split())
        bk[c].add(d)
        bk[d].add(c)

    dq = deque()
    checked = [-1] * N
    for v in range(N):
        if ~checked[v]:
            continue

        dq.append((v, v))  # v,root
        checked[v] = v
        while dq:
            v, root = dq.pop()
            for u in g[v]:
                if ~checked[u]:
                    continue
                checked[u] = root
                dq.append((u, root))

    ctr = defaultdict(int)
    for v in range(N):
        root = checked[v]
        ctr[root] += 1

    ret = []
    for v in range(N):
        root = checked[v]
        t = ctr[root] - direct_friend[v] - 1
        for u in bk[v]:
            if checked[u] == root:
                # 同じ連結成分に属するがブロック関係
                # for二重なので間に合わないと思っていたが総数K<=10**5で間に合う
                t -= 1
        ret.append(t)

    print(*ret)


if __name__ == '__main__':
    main()
N, K = map(int,input().split(' '))
stage = list(map(int, input().split(" ")))

INF = float('inf')
DP = [INF for i in range(N)]
#DP[0] = 0
candidate = []

for i in range(N):
    if i == 1:
        DP[i] = abs(stage[i] - stage[i-1])
    elif i > 1:
        for j in range(min(K+1,i+1)):
            if i == j:
                candidate.append(abs(stage[i]-stage[0]))
            else:
                candidate.append(DP[i-j] + abs(stage[i]-stage[i-j]))
        DP[i] = min(candidate)
        candidate.clear()

print(DP[N-1])

### FIXED CODE ###

N, K = map(int,input().split(' '))
stage = list(map(int, input().split(" ")))

INF = float('inf')
DP = [INF for i in range(N)]
#DP[0] = 0


for i in range(N):
    candidate = [INF for i in range(K)]
    if i == 1:
        DP[i] = abs(stage[i] - stage[i-1])
    elif i > 1:
        for j in range(min(K+1,i+1)):
            if i == j:
                candidate[0] = (abs(stage[i]-stage[0]))
            else:
                candidate[K-1-j]=(DP[i-j] + abs(stage[i]-stage[i-j]))
        DP[i] = min(candidate)

print(DP[N-1])
A, B = map(int,input().split())
def Eratosthenes(n):
    if n == 1:
      return [1]
    if n == 2:
      return [1, 2]
    dp = [False]*n
    dp[0] = dp[1] = True
    prime = []
    l = [1]
    for i in range(2, n):
        if dp[i]:
            continue
        prime.append(i)
        if n%i == 0:
          l.append(i)
        for j in range(i*2, n, i):
            dp[j] = True
            i += 1
    return l
print(len(set(Eratosthenes(A))&set(Eratosthenes(B))))


### FIXED CODE ###

A, B = map(int,input().split())
def factorization(n):
    if n == 1:
      return [1]
    elif n == 2:
      return [1, 2]
    arr = [1]
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)
    if temp!=1:
        arr.append(temp)
    if arr==[]:
        arr.append(n)
    return arr
print(len(set(factorization(A))&set(factorization(B))))
def gcd(a, b):
    if (b == 0):
        return a
    return gcd(b, a % b)

 def gcd()

input1 = list(map(int,input("").split(" ")))
A = list(map(int,input("").split(" ")))
N = input1[0]
K = input1[1]
A.sort()
if K in A:
	flag = True
elif K > max(A):
	flag = False
else:
	temp = A[0]
	for i in range(1,N):
		temp = gcd(temp,A[i])
	if K % G == 0:
		flag = True
	else:
		flag = False
			
if flag==True:
	print('POSSIBLE')
else:
	print('IMPOSSIBLE')

### FIXED CODE ###

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

input1 = list(map(int,input("").split(" ")))
A = list(map(int,input("").split(" ")))
N = input1[0]
K = input1[1]

temp = A[0]
for i in range(1,N):
	temp = gcd(temp,A[i])

if K <= max(A) and K % temp == 0:
	print('POSSIBLE')
else:
	print('IMPOSSIBLE')
s = []
while True:
    n, x = map(int, input().strip().split())
    if n == x == 0:
        break
    c = 0
    for i in range(1,x/3):
        c += max(0, (i+1-x)//2+n)
    s.append(str(c))
print('\n'.join(s))

### FIXED CODE ###

s = []
while True:
    n, x = map(int, input().strip().split())
    if n == x == 0:
        break
    c = 0
    for i in range(1,x//3):
        c += max(0, max(0,(x -3*i -1)//2) - max(0,(x -2*i -1 -n)))
    s.append(str(c))
print('\n'.join(s))
a,b,c = [int(n) for n in input.split(" ")]
print(a*b/2)

### FIXED CODE ###

# -*- coding: utf-8 -*-
a,b,c = map(int, input().split())
print(a*b//2)
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


X, Y, Z, K = read_ints()
A = read_ints()
B = read_ints()
C = read_ints()
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)


import numpy as np
dp = np.zeros((X, Y, Z), dtype=int)
dp[0, 0, 0] = A[0] + B[0] + C[0]

from itertools import product
for a, b, c in product(range(X), range(Y), range(Z)):
    if a + 1 != X:
        dp[a+1, b, c] = dp[a, b, c] - A[a]+A[a+1]
    if b + 1 != Y:
        dp[a, b+1, c] = dp[a, b, c] - B[b]+B[b+1]
    if c + 1 != Z:
        dp[a, b, c + 1] = dp[a, b, c] - C[c] + C[c + 1]

ls = sorted(dp.reshape(-1), reverse=True)
for ans in ls[:K]:
    print(ans)


### FIXED CODE ###

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


X, Y, Z, K = read_ints()
A = read_ints()
B = read_ints()
C = read_ints()

from itertools import product

AB = [a + b for a, b in product(A, B)]
AB.sort(reverse=True)

ABC = [ab + c for ab, c in product(AB[:K], C)]
ABC.sort(reverse=True)

ABC = ABC[:K]

print(*ABC, sep='\n')
a, b, c = map(int, input().stlip())
if sorted((a, b, c)) == [5, 5, 7]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

a, b, c = map(int, input().split())
if sorted((a, b, c)) == [5, 5, 7]:
  print('YES')
else:
  print('NO')
# https://atcoder.jp/contests/abc159/submissions/11139734

def main():
    MOD = 998244353

    N, S = map(int, input().split())
    *a, = map(int, input().split())

    dp = [0] * (S + 1)

    ret = 0
    for i, x in enumerate(a):
        dp[0] += 1
        ret = (ret + dp[S - x] * (N - i)) % MOD
        for k in range(S - 1, x - 1, -1):
            dp[k] = (dp[k] + dp[k - x]) % MOD

    print(ret)


if __name__ == '__main__':
    main()


### FIXED CODE ###

# https://atcoder.jp/contests/abc159/submissions/11139734

def main():
    MOD = 998244353

    N, S = map(int, input().split())
    *a, = map(int, input().split())

    dp = [0] * (S + 1)

    ret = 0
    for i, x in enumerate(a):
        dp[0] += 1
        if x > S: continue
        ret = (ret + dp[S - x] * (N - i)) % MOD
        for k in range(S - 1, x - 1, -1):
            dp[k] = (dp[k] + dp[k - x]) % MOD

    print(ret)


if __name__ == '__main__':
    main()
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

class UnionFind:
    def __init__(self,N): # 頂点数 N
        self.table = [i for i in range(N)]    #木の親 table[x] == x なら根
        self.rank  = [1 for i in range(N)]    #木の長さ
        self.size  = [1 for i in range(N)]    #集合のサイズ

    def Find(self,x):    #xの根を返す
        if self.table[x] == x:
            return x
        else:
            self.table[x] = self.Find(self.table[x])    #親の更新(根を直接親にして参照距離を短く)
            self.size[x] = self.size[self.table[x]]
            return self.table[x]

    def Unite(self,x,y):    #xとyを繋げる
        x,y = self.Find(x), self.Find(y)
        sx,sy = self.Size(x), self.Size(y)
        if x == y: return
        if self.rank[x] > self.rank[y]:
            self.table[y] = x
            self.size[x] = sx + sy
        else:
            self.table[x] = y
            self.size[y] = sx + sy
            if self.rank[x] == self.rank[y]:
                self.rank[y] += 1

    def Check(self,x,y):
        return self.Find(x) == self.Find(y)

    def Size(self,x):
        return self.size[self.Find(x)]



N = int(input())
UF = UnionFind(N)

xys = [inpl() for _ in range(N)]
xys.sort()
tatedict = defaultdict(list)
xx = set()
for x,y in xys:
    tatedict[x].append(y)
    xx.add(x)

for x in xx:
    s = tatedict[x][0]
    for t in tatedict[x]:
        if not UF.Check(s,t):
            UF.Unite(s,t)

ans = 0
for x in xx:
    s = tatedict[x][0]
    ans += UF.Size(s) - len(tatedict[x])

print(ans)


### FIXED CODE ###

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

def Find(x):    #xの根を返す
    global table

    if table[x] == x:
        return x
    else:
        table[x] = Find(table[x])    #親の更新(根を直接親にして参照距離を短く)
        size[x] = size[table[x]]
        return table[x]

def Unite(x,y):    #xとyを繋げる
    global size
    global rank
    x = Find(x)
    y = Find(y)
    sx = Size(x)
    sy = Size(y)

    if x == y:
        return

    if rank[x] > rank[y]:
        table[y] = x
        size[x] = sx + sy
    else:
        table[x] = y
        size[y] = sx + sy
        if rank[x] == rank[y]:
            rank[y] += 1

def Check(x,y):
    if Find(x) == Find(y):
        return True
    else:
        return False

def Size(x):
    return size[Find(x)]

table = [i for i in range(10**5+1)]    #木の親 table[x] == x なら根
rank  = [1 for i in range(10**5+1)]    #木の長さ
size  = [1 for i in range(10**5+1)]    #集合のサイズ


N = int(input())
xys = [inpl() for _ in range(N)]
xys.sort()
tatedict = defaultdict(list)
xx = set()
for x,y in xys:
    tatedict[x].append(y)
    xx.add(x)

for x in xx:
    s = tatedict[x][0]
    for t in tatedict[x]:
        if not Check(s,t):
            Unite(s,t)

ans = 0
for x in xx:
    s = tatedict[x][0]
    ans += Size(s) - len(tatedict[x])

print(ans)
N , A , B = map(int , input().split())
ans = 0
for n in range(1,N+1):
  sum = sum(list(map(int , str(n))))
  if A<=sum<=B:
    ans += n
print(ans)

### FIXED CODE ###

N , A , B = map(int , input().split())
ans = 0
for n in range(1,N+1):
  sum_num = sum(list(map(int , str(n))))
  if A<=sum_num<=B:
    ans += n
print(ans)
import math

A,B = map(int,input().split())

R = (A * B) // math.gcd(A, B)

print(R)

### FIXED CODE ###


A,B = map(int,input().split())

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

R = (A * B) / gcd(A, B)

print(int(R))
R,G,B,N = [int(i) for i in input().split()]
num = 0
box = sorted([R,G,B], key=lambda x:-x)
nums = [N//b for b in box]
for i in range(nums[0]+1):
	if (nums[0]-i)*box[0] + nums[1]*box[1] + nums[2]*box[2] < N:
		break
	for j in range(nums[1]+1):
		resj = (nums[0]-i)*box[0] + (nums[1]-j)*box[1]
		if resj + nums[2]*box[2] < N:
			break
		if resj > N:
            continue
        if (N-resj)%box[2]!=0:
            continue
        num += 1
print(num)

### FIXED CODE ###

R,G,B,N = [int(i) for i in input().split()]
num = 0
box = sorted([R,G,B], key=lambda x:-x)
nums = [N//b for b in box]
for i in range(nums[0]+1):
    if (nums[0]-i)*box[0] + nums[1]*box[1] + nums[2]*box[2] < N:
        break
    for j in range(nums[1]+1):
        resj = (nums[0]-i)*box[0] + (nums[1]-j)*box[1]
        if resj + nums[2]*box[2] < N:
            break
        if resj > N:
            continue
        if (N-resj)%box[2]!=0:
            continue
        num += 1
print(num)
s = input(); a = input(); c = 0
for i in range(4):
  if s[i] == a[i]: c += 1
print(c)	

### FIXED CODE ###

s = input(); a = input(); c = 0
for i in range(3):
  if s[i] == a[i]: c += 1
print(c)
N = int(input())
a = list(map(int, input().split()))
diff = []
for i in range(N-1):
    diff.append(abs(sum(a[:i+1]) - sum(a[i+1:])))
print(min(diff))


### FIXED CODE ###

A, B = map(int, input().split())
if(A%3==0):
    print("Possible")
elif(B%3==0):
    print("Possible")
elif((A+B)%3==0):
    print("Possible")
else:
    print("Impossible")
a,b,c,d,e,k = map(int,input().split())
if abs(e-a) <= k:
  print('Yay!')
else:
  print(':(')

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a <= k:
  print('Yay!')
else:
  print(':(')
s = list(map(int, input.split()))
A = s[0]
B = s[1]
result = (A + B)
if result % 2 ==0:
    print(result)
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

s = list(map(int, input().split()))
A = s[0]
B = s[1]
result = abs(A - B)
if result % 2 ==0:
    print(int(min(A,B) + result/2))
else:
    print('IMPOSSIBLE')
def lcs():
???x = raw_input()
  y = raw_input()
???x_len = len(x)
  y_len = len(y)
  z2 = [0 for i in range(y_len+1)]

???for j in range(x_len):
   z1 = z2 + []
   for k in range(y_len):
      if x[i] = y[k]:
         z2[k+1] = z2[k] + 1
      elif z2[k+1] < z2[k]:???
?????????   z2[k+1] = z2[k]

  return z2[-1]

num = input()
for l in range(num):
  print lcs()

### FIXED CODE ###

def lcs():
  x = raw_input()
  y = raw_input()
  x_len = len(x)
  y_len = len(y)
  z2 = [0 for i in range(y_len+1)]

  for i in range(x_len):
    z1 = z2 + []
    ele = x[i]
    for k in range(y_len):
      if ele == y[k]:
        z2[k+1] = z1[k] + 1
      elif z2[k+1] < z2[k]:
        z2[k+1] = z2[k]

  return z2[-1]

num = input()
for j in range(num):
  print lcs()
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 = int(input())
pow(n,3)
print(n

### FIXED CODE ###

n = int(input())
a = pow(n,3)
print(a)