Harryxun/stf_run huggingface dataset:
N = int(input())
A = list(map(int,input().split()))
ans = [0] * N
for i,val in enumerate(A):
    ans[val-1] = i+1
print(' '.join(ans))

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = [0] * N
for i,val in enumerate(A):
    ans[val-1] = i+1
print(*ans)
import sys
input = sys.stdin.readline
import math


# 持っているビスケットを叩き、1枚増やす
# ビスケット A枚を 1円に交換する
# 1円をビスケット B枚に交換する
def main():
    s = input()
    n = len(s)
    cnt = 0
    ans = [0] * n
    for i, moji in enumerate(s):
        if moji == "R":
            cnt += 1
            continue
        else:
            even_num = cnt//2
            odd_num = cnt - even_num
            ans[i] += even_num
            ans[i-1] += odd_num
            cnt = 0

    cnt = 0
    for i in range(n-1, -1, -1):
        if s[i] == "L":
            cnt += 1
            continue
        else:
            even_num = cnt // 2
            odd_num = cnt - even_num
            ans[i] += even_num
            ans[i+1] += odd_num
            cnt = 0
    print(*ans)

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)


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


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()


### FIXED CODE ###

def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

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

def input_list_str():
  return list(map(str, input().split()))

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

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

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

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
  s = input()
  n = len(s)
  ans = [1]*n
  for i in range(0, n-2):
    if s[i] == "R" and s[i+1] == "R":
      ans[i+2] += ans[i]
      ans[i] = 0
  for i in range(n-1, -1, -1):
    if s[i] == "L" and s[i-1] == "L":
      ans[i-2] += ans[i]
      ans[i] = 0
  print(*ans)
  
import math
import fractions
import collections
import itertools
from functools import reduce
main()
import sys
sys.setrecursionlimit(10 ** 6)

nil = -1

class Node:
    def __init__(self, p, l, r):
        self.p = p
        self.l = l
        self.r = r

def depth_rec(u, p, depth):
    depth[u] = p
    if tree[u].r != nil:
        depth_rec(tree[u].r, p, depth)
    if tree[u].l != nil:
        depth_rec(tree[u].l, p + 1, depth)
    pass

n = int(sys.stdin.readline())

tree = [Node(nil, nil, nil) for i in range(n)]
depth = [0] * n

for i in range(n):
    line = [int(i) for i in sys.stdin.readline().split()]
    vertex = line[0]

    for (j, c) in enumerate(line[2:]):
        if j == 0:
            tree[vertex].l = c
        else:
            tree[l].r = c

        l = c
        tree[c].p = vertex

'''
for i in range(n):
    print(tree[i].p, tree[i].l, tree[i].r)
'''
for i in range(n):
    if tree[i].p == nil:
        root = i

depth_rec(root, 0, depth)

# print(depth)

for vtx in range(n):
    print("node {}: parent = {}, depth = {}, ".format(vtx, tree[vtx].p, depth[vtx]), end = "")

    if tree[vtx].p == nil:
        print("root, ", end = "")
    elif tree[vtx].l == nil:
        print("leaf, ", end = "")
    else:
        print("internal node, ", end = "")

    children = []
    child = tree[vtx].l

    while child != nil:
        children.append(child)
        child = tree[child].r

    print(children)

### FIXED CODE ###

import sys

nil = -1

def set_depth(v, depth):
    tree[v][2] = depth

    for child in tree[v][1]:
        set_depth(child, depth + 1)

n = int(input())

tree = [[nil, [], 0, 'leaf'] for i in range(n)]

for i in range(n):
    line = [int(i) for i in sys.stdin.readline().split()]
    t_id = line[0]
    children = line[2:]

    tree[t_id][1] = children

    if children:
        tree[t_id][3] = 'internal node'

    for child in children:
        tree[child][0] = t_id

for t_id in range(n):
    if tree[t_id][0] == nil:
        tree[t_id][3] = 'root'
        r = t_id
        break

# print(tree)

set_depth(r, 0)

for t_id in range(n):
    parent = tree[t_id][0]
    depth = tree[t_id][2]
    children = tree[t_id][1]
    type_t = tree[t_id][3]

    print('node {}: parent = {}, depth = {}, {}, {}'.format(
            t_id, parent, depth, type_t, children))
