Harryxun/stf_run huggingface dataset:
x,y = map(int, input().split())

while True:

    if x == 0 and y == 0:
        break

    elif x => y:
        print(srt(x) + " " + str(y))

    else:
        print(srt(y) + " " + str(x))



### FIXED CODE ###

while True:
    x,y = map(int, input().split())

    if x == 0 and y == 0:
        break

    elif x <= y:
        print(str(x) + " " + str(y))
    else:
        print(str(y) + " " + str(x))
N=int(input())
a=list(map(int,input().split()))
m=max(a)
p=[0]*(m-1)

for i in range(m-1):
  p[i]=a.count(i)+a.count(i+1)+a.count(i+2)
  
print(max(p))

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
M=max(a)
m=min(a)
x=[0]*(M-m+3)
for i in a:
  x[i-m]+=1
  x[i-m+1]+=1
  x[i-m+2]+=1
print(max(x))
A,B = map(int,input().split())
tmp = list(A,B)
ans = ["Alice","Bob"]
if tmp[0] == tmp[1]:
    print("Draw")
elif tmp[0] == 1:
    print(ans[0])
elif tmp[1] == 1:
    print(ans[1])
elif tmp[0] > tmp[1]:
    print(ans[0])
else:
    print(ans[1])

### FIXED CODE ###

A,B = map(int,input().split())
tmp = [A,B]
ans = ["Alice","Bob"]
if tmp[0] == tmp[1]:
    print("Draw")
elif tmp[0] == 1:
    print(ans[0])
elif tmp[1] == 1:
    print(ans[1])
elif tmp[0] > tmp[1]:
    print(ans[0])
else:
    print(ans[1])
N=int(input())
ls=[int(s) for s in input().split()]
M=max(ls)
#素数のリスト作成
prime=[1 for i in range(M+1)]
prime[0]=0
prime[1]=0
primels=[]
primedic={}
for i in range(2,M+1):
  if prime[i]==1:
    primels.append(i)
    primedic[i]=0
    a=1
    while a*i<=M:
      prime[a*i]=0
      a+=1

for e in ls:
  for p in primels:
    if e%p==0:
      primedic[p]+=1
      while e%p==0:
        e//=p
    if e==1:
      break
    
A=max(primedic.values())
if A==len(ls):
  print('not coprime')
elif A>1:
  print('setwise coprime')
else:
  print('pairwise coprime')

### FIXED CODE ###

import math
import time

start=time.time()

N=int(input())
ls=[int(s) for s in input().split()]
M=max(ls)
SQRT_M=int(math.sqrt(M))+1
#素数のリスト作成
prime=[1 for i in range(SQRT_M+1)]
prime[0]=0
prime[1]=0
primels=[]
primedic={}
for i in range(2,SQRT_M+1):
  if prime[i]==1:
    primels.append(i)
    primedic[i]=0
    a=1
    while a*i<=SQRT_M:
      prime[a*i]=0
      a+=1

for e in ls:
  for p in primels:
    if e%p==0:
      primedic[p]+=1
      while e%p==0:
        e//=p
    if e==1:
      break
  else:
    if e in primedic:
      primedic[e]+=1
    else:
      primedic[e]=1
  if time.time()-start>1.9:
    break
    

A=max(primedic.values())

if A==len(ls):
  print('not coprime')
elif A>1:
  print('setwise coprime')
else:
  print('pairwise coprime')
N,X=map(int,input().split())
L=list(map(int,input().split()))
L.append(0)
L.sort()
for i in range(N+1):
  if sum(L[:i+1]) > X:
    print(i)
    break
  elif sum(L) =<X:
    print(N)
    break

### FIXED CODE ###

X,A=map(int,input().split())
if X < A:
  print(0)
else:
  print(10)
N = int(input())
p = []
for i in range(N):
  p.append(int(input()))
  
