Harryxun/stf_run huggingface dataset:
N=int(input())

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)
	return divisors

total=sorted(make_divisors(N))
print(total[1]-1+total[len(total)-2]-1)

### FIXED CODE ###

n=int(input())

d=[]
for h in range(1, int(n**0.5)+1):
	if n%h == 0:
		j=n//h
		d.append(j)
		i=n//j

print(i-1+j-1)
s = input()
all[20]

for val int range(s):
    all[val] = input()
    
count = 0
for val in range(s - 2)
    if all[val] < all[val + 1] and all[val + 1] < all[val + 2]
        count += 1

### FIXED CODE ###

ss = input()
s = int(ss)
nums = list(map(int,input().split()))
count = 0
for val in range(s -2):
    if nums[val] > nums[val + 1] > nums[val + 2] or nums[val] < nums[val + 1] < nums[val + 2]:
        count += 1
        
print(count)
s,t = input().split()
sn,tn = map(int,input().split())
u  = input()

if s == u:
	print((sn-1) ' '+ (tn))
else:
	print(sn + '' + (tn-1))

### FIXED CODE ###

s,t = input().split()
sn,tn = map(int,input().split())
u  = input()

if s == u:
    print(str(sn-1) + ' '+ str(tn))
else:
    print(str(sn) + ' ' + str(tn-1))
def check(ans, ans_, n):
    if ans == n:
        ans_ = 1
    elif ans < n:
        ans = n
    return ans, ans_

W, H, x, y = list(map(int, input().split()))
total = W * H

ans = min(H*x, total-H*x)
ans_ = 0
ans, ans_ = check(ans, ans_, min(W*y, total-W*y))

for w, h, y_ in [(0, 0, H), (W, 0, H)]:
    a = (y-h) / (x-w)
    x_ = abs(y_ / a)
    if x_ < H/2:
        n = W * y_ / 2
    else:
        n = H * x_ / 2
    ans, ans_ = check(ans, ans_, min(n, total-n))

for w, h, x_ in [(0, H, W), (W, H, W)]:
    a = (y-h) / (x-w)
    y_ = x_ * a
    if y_ >= 0:
        n = (H - y_) * x_ / 2
    else:
        n = y_ * x_ / 2
    ans, ans_ = check(ans, ans_, min(n, total-n))

print(ans, ans_)

### FIXED CODE ###

W, H, x, y = list(map(int, input().split()))
z = [0, 1]
print(W*H/2, z[x*2 == W and y*2 == H])
x,n=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
min=abs(p[0])
for i in range(p[n-1]):
    if i not in p:
        if min>abs(i-x):
            min=abs(i-x)
            ans=i
print(ans)

### FIXED CODE ###

x, n = map(int, input().split())
a = [int(x) for x in input().split()]
b = [i for i in range(0,102) if i not in a] 
b_tmp = list(map(lambda s:abs(s-x), b)) 
address = b_tmp.index(min(b_tmp))
print(b[address])
import sys

check = True
i = 0
#for j in range(100):

#	x = sys.stdin.readline().strip()
#	
#	if x == "0":
#		check = False
#		break
	
	print("Case " + str(i) + ": " + x)

### FIXED CODE ###

import sys
num = 0
while 1:
    x = sys.stdin.readline().strip()
    if x == "0":
        break
    num = num + 1
    print("Case " + str(num) + ": " + x)
# -*- coding: utf-8 -*-
import numpy as np
T = np.zeros(5, dtype=int)
T[0] = int(input())
T[1] = int(input())
T[2] = int(input())
T[3] = int(input())
T[4] = int(input())
res = np.argsort(T%10)
for i in range(5):
  if(T[res[i]]%10 > 0):
    selected_index = res[i]
    break