S_split = input().split('?')
n = len(S_split) - 1
s = ''
output = ''
large = 0
count = 0
for i in range(2**n):
    s = S_split[0]
    for j in range(n):
        if ((i >> j) & 1) == 1:
          if s[-1] == 'P':
            break
          s = s + 'P' + S_split[j+1]
        else:
          s = s + 'D' + S_split[j+1]
    count = s.count('D') + s.count('PD')
    if  count >= large:
      large = count
      output = s
print(output)

### FIXED CODE ###

T = input()
print(T.replace('?', 'D'))
for x in range(input()):
    x=raw_input()
    x=x[::-1]
    y=raw_input()
    y=y[::-1]
    z=[0]*81
    for i in xrange(len(x)):
        z[i]=int(x[i])
    for j in xrange(len(y)):
        z[j]=z[j]+int(y[j])
    for k in xrange(max(len(x),len(y))):
        sum=z[k]
        z[k]=sum%10
        z[k+1]+=sum/10
    z.reverse()
    for j in xrange(len(z)):
        if z[0]==0:
            z.pop(0)
        else:
            break
    print ''.join(map(str,z))

### FIXED CODE ###

for x in range(input()):
    x=raw_input()
    x=x[::-1]
    y=raw_input()
    y=y[::-1]
    z=[0]*81
    if len(x)>80 or len(y) >80:
        print 'overflow'
    else:
        for i in xrange(len(x)):
            z[i]=int(x[i])
        for j in xrange(len(y)):
            z[j]=z[j]+int(y[j])
        for k in xrange(max(len(x),len(y))):
            sum=z[k]
            z[k]=sum%10
            z[k+1]+=sum/10
        z.reverse()
        if z[0]!=0:
            print 'overflow'
        else:
            for j in xrange(len(z)):
                if z[0]==0:
                    z.pop(0)
                else:
                    break
            if len(z)==0:
                print 0
            else:
                print ''.join(map(str,z))