print(int(sum(p)-max(p)/2)


### FIXED CODE ###

N = int(input())
sm,mx = 0,0
for i in range(N):
  P = int(input())
  sm += P
  mx = max(mx, P)

a = int(sm - mx / 2)
print(a)
from fractions import gcd
 
n,*a = map(int, open(0).read().split())
 
rs, ls = [0], [0]
for i in range(n-1):
  rs.append(gcd(rs[i], a[i]))
  ls.append(gcd(ls[i], a[-i-1]))
 
print(max(gcd(r, l) for r, l in zip(rs, ls[::-1])))

### FIXED CODE ###

a,b,t = map(int,input().split())
print(0 if a>t else (t//a)*b)
import math
n,x=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
    a[i]=abs(a[i]-x)
a=sorted(a)
ans=a[0]
for k in a:
    ans=math.gcd(ans,k)
print(ans)


### FIXED CODE ###

import fractions
n,x=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
    a[i]=abs(a[i]-x)
a=sorted(a)
ans=a[0]
for k in a:
    ans=fractions.gcd(ans,k)
print(ans)
X = int(input())

def Sum_Digit(X):
  SUM = 0
  while X > 1:
    SUM += X%10
    X = int((X - X%10)/10)
  return SUM

S = Sum_Digit(X)
if X%S == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

X = int(input())

def Sum_Digit(X):
  SUM = 0
  while X >= 1:
    SUM += X%10
    X = int((X - X%10)/10)
  return SUM

S = Sum_Digit(X)
if X%S == 0:
  print("Yes")
else:
  print("No")
a=int(input('a'))
b=int(input('b'))
if a%2=1 and b%2=1
print ('Odd')
else:
  print ('Even')

### FIXED CODE ###

a,b=map(int,input().split())
if (a*b)%2 ==0:
  print('Even')
else:
  print('Odd')
count = 0
n = int(input())
for i in range(n):
  a,b=map(int,input().split())
  if a == b:
    count += 1
    if count >= 3:
		print("Yes")
  	return 0

print("No")


### FIXED CODE ###

ans = "No"
count = 0
n = int(input())
for i in range(n):
  a,b=map(int,input().split())
  if a == b:
    count += 1
    if count >= 3:
        ans ="Yes"
  else:
    count = 0

print(ans)
N, M = map(int, input().split())
A = input().split()
if sum(A) > N:
  print(-1)
else:
  print(N - sum(A))

### FIXED CODE ###

N, M = map(int, input().split())
A = input().split()
if sum(int(i) for i in A) > N:
    print(-1)
else:
    print(N - sum(int(i) for i in A))
import random 
S = input()
T = input()
a = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if T == S + random.coice(a) 
  print("YES")
  else:
    print("NO")
    
    

### FIXED CODE ###


    
s = input()
t = input()

if t[:-1] == s:
    print("Yes")
else:
    print("No")
n = int(input())
cnt =　0
for i in range(n):
  if (i+1)%2　==　1:
    cnt +=　1
print(cnt/n)


### FIXED CODE ###

N = int(input())
print((N-(N//2))/N)
def main():
    import collections
    import numpy as np

    H, W, M_ko = map(int, input().split())

    zahyou = [[0 for i in range(W)] for j in range(H)]
    zahyou_H = [0 for i in range(H)]
    zahyou_W = [0 for i in range(W)]

    np_zahyou = np.array(zahyou)
    np_zahyou_H = np.array(zahyou_H)
    np_zahyou_W = np.array(zahyou_W)
    

    for i in range(M_ko):
        height, width = map(int, input().split())

        zahyou[height - 1][width - 1] = 1
        
        zahyou_H[height - 1] += 1
        zahyou_W[width - 1] += 1

    CTR_H = collections.Counter(zahyou_H)
    CTR_W = collections.Counter(zahyou_W)

    max_h = max(zahyou_H)
    max_w = max(zahyou_W)

    len_h = CTR_H[max_h]
    len_w = CTR_W[max_w]

    index_h = [i for i, x in enumerate(zahyou_H) if x == max_h]
    index_w = [i for i, x in enumerate(zahyou_W) if x == max_w]


    maxi = max_h + max_w
    FLAG = False


    if (len_h == 1 and len_w == 1):    
        maxi -= zahyou[index_h[0]][index_w[0]]


    else:
        for i in range(len_h):        
            for j in range(len_w):
                val = zahyou[index_h[i]][index_w[j]]
                
                if (val == 0):
                    FLAG = True
                    break
        
        if (not FLAG):
            maxi -= 1

    print(maxi)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import numpy as np
import numba
import sys
from numba import njit, b1, i4, i8, f8

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


@njit((i8, i8, i8[:]), cache=True)
def main(Height, Width, XY):
    UP = 300010
    row = np.zeros(UP, np.int64)
    col = np.zeros(UP, np.int64)
    
    for i in range(0, len(XY), 2):
        x, y = XY[i:i + 2] - 1
        row[x] += 1
        col[y] += 1
    
    row_max = row.max()
    col_max = col.max()

    judge = np.sum(row == row_max) * np.sum(col == col_max)

    for i in range(0, len(XY), 2):
        x, y = XY[i:i + 2] - 1
        
        if (row[x] == row_max and col[y] == col_max):
            judge -= 1
    
    summ = row_max + col_max
    
    return (summ if judge else summ - 1)


Height, Width, M_ko = map(int, readline().split())
XY = np.array(read().split(), np.int64)

ans = main(Height, Width, XY)
print(ans)
s = input()
n = len(s)
cand = []

def func(ac,yet,sum):
  next = int(yet[0])
  
  
  if len(yet) ==1:
    cand.append(sum+ ac+ next)
    cand.append(sum+ ac*10+ next)
  else:
    func(next, yet[1:],ac+sum)
    func(ac*10+next, yet[1:],sum)

func(int(s[0]),s[1:],0)
print(sum(cand))

### FIXED CODE ###

s = input()
n = len(s)
ans = 0

for i in range(2**(n-1)):
  form = s
  bit = []
  for _ in range(n-1):
    bit.append(i%2)
    i =  i//2

  for j in range(n-1):
    if bit[j]:
      form = form[:n-j-1] + '+' + form[n-j-1:]

    
  ans += eval(form)
print(ans)
import sys
input = sys.stdin.readline

_a, _b = map(int, input().split())


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

    return a


def chker(a, b):
    if gcd(a, b) == 1:
        print(1)
        return

    if min(a, b) == 2:
        print(2)
        return

    klist = [item for item in range(1, int(min(_a, _b) ** (1 / 2)) + 1) if _a % item == 0 and _b % item == 0]
    slist, klist = [klist[1]], klist[1:]
    for item1 in klist:
        tag = 0
        for item2 in slist:
            if item1 % item2 == 0:
                tag = 1
                break

        if tag == 0:
            slist.append(item1)

    print(len(slist) + 1)


chker(_a, _b)


### FIXED CODE ###

import sys
input = sys.stdin.readline

_a, _b = map(int, input().split())


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

    return a


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

    return sorted(dvlist)


def chker(a, b):
    a, b = min(a, b), max(a, b)
    mindiv = get_divisor(a)
    shdvlist = [item for item in mindiv if b % item == 0]
    if len(shdvlist) < 3:
        print(len(shdvlist))
        return

    slist, shdvlist = [shdvlist[1]], shdvlist[1:]
    for item1 in shdvlist:
        flg = 0
        for item2 in slist:
            if item1 % item2 == 0:
                flg = 1
                break

        if flg == 0:
            slist.append(item1)

    print(len(slist) + 1)


chker(_a, _b)
while True:
	w, h = map(int, raw_input().split())
	if h == 0 and w == 0: break
	for y in range(0, h):
		for x in range(0, w):
			print "#",
		print 

### FIXED CODE ###

n = raw_input()
arrry  = raw_input().split()
numList = reversed(arrry)
for n in numList:
	print n,
print
def main():
    n,k = map(int,input().split())
    a = list(map(int,input().split()))
    ary = [0]
    tmp = [0] * n
    tmp[0] = 1
    now = 0
    for cnt in range(1,k+1):
        now = a[now] - 1
        ary.append(now)
        if tmp[now] != 0:
            break
        else:
            tmp[now] = cnt + 1
    m = (k - tmp[now]-1) % (cnt - tmp[now])
    print(ary[m+cnt-tmp[now] -1] + 1 )



if __name__=='__main__':
    main()


### FIXED CODE ###

def main():
    n,k = map(int,input().split())
    a = list(map(int,input().split()))
    cnt = [-1] * n
    cnt[0] = 0
    ary = []
    now = 0
    for i in range(n):
        a[i] -= 1

    ary.append(now)
    if k <= n:
        for i in range(1,k+1):
            now = a[now]
            if i == k:
                print(now+1)
                return
    else:
        for i in range(1,k+1):
            now = a[now]
            if cnt[now] != -1:
                break
            else:
                cnt[now] = i
                ary.append(now)
        loop_s = cnt[now]

        print(ary[cnt[now] +((k-cnt[now]) % (i - cnt[now]))] + 1)
        # print(cnt)
        # print(now)
        # print(ary)

if __name__=='__main__':
    main()
a,b=map(int,input().split)
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else a == b:
    print("a == b")

### FIXED CODE ###

a,b=map(int,input().split())
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
s, _, q = open(0)
g = ""
for q in q:
  p, f, c = q.split()
  if p == "1":
    g, s = s, g
  else:
    if f == "1":
      g += c
    else:
      s += c
print(g[::-1] + s)

### FIXED CODE ###

#!/usr/bin/env python3
s, _, *q = open(0)
g = ""
s = s.strip()
for q in q:
  q = q.strip().split()
  if q[0] == "1":
    g, s = s, g
  else:
    if q[1] == "1":
      g += q[2]
    else:
      s += q[2]
print(g[::-1] + s)
n = int(input())
import collections
co = collections.Counter()
for i in range(n):
    co[input()] +=1
print(f"AC x {co["AC"]}")
print(f"WA x {co["WA"]}")
print(f"TLE x {co["TLE"]}")
print(f"RE x {co["RE"]}")


### FIXED CODE ###

n = int(input())
import collections
co = collections.Counter()
for i in range(n):
    s = input()
    co[s] +=1
print(f"AC x {co['AC']}")
print(f"WA x {co['WA']}")
print(f"TLE x {co['TLE']}")
print(f"RE x {co['RE']}")
a,b = map(raw_input().split())

if a > b:
  print "a > b"

if a < b:
  print "a < b"

else:
  print "a == b"

### FIXED CODE ###

a,b = map(int, raw_input().split())
 
if a > b:
  print 'a > b'
 
elif a < b:
  print 'a < b'
 
else:
  print 'a == b'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	D_fix
# CreatedDate:  2020-02-21 01:20:19 +0900
# LastModified: 2020-02-21 02:04:42 +0900
#


import os
import sys
import numpy as np
import pandas as pd
def make_matrix(matrix,a,b,c):
    matrix[a-1][b-1] = c
    matrix[b-1][a-1] = c
def initial_signal(i,matrix):
    d = [100]*(matrix.shape[0])
    d[i] = 0
    Q = []
    for j in range(matrix.shape[0]):
        Q.append([j,100])
    Q[i][1]=0
    Q.sort()
    return d,Q

def relax(matrix,u,v,d,Q):
    if d[v] > d[u[0]]+matrix[u[0]][v]:
        d[v] = d[u[0]]+matrix[u[0]][v]
        for i,tmp in enumerate(Q):
            if Q[i][0]==v:
                Q[i][1] = d[u[0]]+matrix[u[0]][v]


def dijkstra(i,matrix):
    d,Q = initial_signal(i,matrix)
    S = []
    while Q:
        Q.sort(key=lambda x: x[1])
        u = Q.pop(0)
        S.append(u)
        for v in range(matrix.shape[0]):
            if matrix[u[0]][v]!=0:
                relax(matrix,u,v,d,Q)
    return d
    

def main():
    N,M = map(int, input().split())
    matrix = np.zeros((N,N),dtype=np.int32)
    for _ in range(M):
        a,b,c = map(int,input().split())
        make_matrix(matrix,a,b,c)
    shortest = []
    for i in range(matrix.shape[0]):
        short = dijkstra(i,matrix)
        shortest.append(short)
    ans=0
    for i in range(N):
        for j in range(N):
            cost = matrix[i][j]
            if cost>shortest[i][j]:
                ans+=1

    print(ans//2)


if __name__ == "__main__":
    main()


### FIXED CODE ###

## https://atcoder.jp/contests/abc051/submissions/3281251
import heapq

def dijkstra(graph, node, start):
    dist = [float("inf") for _ in range(node)]
    
    dist[start] = 0
    q = []
    heapq.heappush(q, (0, start))
    
    while q:
        cost, cur_node = heapq.heappop(q)
        
        if dist[cur_node] < cost:
            continue
        
        for nex_cost, nex_node in graph[cur_node]:
            dist_cand = dist[cur_node] + nex_cost
            if dist_cand < dist[nex_node]:
                dist[nex_node] = dist_cand
                heapq.heappush(q, (dist[nex_node], nex_node))

    return dist

def main():
    n, m = map(int, input().split())
    adj = [[] for _ in range(n)]
    for i in range(m):
        a, b, c = map(int, input().split())
        a -= 1
        b -= 1
        adj[a].append((c, b))
        adj[b].append((c, a))
    shortest = []
    for i in range(n):
        shortest.append(dijkstra(adj, n, i))
    ans = 0
    for i in range(n):
        for cost, j in adj[i]:
            if cost > shortest[i][j]:
                ans += 1
    print(ans // 2)
                                                                                                                                                                                                     
if __name__=='__main__':
    main()
N = int(input())
list = []
for i in range(N):
  list.append(int(input()))

M = 1


for i in range(1, N):
  k = list[i]
  t_list = list[0:i+1]
  a_list = sorted(t_list, reverse=True)
  if a_list[0] == k:
    M += 1

print(M)

### FIXED CODE ###

N = int(input())
list = input().split()
ans = 0
maxHeight = -1
for i in range(N):
  if int(list[i]) >= maxHeight:
    ans += 1
    maxHeight = int(list[i])
print(ans)
a, b, c = map(int, input().split())
print("A"+b[0]+"C")

### FIXED CODE ###

a, b, c = map(str, input().split())
print("A"+b[0]+"C")
T1,T2 = map(int,input().split())
A1,A2 = map(int,input().split())
B1,B2 = map(int,input().split())
dif = T1*A1+T2*A2-T1*B1-T2*B2
if dif==0:
    print("infinity")
elif dif>0:
    if B1>A1:
        k = int(((B1-A1)*T1)/dif)
        if abs(((B1-A1)*T1)/dif-round(((B1-A1)*T1)/dif))<1e-20:
            print(2*round(((B1-A1)*T1)/dif))
        else:
            print(2*k+1)
    else:
        print(0)
else:
    if A1>B1:
        k = int(((A1-B1)*T1)/abs(dif))
        if abs((A1-B1)*T1/abs(dif)-round(((A1-B1)*T1)/abs(dif))<1e-20:
            print(2*round(((A1-B1)*T1)/abs(dif)))
        else:
            print(2*k+1)
    else:
        print(0)

### FIXED CODE ###

T1,T2 = map(int,input().split())
A1,A2 = map(int,input().split())
B1,B2 = map(int,input().split())
dif = T1*A1+T2*A2-T1*B1-T2*B2
if dif==0:
    print("infinity")
elif dif>0:
    if B1>A1:
        k = int(((B1-A1)*T1)/dif)
        if abs(((B1-A1)*T1)/dif-round(((B1-A1)*T1)/dif))<1e-20:
            print(2*round(((B1-A1)*T1)/dif))
        else:
            print(2*k+1)
    else:
        print(0)
else:
    if A1>B1:
        k = int(((A1-B1)*T1)/abs(dif))
        if abs((A1-B1)*T1/abs(dif)-round(((A1-B1)*T1)/abs(dif)))<1e-20:
            print(2*round(((A1-B1)*T1)/abs(dif)))
        else:
            print(2*k+1)
    else:
        print(0)
from bisect import bisect

X, N = [int(n) for n in input().split()]
if N==0:
    print(X)
else:
    P = sorted([int(n) for n in input().split()])
    idx = bisect(P, X)
    for i in range(P[idx-1], 101):
        if i not in P:
            ans_r = i
            break
    for j in range(1, P[idx-1]):
        if j not in P:
            ans_l = j
    if abs(X-ans_l) == abs(ans_r-X):
        print(min([ans_l, ans_r]))
    else:
        print(ans_l if abs(X-ans_l) < abs(ans_r-X) else ans_r)


### FIXED CODE ###

from bisect import bisect

X, N = [int(n) for n in input().split()]
if N==0:
    print(X)
else:
    P = sorted([int(n) for n in input().split()])
    if X not in P:
        print(X)
        exit()
    idx = bisect(P, X)
    ans_r = 101
    ans_l = 0
    for i in range(P[idx-1], 101):
        if i not in P:
            ans_r = i
            break
    for j in range(1, P[idx-1]):
        if j not in P:
            ans_l = j
    if abs(X-ans_l) == abs(ans_r-X):
        print(min([ans_l, ans_r]))
    else:
        print(ans_l if abs(X-ans_l) < abs(ans_r-X) else ans_r)
N = int(input())
p_f = [0]
p_b = [0]
for p in list(map(float,input().split())):
    p_f.append(p)
    p_b.append(1.0-p)

p_majority = 0.0
n_majority = N // 2 + 1

def cointoss(n_toss,n_front,n_back,p):
    global p_majority
    n_toss += 1
    #print(n_toss,n_front,n_back,p,p_majority,n_majority)
    if n_front+1 == n_majority:
        p_majority = p_majority + p * p_f[n_toss]
    else:
        cointoss(n_toss, n_front+1, n_back, p*p_f[n_toss])
    if n_back+1 == n_majority:
        return
    cointoss(n_toss, n_front, n_back+1, p*p_b[n_toss])

cointoss(0,0,0,1.0)
print(p_majority)


### FIXED CODE ###

N = int(input())
p_f = [0.0]
p_b = [0.0]
for p in list(map(float,input().split())):
    p_f.append(p)
    p_b.append(1.0-p)

#一次軸：コイントスの回数、二次軸：勝ち数、値：発生確率
dp = [[0.0] * (N+1) for i in range(N+1)]
dp[0][0] = 1.0

def cointoss(n_toss):
    global p_majority
    for i in range(n_toss):
        dp[n_toss][i+1] += dp[n_toss-1][i] * p_f[n_toss]
        dp[n_toss][i  ] += dp[n_toss-1][i] * p_b[n_toss]

for i in range(1,N+1):
    cointoss(i)

p_majority = 0.0
n_majority = N // 2 + 1

for i in range(n_majority,N+1):
    p_majority += dp[N][i]

print(p_majority)
n,x,t=map(int,input().split())
m=math.ceil(n/x)*t

### FIXED CODE ###

import math
n,x,t=map(int,input().split())
m=math.ceil(n/x)*t
print(m)
n = int(input())
h = [int(v) for v in input().split()]

cost = [0 for _ in range(10001)]
for i in range(1,n):
  cost[i] = cost[i-1] + abs(h[i]-h[i-1])
  if i > 1:
    cost[i] = min(cost[i],cost[i-2]+abs(h[i] - h[i-2]))

print(cost[n-1])

### FIXED CODE ###

n = int(input())
h = [int(v) for v in input().split()]
c = [0,abs(h[0]-h[1])]

for i in range(1,n-1):
  cost1 = c[i-1] + abs(h[i-1] - h[i+1])
  cost2 = c[i] + abs(h[i]-h[i+1])
  c.append(min(cost1,cost2))

print(c[-1])
N = int(input()) 
A = list(map(int,input().split()))
c = 1
for i in N-1:
  c *= A[i]
print(c)
if c >= 10**18:
print(-1)


### FIXED CODE ###

n=int(input())
ls=[int(s) for s in input().split(" ")]

if 0 in ls:
  print(0)
else:
  num=1
  for i in ls:
    num*=i
    if num>10**18:
      num=-1
      break

  print(num)
A = int(input())
B = int(input())
C = int(input())
D = int(input())
sum = 0

if A > B:
	sum += B
elif :
	sum += A
if C > D:
	sum += D
elif :
	sum += C
	
print(sum)


### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())
sum = 0

if A > B:
	sum += B
else:
	sum += A
if C > D:
	sum += D
else :
	sum += C
	
print(sum)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from EmurateInput import input
import functools

@functools.lru_cache(maxsize=None)
def factorial(N):
    if N == 0:
        return 1
    if N == 1:
        return 1
    else:
        return N * factorial(N - 1)


def c(n, r):
    if n < r:
        return 0
    return factorial(n) // (factorial(r) * factorial(n-r))


N, M = [int(x) for x in input().split()]

print(
    c(N, 2) + c(M, 2)
)


### FIXED CODE ###

import functools

@functools.lru_cache(maxsize=None)
def factorial(N):
    if N == 0:
        return 1
    if N == 1:
        return 1
    else:
        return N * factorial(N - 1)


def c(n, r):
    if n < r:
        return 0
    return factorial(n) // (factorial(r) * factorial(n-r))


N, M = [int(x) for x in input().split()]

print(
    c(N, 2) + c(M, 2)
)
a=input()
if a[3]!=8:
    a[3]=8
    print(a)
else:
    print(a)

### FIXED CODE ###

a=input()
print("2018"+a[4:])
# -*- coding: utf-8 -*-
import math

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

[A, B] = [int(i) for i in input().split()]

print(lcm(A, B))

### FIXED CODE ###

# -*- coding: utf-8 -*-

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

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

[A, B] = [int(i) for i in input().split()]

print(lcm(A, B))
N = int(input(N))
print(int(N+1)/2)

### FIXED CODE ###

N = int(input())
print(int((N+1)/2))
n = int(input())
s = set()
q = [0,0]
import heaps as hq
for a in map(int, input().split()):
  if a > q[0]:
    if a in s:
      del s[a]
      hq.heapreplace(q, a)
    else:
      s.add(a)

print(q[0]*q[1])

### FIXED CODE ###

n = int(input())
s = set()
q = [0,0]
import heapq as hq
for a in map(int, input().split()):
  if a > q[0]:
    try:
      s.remove(a)
      hq.heapreplace(q, a)
    except:
      s.add(a)

print(q[0]*q[1])
N = map(int, input().split())

for i in range(int(100/7)+1):
  for j in range(int(100/4)+1):
    if i*7 + j*4 == N:
      print('Yes')
      return
print('No')
      

### FIXED CODE ###

N = int(input())
res = 'No'
for i in range(int(100/7)+1):
	for j in range(int(100/4)+1):
		a = i*7 + j*4
		if int(N) == a:
			res='Yes'
print(res)
N, K = map(int, input().split())
S = input()
S[K-1] = S[K-1].lower()
print(S)

### FIXED CODE ###

N, K = map(int, input().split())
S = input()
print(S[0:K-1] + S[K-1].lower() + S[K:])
a = int(input())
b = []
sum = 0
for i in a:
  b[i] = int(input())
  sum += b[i]
print(reciprocal(reciprocal(sum)))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
sam = 0
for i in range(N):
  sam += A[i]**-1
print(sam**-1)
h=int(input())
ans=0
c=1
while h>1:
    ans+=c
    c*=2
    h//=2
ans+=c
print(ans)

### FIXED CODE ###

import math
h,a=map(int,input().split())
print(math.ceil(h/a))
n,a,t=map(int,input().split())
print(min(a*t,b))

### FIXED CODE ###

n,a,b=map(int,input().split())
print(min(a*n,b))
a = list(map(int, input().split())
if a.count(5) == 2 and a.count(7) == 1:
         print("Yes")
else:
         print("No")

### FIXED CODE ###

a = list(map(int, input().split()))
if a.count(5) == 2 and a.count(7) == 1:
         print("YES")
else:
         print("NO")