tim = (T//10 + (T%10 != 0))*10
tim[selected_index] = T[selected_index]
print(sum(tim))


### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np
T = np.zeros(5, dtype=int)
T[0] = int(input())
T[1] = int(input())
T[2] = int(input())
T[3] = int(input())
T[4] = int(input())
res = np.argsort(T%10)
selected_index = 0
for i in range(5):
  if(T[res[i]]%10 > 0):
    selected_index = res[i]
    break
tim = (T//10 + (T%10 != 0))*10
tim[selected_index] = T[selected_index]
print(sum(tim))
pqr=[int(input() for i in range(3))]
pqr.sort()
print(pqr[0]+pqr[1])

### FIXED CODE ###

p,q,r=map(int,input().split())
pqr=[p,q,r]
pqr.sort()
print(pqr[0]+pqr[1])
N = int(input())
ans = 0
for i in range(1, N + 1):
    tmp = (i * (i - 1)) //  2
    if tmp >= N:
        ans = i - 1
        break

anslst = [i for i in range(ans, 0, -1)]
tmp = N - anslst[0]
print(anslst[0])
for i in anslst[1:]:
    if tmp == 0:
        break
    tmp -= i
    print(i)

### FIXED CODE ###

N = int(input())
ans = 0

if N < 3:
    print(N)
    exit()

for i in range(1, N + 1):
    tmp = (i * (i - 1)) //  2
    if tmp >= N:
        ans = i - 1
        break

anslst = [i for i in range(ans, 0, -1)]
tmp = N - anslst[0]
print(anslst[0])
for i in anslst[1:]:
    if tmp - i < 0:
        continue
    if tmp == 0:
        break
    print(i)
    tmp -= i
D = list(map(int, input().split()))

for i in D:
    if D[i]==0:
        print(i)

### FIXED CODE ###

D = list(map(int, input().split()))

for i in range (len(D)):
    if D[i]==0:
        print(i+1)
A = int(input())
B = int(input())

if A < 10 and B < 10 :
    print(A*B)
else :
    print(-1)

### FIXED CODE ###

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

if A < 10 and B < 10 :
    print(A*B)
else :
    print(-1)
n = int(input())
XL = [list(map(int, input().split())) for _ in range(n)]
N = 0
for x, l in XL:
    N = max(N, x+l)
# N: 処理する区間の長さ
INF = 2**31-1

LV = (N-1).bit_length()
N0 = 2**LV
data = [0]*(2*N0)
lazy = [0]*(2*N0)

def gindex(l, r):
    L = (l + N0) >> 1; R = (r + N0) >> 1
    lc = 0 if l & 1 else (L & -L).bit_length()
    rc = 0 if r & 1 else (R & -R).bit_length()
    for i in range(LV):
        if rc <= i:
            yield R
        if L < R and lc <= i:
            yield L
        L >>= 1; R >>= 1

# 遅延伝搬処理
def propagates(*ids):
    for i in reversed(ids):
        v = lazy[i-1]
        if not v:
            continue
        lazy[2*i-1] += v; lazy[2*i] += v
        data[2*i-1] += v; data[2*i] += v
        lazy[i-1] = 0

# 区間[l, r)にxを加算
def update(l, r, x):
    *ids, = gindex(l, r)
    propagates(*ids)

    L = N0 + l; R = N0 + r
    while L < R:
        if R & 1:
            R -= 1
            lazy[R-1] += x; data[R-1] += x
        if L & 1:
            lazy[L-1] += x; data[L-1] += x
            L += 1
        L >>= 1; R >>= 1
    for i in ids:
        data[i-1] = min(data[2*i-1], data[2*i])

# 区間[l, r)内の合計を求める
def query(l, r):
    propagates(*gindex(l, r))
    L = N0 + l; R = N0 + r

    s = 0
    while L < R:
        if R & 1:
            R -= 1
            s += data[R-1]
        if L & 1:
            s += data[L-1]
            L += 1
        L >>= 1; R >>= 1
    return s


for x, l in XL:
    update(x-l, x+l, 1)

tmp = [0] * N
for i in range(len(XL)):
    mn = XL[i][0] - XL[i][1]
    mx = XL[i][0] + XL[i][1]
    XL[i].append(query(mn, mx))

XL.sort(key=lambda x:x[2])

LV = (N-1).bit_length()
N0 = 2**LV
data = [0]*(2*N0)
lazy = [0]*(2*N0)

cnt = 0
for x, l, z in XL:
    if query(x-l, x+l) == 0:
        cnt += 1
        update(x-l, x+l, 1)

print(cnt)



### FIXED CODE ###

N = int(input())
XL = [tuple(map(int, input().split())) for _ in range(N)]
XL.sort(key=lambda x: x[0]+x[1])
cnt = 0
now = 10 ** 9 * -1
for x, l in XL:
    if now <= x - l:
        cnt += 1
        now = x + l

print(cnt)
N, P = map(int, input().split())

if N == 1:
    print(P)
else:
    ans = 1
    for x in range(1, int(P**0.5)+1):
        if P % (x**N) == 0:
            ans = max(ans, x)
    print(ans)

### FIXED CODE ###

from collections import Counter

N, P = map(int, input().split())

# n以下の全ての素数のセットを返す関数
def prime_set(n):
    primes = set(range(2, n+1))
    for i in range(2, int(n**0.5) + 1):
        primes.difference_update(range(i*2, n+1, i))
    return primes

# nを素因数分解して素因数の全リストを返す関数
def prime_factors(n):
    f = []
    for i in prime_set(int(n**0.5) + 1):
        while n % i == 0:
            f.append(i)
            n //= i
    if n > 1:
        f.append(n)
    return f

c = Counter(prime_factors(P))
ans = 1

for x in c.keys():
    ans *= pow(x, int(c[x]//N))

print(ans)
l,r=map(int,input().split())
s=list()
if l+1==r:
    print(l*r)
else:
    for i in range(l,r):
        s.append([i*(i+1)%2019])
    #print(s[0][0])
    s=(sorted(s))
    print(s[0][0])

### FIXED CODE ###

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

d=a*n
if d>b:
    print(b)
else:
    print(d)
# ABC097D - Equals (ARC097D)
"""
Union-Find: O(α(N))

Verified:
    https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/1/DSL_1_A
    https://judge.yosupo.jp/problem/unionfind
"""


class UnionFind:
    __slots__ = ["_data_size", "_first_index", "_parents"]

    def __init__(self, data_size: int, is_zero_indexed: bool = True) -> None:
        self._data_size = data_size
        self._first_index = 0 if is_zero_indexed else 1
        self._parents = [-1] * (data_size + self._first_index)

    def find(self, x: int) -> int:
        """Find the group (root) of vertex x"""
        if self._parents[x] < 0:
            return x
        self._parents[x] = self.find(self._parents[x])
        return self._parents[x]

    def is_same(self, x: int, y: int) -> bool:
        """Return whether two vertices x and y are in the same group or not."""
        return self.find(x) == self.find(y)

    def unite(self, x: int, y: int) -> None:
        """Unite two groups of vertices x and y."""
        x, y = self.find(x), self.find(y)
        if x == y:
            return
        if self._parents[x] > self._parents[y]:
            x, y = y, x
        self._parents[x] += self._parents[y]
        self._parents[y] = x


def main():
    N, _, *PXY = open(0).read().split()
    P, XY = PXY[:N], PXY[N:]
    uf = UnionFind(N, is_zero_indexed=False)
    for x, y in zip(*[iter(XY)] * 2):
        uf.unite(x, y)
    ans = sum(uf.is_same(i, p) for i, p in enumerate(P, 1))
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

# ARC097D - Equals (ABC097D)
import sys

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


def dfs(v: int, color: int) -> None:
    seen[v] = 1  # make vertex v searched
    group[v] = color
    for u in G[v]:  # search vertices available from v recursively
        if not seen[u]:  # skip if already searched
            dfs(u, color)


def main():
    # check i and Pi are connected components or not
    global G, seen, group
    N, M = tuple(map(int, input().split()))
    P = tuple(map(int, input().split()))
    E = tuple(tuple(map(int, input().split())) for _ in range(M))
    G = [[] for _ in range(N + 1)]  # construct a graph (1-idx)
    for v, u in E:
        G[v] += [u]
        G[u] += [v]
    seen, group = [0] * (N + 1), [0] * (N + 1)
    color = 1
    for i in range(1, N + 1):  # connected components have the same color
        if not seen[i]:
            dfs(i, color)
            color += 1
    ans = sum(group[i] == group[p] for i, p in enumerate(P, 1))
    print(ans)


if __name__ == "__main__":
    main()
a, b, c = map(int, input().split())

if a == b:
  input(c)
elif b == c:
  input(a)
else:
  input(b)


### FIXED CODE ###

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

if a == b:
  print(c)
elif b == c:
  print(a)
else:
  print(b)
import sys
input = sys.stdin.readline
import numpy as np

def main():
    n, W = map(int, input().split())
    dp = np.zeros(W + 1, dtype = np.int64)
    for i in range(n):
        w,v=map(int,input().split())
        dp[w:]=np.maximum(dp[w:],dp[:-w]+v)
    print(max(dp))

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
import numpy as np
INF=10**9+1
def main():
    n, W = map(int, input().split())
    dp = np.full(n*1000+1,INF,dtype=int)
    dp[0]=0
    for i in range(1,n+1):
        w,v=map(int,input().split())
        dp[v:]=np.minimum(dp[v:],dp[:-v]+w)
    for i in range(len(dp)-1, -1, -1):
        if dp[i] <= W:
            print(i)
            break

if __name__ == '__main__':
    main()
A123 = sum(list(map(int, input().split())))
print('bust' if A123 > 21, else 'win')

### FIXED CODE ###

A123 = sum(list(map(int, input().split())))
print('bust' if A123 > 21 else 'win')
a,v= map(int, input().split())
b,w= map(int, input().split())
t=input(int())

if w>=v:
    print("NO")

elif abs(a-b)/abs(v-w)<=t:
        print("YES")

else :
        print("NO")


### FIXED CODE ###

a,v= map(int, input().split())
b,w= map(int, input().split())
t=int(input())

if w>=v:
    print("NO")

elif (abs(a-b)/abs(v-w))<=t:
        print("YES")

else :
        print("NO")
def dfs(v, p, d):
	global D
	global G
	D[v-1] = d
	while G[v-1]!=[]:
		g = G[v-1].pop()
		if g[0]==p:
			continue
		dfs(g[0], v, d+g[1])

N = int(input())
G = [[] for _ in range(N)]
for _ in range(N-1):
	a, b, c = map(int, input().split())
	G[a-1].append([b, c])
	G[b-1].append([a, c])

Q, K = map(int, input().split())
D = [0]*N
dfs(K, -1, 0)
for _ in range(Q):
	x, y = map(int, input().split())
	print(D[x-1] + D[y-1])


### FIXED CODE ###

import heapq
import sys
input = sys.stdin.readline


def dijkstra_heap(s, n, edge):
    #始点sから各頂点への最短距離
    d = [float("inf")] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for e in edge[s]:
        heapq.heappush(edgelist,e)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        d[v] = minedge[0]
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,[e[0]+d[v],e[1]])
    return d


def main():
    N = int(input())

    edge = [[] for i in range(N)]
    for _ in range(N-1):
        a, b, c = map(int, input().split())
        a -= 1
        b -= 1
        edge[a].append([c,b])
        edge[b].append([c,a])
    
    Q, K = map(int, input().split())
    K -= 1
    D = dijkstra_heap(K, N, edge)

    for _ in range(Q):
        x, y = map(int, input().split())
        x -= 1
        y -= 1
        print(D[x]+D[y])


if __name__ == '__main__':
    main()
a

### FIXED CODE ###

S = input()
T = input()
if S == T[:-1]:
  print("Yes")
else:
  print("No")
s=input()
c=0
while n>0:
  n=s.count('01')
  s=s.replace('01','')
  c=c+n
  n=s.count('10')
  s=s.replace('10','')
  c=c+n
print(c)

### FIXED CODE ###

s=input()
print(2*min(s.count('0'),s.count('1')))
#054_C
from itertools import permutations
n,m=map(int,input().split())
edges=[[False for _ in range(n)] for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    a,b=a-1,b-1
    edges[a][b]=edges[b][sa]=True

ans=0
for l in permutations(range(1,n),n-1):
    l=[0]+list(l)
    if all(edges[l[i]][l[i+1]] for i in range(n-1)):
        ans+=1
print(ans)

### FIXED CODE ###

#054_C
from itertools import permutations
n,m=map(int,input().split())
edges=[[False for _ in range(n)] for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    a,b=a-1,b-1
    edges[a][b]=edges[b][a]=True

ans=0
for l in permutations(range(1,n),n-1):
    l=[0]+list(l)
    if all(edges[l[i]][l[i+1]] for i in range(n-1)):
        ans+=1
print(ans)
import numpy as np
N,K=map(int, input().split())
A =list(map(int,input().split()))
MOD = 10 ** 9 + 7
if N==K:
  ans0 = 1
  for a in A[0:N]:
    ans0 *= a
    ans0 %= MOD
  print(ans0)
  exit()
A=sorted(A)  
if (K%2==1 and A[-1]<0):
  ans1 = 1
  for a in A[N-K:N]:
    ans1 *= a
    ans1 %= MOD
  print(ans1)
  exit()

A=sorted(A, key=lambda x:abs(x), reverse=True)
AA=[np.sign(i) for i in A]
 
ansA = 1
for a in A[0:K]:
  ansA *= a
  ansA %= MOD
ansAA = AA[0:K].count(-1)%2
if ansA==0 or ansAA==0:
  print(ansA)
  exit()

#while ansA>0:
#  ansA-=MOD

B1=A[0:K]
C1=A[0:K]
B2=sorted(A[K:N])
Bp=[i for i in A[0:K] if i>0]
Bm=[i for i in A[0:K] if i<0]
 
if B2[0]>0:B2.insert(0,0)
if B2[-1]<0:B2.insert(-1,0)
if not Bp:Bp.insert(0,B1[-1])
if not Bm:Bm.insert(0,B1[0])
  
B1.remove(Bp[-1])
B1.append(min(B2[0],0))

ansB = 1
for a in B1[0:K]:
  ansB *= a
  ansB %= MOD

C1.remove(Bm[-1])
C1.append(max(B2[-1],0))
 
ansC = 1
for a in C1[0:K]:
  ansC *= a
  ansC %= MOD

BB1=[np.sign(i) for i in B1]
ansBB1 = BB1[0:K].count(-1)%2
BB2=[np.sign(i) for i in C1]
ansBB2 = BB2[0:K].count(-1)%2

if ansBB1==1:
  print(ansC)
  exit()
if ansBB2==1:
  print(ansB)
  exit()

if abs(Bp[-1]*B2[-1])-abs(Bm[-1]*B2[0])>=0:
  print(ansC)
else: print(ansB)

### FIXED CODE ###

import math
N=int(input())
print(1000*math.ceil(N/1000)-N)
import numpy as np
N, M = map(int, input().split())
list_coStu = []
list_coChe = []
for i in range(N):
    list_coStu.append(list(map(int, input().split())))
for i in range(N):
    list_coChe.append(list(map(int, input().split())))

#calc distance

for iS in range(len(list_coStu)):
    coStu = np.array(list_coStu[iS])
    min_iC = 0
    d = 4 * 10**8 + 1
    for iC in range(len(list_coChe)):
        coChe = np.array(list_coChe[iC])
        dif = coChe - coStu
        dist = np.sum(np.abs(dif))
        if dist < d:
            min_iC = iC
            d = dist
    print(min_iC + 1)


### FIXED CODE ###

import numpy as np
N, M = map(int, input().split())
list_coStu = []
list_coChe = []
for i in range(N):
    list_coStu.append(list(map(int, input().split())))
for i in range(M):
    list_coChe.append(list(map(int, input().split())))

#calc distance

for iS in range(len(list_coStu)):
    coStu = np.array(list_coStu[iS])
    min_iC = 0
    d = 4 * 10**8 + 1
    for iC in range(len(list_coChe)):
        coChe = np.array(list_coChe[iC])
        dif = coChe - coStu
        dist = np.sum(np.abs(dif))
        if dist < d:
            min_iC = iC
            d = dist
    print(min_iC + 1)
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a_sum = [0]
b_sum = [0]
for i in range(n):
    a_sum.append(a[i]+a_sum[i])
    if a_sum[i]>1e+9:
        break
for i in range(m):
    b_sum.append(b[i]+b_sum[i])
    if b_sum[i]>1e+9:
        break
        
ans = 0
for i in range(n+1):
    if a_sum[i]>k:
        break
    time = k - a_sum[i]
    for j in range(m):
        if time<b_sum[j+1]:
            break
    if time>=b_sum[m]:
        j = m
    ans = max(ans,i+j)
    
print(ans)

### FIXED CODE ###

n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a_sum = [0]
b_sum = [0]
for i in range(n):
    a_sum.append(a[i]+a_sum[i])
    if a_sum[i]>k:
        break
for i in range(m):
    b_sum.append(b[i]+b_sum[i])
    if b_sum[i]>k:
        break
        
ans = 0
y = len(b_sum)-1
for i in range(len(a_sum)):
    if a_sum[i]>k:
        break
    time = k - a_sum[i]
    for j in range(y,-1,-1):
        if time>=b_sum[j]:
            y = j
            break
    if time>=b_sum[len(b_sum)-1]:
        j = len(b_sum)-1
    ans = max(ans,i+j)
    
print(ans)
from collections import Counter
S=input()
T=input()
s=list(S)
t=list(T)
a=Counter(s)
b=Counter(t)
c=a.most_common()
d=b.most_common()
flag=True
for i in range(len(s)):
    if d[i][1]==1 and c[i][1]==1:
        break
    if d[i][1]>=2:
        e=[]
        for i in range(len(s)):
            if t[i]==d[0][0]:
                e.append(s[i])
        for i in range(len(e)-1):
            if e[i]!=e[i+1]:
                flag=False
    if c[i][1]>=2:
        f=[]
        for i in range(len(s)):
            if s[i]==c[0][0]:
                f.append(t[i])
        for i in range(len(f)-1):
            if f[i]!=f[i+1]:
                flag=False
if flag:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

from collections import Counter
S=input()
T=input()
s=list(S)
t=list(T)
a=Counter(s)
b=Counter(t)
c=a.most_common()
d=b.most_common()
flag=True
for i in range(min(len(d),len(c))):
    if d[i][1]==1 and c[i][1]==1:
        break
    if d[i][1]>=2 and flag:
        e=[]
        for j in range(len(s)):
            if t[j]==d[i][0]:
                e.append(s[j])
        for j in range(len(e)-1):
            if e[j]!=e[j+1]:
                flag=False
                break
    if c[i][1]>=2 and flag:
        f=[]
        for j in range(len(s)):
            if s[j]==c[i][0]:
                f.append(t[j])
        for j in range(len(f)-1):
            if f[j]!=f[j+1]:
                flag=False
                break
if flag:
    print('Yes')
else:
    print('No')
#!/usr/bin/env python
# coding: utf-8

from collections import namedtuple

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def dist(pf, pt):
    return abs(pf[0]-pt[0]) + abs(pf[1]-pt[1])

def print_ans(sx, sy, ans):
    print(len(ans))
    for p in ans:
        print(sx*p[0], sy*p[1])

def move(k, pf, pt):
    assert(pt[1]>pf[1])
    d = min(pt[0]-pf[0], k)
    return [pf[0]+d,pf[1]+k-d]

def main():
    k = ri()
    x, y = rli()
    sx = 1 if x >= 0 else -1
    sy = 1 if y >= 0 else -1
    x = abs(x)
    y = abs(y)

    pf = [0, 0]
    pt = [x, y]
    if k % 2 == 0 and (x+y) % 2 == 1:
        print(-1)
        return
    d = dist(pf, pt)

    ans = []

    # 3回で到達
    if d < k and d % 2 == 1:
        ans.append(((x+y-k)//2, (k+x+y)//2))
        ans.append((x+y-k, 0))
        ans.append((x, y))
        print_ans(sx, sy, ans)
        return

    n = (x+y+k-1) // k
    d = (n*k-(x+y))//2
    if d > 0:
        pf = [k-d, -d]
        ans.append(tuple(pf))
    while dist(pf, pt) > 0:
        pf = move(k, pf, pt)
        ans.append(tuple(pf))
    print_ans(sx, sy, ans)
    assert(pf[0] == x and pf[1] == y)



if __name__ == '__main__':
    main()


### FIXED CODE ###

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

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    a, b = rli()
    if (a + b) % 2 == 1:
        print("IMPOSSIBLE")
    else:
        print((a+b) // 2)


if __name__ == '__main__':
    main()
import numpy as np
import math


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    a, b, c, d = map(int, input().split())
    warikireru_c = math.floor(b / c) - math.ceil(a / c) + 1
    warikireru_d = math.floor(b / d) - math.ceil(a / d) + 1
    lcm = lcm(c, d)
    warikireru_lcm = math.floor(b / lcm) - math.ceil(a / lcm) + 1
    num = b - a + 1
    print(num - (warikireru_c + warikireru_d - warikireru_lcm))


### FIXED CODE ###

import math
import fractions


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


if __name__ == '__main__':
    a, b, c, d = map(int, input().split())
    warikireru_c = b // c - (- (-a // c)) + 1
    warikireru_d = b // d - (-(-a // d)) + 1
    lcm_1 = lcm(c, d)
    warikireru_lcm = b // lcm_1 - (- (-a // lcm_1)) + 1
    num = b - a + 1
    print(num - (warikireru_c + warikireru_d - warikireru_lcm))
# -*- coding: utf-8 -*-
import numpy as np

x = int(input())
s_candidates = []


for i in range(1, x+1):
    if x % i != 0:
        continue
    else:
        for a in range(x):
            b = a - s
            if a**5 - b**5 == x:
                ans_a = a
                ans_b = b
                break
        if t == tmp:
            break

print(ans_a, ans_b)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np

x = int(input())
flg = 0

for i in range(1, x+1):
    if x % i != 0:
        continue
    else:
        for a in range(x):
            b = a - i
            if a**5 - b**5 == x:
                ans_a = a
                ans_b = b
                flg = 1
                break
            elif a > i and a**5 - b**5 > x:
                flg = -1
                break
        if flg == 1:
            break
        elif flg == -1:
            flg = 0
            continue

print(ans_a, ans_b)
n=int(input())
h=list(map(int,input()))
hm=max(h)
s=['']*hm
for k in range(hm+1):
  for i in range(n):
    if h[i]>=k:
      s[k]+='#'
    else:
      s[k]+=' '

ans=0
for k in range(hm+1):
  ans+=len(list(s[k].split()))
print(ans)

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
hm=max(h)
s=['']*hm
for k in range(1,hm+1):
  for i in range(n):
    if h[i]>=k:
      s[k-1]+='#'
    else:
      s[k-1]+=' '

#print(s)
ans=0
for k in range(hm):
  ans+=len(list(s[k].split()))
print(ans)
n = input()
print(N**3)

### FIXED CODE ###

n = int(input())
print(n**3)
#coding: utf-8
import numpy as np
import fraction
from functools import reduce

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

y = np.asarray(list(map(int,input().split())))
y -= x

print(reduce(fraction.gcd, y))



### FIXED CODE ###


#coding: utf-8
import numpy as np
from functools import reduce

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

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

y = np.asarray(list(map(int,input().split())))
y -= x
y = map(abs,y)

print(reduce(gcd, y))