if int(input()) == 2:
  print(int(input())+int(int(input())
else:
  print('Hello World')
  

### FIXED CODE ###

if int(input()) == 2:
  print(int(input())+int(input()))
else:
  print('Hello World')
r, g, b = map(int, input().split)
 
number = r * 100 + g * 10 + b
 
if number % 4 == 0:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

r, g, b = map(int, input().split())
 
number = r * 100 + g * 10 + b
 
if number % 4 == 0:
  print("YES")
else:
  print("NO")
a=input()
b=input()
c=input()
if a == b:
    print(int(c))
elif a == c:
    print(int(b))
elif b == c:
    print(int(a))

### FIXED CODE ###

a,b,c=map(int,input().split())
if a==b:
    print(c)
elif b==c:
  print(a)
else:
  print(b)
n = int(input())
l = list(map(int, input()))
def insertionSort(a, n):#配列aを挿入ソートで並び替える(昇順）
    for i in range(1,n-1):
        v = a[i]
        j = i - 1
        while  >= 0 and a[j] > v:
            a[j+1] = a[j]#a[i]の位置に詰めていく処理
            j -= 1
            print(" ".join(a))#１行ごとに出力
        a[j+1] = v

insertionSort(l,n)


### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
print(" ".join(map(str,l)))
def insertionSort(a, n):#配列aを挿入ソートで並び替える(昇順）
    for i in range(1,n):
        v = a[i]
        j = i - 1
        while j >= 0 and a[j] > v:
            a[j+1] = a[j]#a[i]の位置に詰めていく処理
            j -= 1
        a[j+1] = v
        print(" ".join(map(str,a)))#１行ごとに出力
insertionSort(l,n)
def tasu(x):
    return x / 2 * (x + 1)

def kitaiti(n , k , p):

    ans = 0
    count = 0
    kitai = [0]*n
    mod = 10**9+7

    for i in range(n):
        kitai[i] = round(tasu(p[i]) / p[i] , 6)

    for i in range(n - k + 1):

        if i == 0:
            count = sum(kitai[i:i+k]) % mod
        else:
            count -= kitai[i-1]
            count += kitai[i + k]
#        count = sum(kitai[i:i+k]) % mod
#       for w in range(i , i + k):
#            count += kitai[w]
#            count += tasu(p[w]) / p[w]
        ans = max(ans , count)

    return ans

def main():
    n , k = map(int , input().split())
    p = list(map(int,input().split()))
    print(kitaiti(n , k , p))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def tasu(x):
    return x / 2 * (x + 1)

def kitaiti(n , k , p):

    ans = 0
    count = 0
    kitai = [0]*n
    kitaisum = [0]*n
    mod = 10**9+7

    for i in range(n):
        kitai[i] = tasu(p[i]) / p[i]

    for i in range(n):
        if i == 0:
            kitaisum[i] += kitai[i]
        else:
            kitaisum[i] += kitai[i] + kitaisum[i-1]

    for i in range(n - k + 1):

        ans = max(ans , (kitaisum[i + k - 1] - kitaisum[i-1]) if i != 0 else kitaisum[i + k - 1])

    return ans

def main():
    n , k = map(int , input().split())
    p = list(map(int,input().split()))
    print(kitaiti(n , k , p))

if __name__ == '__main__':
    main()
s1,s2,s3 = map(int, input().split())
print(s1+s2+s3)


### FIXED CODE ###

s=input()
print(s.count("1"))
import itertools
import numpy as np
N,M,X=map(int, input().split())
book = []
for _ in range(N):
    book.append(list(map(int, input().split())))
book = np.array(book)
money=pow(10,7)
for i in itertools.product([0,1], repeat=N):
    book2=book
    dellist = []
    for n,l in enumerate(i):
        if l==0:
            dellist.append(n)
    book2=np.delete(book2, dellist, 0)
    ansar = np.sum(book2,axis=0)
    if np.sum(ansar[1:]>=X)==M:
        if money>ansar[0]:
            money = ansar[0]
if money == pow(10,6):
    print(-1)
else:
    print(money)


### FIXED CODE ###

S = input()
T = input()
if len(S)+1 ==len(T) and S ==T[:-1]:
    print('Yes')
else:
    print('No')
def cin():
	return map(int,input().split())

def cino(test=False):
    if not test:
        return int(input())
    else:
        return input()
def cina():
  return list(map(int,input().split()))


a,b,c  = cin()
p = -1
q = 1e9
r = -1
s = 1e9
for i in range(c):
  x,y,z = cin()
  if z==1:
    p = max(x,p)
  elif z==2:
    q = min(x,q)
  elif z==3:
    r = max(r,y)
  else:
    s = min(s,y)

if p==-1:
    p = 0
if q==1e9:
    q = a
if r==-1:
    r=0
if s==1e9:
    s=b

ans = (q-p)*(s-r)
if p>q or r>q:
    print(0)
else:
    print(ans)



### FIXED CODE ###

def cin():
	return map(int,input().split())

def cino(test=False):
    if not test:
        return int(input())
    else:
        return input()
def cina():
  return list(map(int,input().split()))



a = cina()
a.sort()
if a[0]+a[1]==a[2]:
  print("Yes")
else:
  print("No")
def flip(N, M, K, Mnum, Nnum, black):
    if black < 0 or black > K:
        return False
    if black == K:
        return True

    return flip(N, M, K, Mnum, Nnum+1, black+N-(Mnum*2)) or flip(N, M, K, Mnum+1, Nnum, black+M-(Nnum*2))

if __name__ == '__main__':
    inputs = input('> ').split()
    if flip(int(inputs[0]), int(inputs[1]), int(inputs[2]), 0, 0, 0):
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

N, M, k = tuple(int(i) for i in input().split(' '))
ans = 'No'
for a in range(N + 1):
    for b in range(M + 1):
        if M * a + N * b - 2 * a * b == k:
            ans = 'Yes'
            break
print(ans)
N = input()
import sys

rr = []
for line in sys.stdin:
    x, y = line.strip().split(" ")
    rr.append((int(x), int(y)))

mm = max([abs(x)+abs(y) for x, y in rr])

M = mm
ds = ['1'] * mm
#ds = ' '.join([1] * mm)
md = mm % 2
Rresult = []
for x, y in rr:
    if (x+y) % 2 != md:
        result = "-1"
        break
    else:
        result = ""
        result += "R" * x if x > 0 else "L" * abs(x)
        result += "U" * y if y > 0 else "D" * abs(y)
        result += "RL" * ((mm - abs(x) - abs(y))//2)
        Rresult.append(result)
if result == "-1":
    print(result)
else:
    print(M)
    print(' '.join(ds))
    print("\n".join(Rresult))


### FIXED CODE ###

import sys


denum = 39

ds = [pow(2, i) for i in range(denum)]
max_ds = sum(ds)

N = input()
rr = []
for line in sys.stdin:
    x, y = line.strip().split(" ")
    rr.append((int(x) + int(y), int(x) - int(y)))

md = rr[0][0] % 2
if md == 0:
    ds = [1] + ds
Rresult = []
for u, v in rr:
    if u % 2 != md:
        result = "-1"
        break
    result = ""
    if md == 0:
        result = result + "R"
        u -= 1
        v -= 1
    u = (u + max_ds) // 2
    v = (v + max_ds) // 2
    binu = bin(u)[2:][::-1]
    binv = bin(v)[2:][::-1]
    for i in range(denum):
        ui = 0
        if i < len(binu):
            ui = int(binu[i])
        vi = 0
        if i < len(binv):
            vi = int(binv[i])
        #print(ui, vi)
        if ui == 1 and vi == 1:
            result = result + "R"
        if ui == 0 and vi == 0:
            result = result + "L"
        if ui == 1 and vi == 0:
            result = result + "U"
        if ui == 0 and vi == 1:
            result = result + "D"
    Rresult.append(result)

ds = [str(x) for x in ds]
if result == "-1":
    print(result)
else:
    print(len(Rresult[0]))
    print(' '.join(ds))
    print("\n".join(Rresult))
import numpy as np

N, K = [int(a) for a in input().split()]
A = [int(a) for a in input().split()]

K_str = format(K, 'b')
max_order = len(K_str)

B = np.array([list(format(a, '0{}b'.format(max_order)))
              for a in A]
             ).astype('i')[:, :max_order]
B = B.sum(axis=0)
B = np.where(B < N/2, 1, 0)

X_str = ''.join(map(str, B))
X = int(X_str, 2)

print(sum(map(lambda a: X ^ a, A)))

### FIXED CODE ###

import numpy as np

N, K = [int(a) for a in input().split()]
A = [int(a) for a in input().split()]

K = format(K, 'b')
B = [format(a, 'b') for a in A]
max_order = len(max(B + [K], key=len))

K = K.zfill(max_order)
B = np.array([list(b.zfill(max_order)) for b in B], dtype='i')
B = B.sum(axis=0)
B = np.where(B < N/2, '1', '0')

for i, k, b in zip(range(max_order), K, B):
    if k < b:
        B[i] = '0'
    elif k > b:
        break

X = int(''.join(map(str, B)), 2)

print(sum(map(lambda a: X ^ a, A)))
N,K=map(int,input().split())
A=sorted(list(map(int,input().split()))).reverse()
ans=0
for i in range K:
  ans+=A[i]
  
print(ans)

### FIXED CODE ###

N,K=map(int,input().split())
A=sorted(list(map(int,input().split())))
A.reverse()
ans=0
for i in range(K):
  ans+=A[i]
  
print(ans)
a, b c = map(int, input().split())
print(min(a, b+c))

### FIXED CODE ###

a, b, c = map(int, input().split())
print(max(0, c-(a-b)))
N,M==map(int,input().split)
if N==M:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N,M=map(int,input().split())
if N==M:
  print('Yes')
else:
  print('No')
import numpy as np
from bisect import *
n, m = map(int, input().split())
A, B, C = zip(*(map(int, input().split()) for _ in range(n)))
D, E, F = zip(*(map(int, input().split()) for _ in range(m)))
X = sorted(set(C + E + F))
Y = sorted(set(A + B + D))
H = len(Y)-1
W = len(X)-1
def TX(i):
    return bisect(X, i)-1
def TY(i):
    return bisect(Y, i)-1
U = np.ones((H+1, W))
for d, e, f in zip(D, E, F):
    d, e, f = TY(d), TX(e), TX(f)
    U[d, e:f] = False
L = np.ones((H, W+1))
for a ,b, c in zip(A, B, C):
    a, b, c = TY(a), TY(b), TX(c)
    L[a:b, c] = False
S = np.outer(np.diff(X), np.diff(Y)) 
i = bisect(Y, 0)-1
j = bisect(X, 0)-1
s = [(i,j)]
v = set()
r = 0
while s:
    i, j = s.pop()
    if (i,j) in v:
        continue
    v.add((i,j))
    if not (0<=i<H and 0<=j<W):
        print('INF')
        break
    r += S[i][j]
    if U[i][j]:
        s.append((i-1,j))
    if U[i+1][j]:
        s.append((i+1,j))
    if L[i][j]:
        s.append((i,j-1))
    if L[i][j+1]:
        s.append((i,j+1))
else:
    print(r)


### FIXED CODE ###

import numpy as np
from numba import njit
from bisect import *
n, m = map(int, input().split())
A, B, C = zip(*(map(int, input().split()) for _ in range(n)))
D, E, F = zip(*(map(int, input().split()) for _ in range(m)))
X = sorted(set(C))
Y = sorted(set(D))
H = len(Y)-1
W = len(X)-1
def TX(i):
    return bisect(X, i)-1
def TY(i):
    return bisect(Y, i)-1
U = np.ones((H+1, W))
for d, e, f in zip(D, E, F):
    #d, e, f = TY(d), TX(e), TX(f)
    d = TY(d)
    e = bisect_left(X, e)
    f = bisect_right(X, f)-1
    U[d, e:f] = False
L = np.ones((H, W+1))
for a ,b, c in zip(A, B, C):
    #a, b, c = TY(a), TY(b), TX(c)
    c = TX(c)
    a = bisect_left(Y, a)
    b = bisect_right(Y, b)-1
    L[a:b, c] = False
S = np.outer(np.diff(Y), np.diff(X))
@njit
def dfs(i, j):
    s = [(i,j)]
    v = np.zeros((H,W))
    r = 0
    while s:
        i, j = s.pop()
        if not (0<=i<H and 0<=j<W):
            return -1
        if v[i,j]:
            continue
        v[i,j] = True
        r += S[i,j]
        if U[i,j]:
            s.append((i-1,j))
        if U[i+1,j]:
            s.append((i+1,j))
        if L[i,j]:
            s.append((i,j-1))
        if L[i,j+1]:
            s.append((i,j+1))
    return r
r = dfs(TY(0), TX(0))
print('INF' if r<0 else r)
from collections import Counter

n = int(input())
s = input()
x, y, z = Counter(s).values()
print(x * y * z - sum(s[i] != s[(i + j) // 2] != s[j] != s[i]
                      for i in range(n) for j in range(i + 2, n, 2))) 


### FIXED CODE ###

from collections import Counter

n = int(input())
s = input()
c = Counter({'R': 0,'G': 0, 'B': 0})
c.update(s)
x, y, z = c.values()
print(x * y * z - sum(s[i] != s[(i + j) // 2] != s[j] != s[i]
                      for i in range(n) for j in range(i + 2, n, 2)))
N = int(input())
A = [int(input()) for i in range(N)]
odd = 0
for i in range(len(A)) :
    a = A[i]
    if a % 2 != 0 :
        odd += 1
        break
if odd == 1 :
    print("first")
else :
    print("second")
    

### FIXED CODE ###

N,P = map(int,input().split())
from collections import Counter
def factorize(n) :
    d = Counter()
    m = 2
    while m*m <= n :
        while n%m == 0 :
            n //= m
            d[m] += 1
        m += 1
    if n > 1 :
        d[n] += 1
    return d

factors = factorize(P)
ans = 1
for k,v in factors.items() :
    a = v//N
    ans *= k**a
print(ans)
bilding = [[[0 for i in range(10)] for j in range(3)]for k in range(4)]

n = int(input())
i = 0
while i < n:
    b, f, r, v = map(int, raw_input().split())
    bilding[r][f][b] += v
    i += 1

i = 0
j = 0
k = 0
while i < 4:
    while j < 3:
        floar = ""
        while k < 10:
            k += 1
        print floar
        j += 1
    if i < 3:
        print "####################"
    i += 1

### FIXED CODE ###

bilding = [[[0 for x in range(10)] for x in range(3)]for x in range(4)] 
n = int(input())
for k in range(n):
    b, f, r, v = map(int, raw_input().split())
    bilding[b-1][f-1][r-1] += v

for b in range(4):
    for f in range(3):
        print(" "+" ".join(map(str, bilding[b][f])))
    if b != 3:
        print("#"*20)
a,b,c=map(int,input().split())


total =sum([a,b,c])


if sum_A%3==0:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

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

max_des = max(A)

A.remove(max_des)

if sum(A)==max_des:
    print('Yes')
else:
    print('No')
x, y ,z = input().split(,)
print(x, y, z)

### FIXED CODE ###

a, b, c = input().split(",")
print(a, b, c)
A,P = map(int,input().split())
p = A*3 + p
print(p//2)

### FIXED CODE ###

A,P = map(int,input().split())
p = A*3 + P
print(p//2)
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 + a.index(input()):  
  print("YES")
  else:
    print("NO")
    
    

### FIXED CODE ###


    
s = input()
t = input()

if t[:-1] == s:
    print("Yes")
else:
    print("No")
def check(N, K):
    if N - 1 == K:
        print(N-1)
        for i in range(i + 2, N + 1):
            print(1, i)
        return
    elif N - 2 == K:
        print(N-1)
        for i in range(1, N):
            print(i, i+1)
        return
    elif N-2 > K:
        print(-1)
        return
    else:
        print(-1)
        return



if __name__ == "__main__":
    N, K = map(int, input().split())
    check(N, K)


### FIXED CODE ###

def check(N, K):
    if K <= (N - 1)*(N-2) /2:
        k = int((N - 1)*(N-2)/2 - K)
        print(N-1 + k)
        for i in range(2, N+1):
            print(1, i)
        l = 2
        r = 3
        if k != 0:
            for i in range(k):
                if l > N or r > N:
                    break
                print(l, r)
                r+=1
                if r == N+1:
                    l+=1
                    r=l+1
        return
    else:
        print(-1)
        return


if __name__ == "__main__":
    N, K = map(int, input().split())
    check(N, K)
def main():
 
    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])
    if N == 1:
        return sc[0][1]
 
    for v in range(pow(10, N-1), pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1
 
if __name__ == '__main__':
    print(main())

### FIXED CODE ###

def main():

    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])

    start = pow(10, N-1)
    if N == 1: start = 0
    
    for v in range(start, pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())
n = int(input())
	s = []
	d = {}
	ans = 0
	for _ in range(n):
		s.append(input())
	for i in s:
		if not d.get(i):
			ans += 1
			d[i] = True
	print(ans)
resolve()

### FIXED CODE ###


def resolve():
	n = int(input())
	s = []
	d = {}
	ans = 0
	for _ in range(n):
		s.append(input())
	for i in s:
		if not d.get(i):
			ans += 1
			d[i] = True
	print(ans)
resolve()
a, b = map(int, input().split())
if a > b:
	print(“a > b”)
elif a < b:
	print(“a < b”)
else:
	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")
N = int(input())

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

for i in range(1,N):
	v = A[i]
	j = i-1
	while j >= 0 and A[j] > v:
		A[j+1] = A[j]
		j -= 1
	A[j+1] = v
	B = [print(" ".join({A[k]})) for k in range(N)]

### FIXED CODE ###

N = int(input())

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

for i in range(1,N):
	print(" ".join(map(str, A)))
	v = A[i]
	j = i-1
	while j >= 0 and A[j] > v:
		A[j+1] = A[j]
		j -= 1
	A[j+1] = v
print(" ".join(map(str, A)))
w = input()
A = [0] * 26

for in in w:
    A[ord(i) - 97] += 1

flag = True
for a in A:
    if a % 2 == 1:
        flag = False


if flag == False:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

w = input()
A = [0] * 26

for i in w:
    A[ord(i) - 97] += 1

flag = True
for a in A:
    if a % 2 == 1:
        flag = False


if flag == False:
    print("No")
else:
    print("Yes")
A=input()
B=input()
C=input()
D=input()
if A<=B:
  min1=int(A)
else:
  min1=int(B)
if C<=D:
  min2=int(C)
else:
  min2=int(D)
  
print(min1+min2+"\n")


### FIXED CODE ###

A=int(input())
B=int(input())
C=int(input())
D=int(input())
if A<=B:
  min1=A
else:
  min1=B
if C<=D:
  min2=C
else:
  min2=D
  
print(min1+min2)