Harryxun/stf_run huggingface dataset:
l = [int(x) for x in input().rstrip().split(" ")]
result = [str(x) for x in sorted(l)]
print(" ".join(result))

### FIXED CODE ###

a, b, c = [int(x) for x in raw_input().split(" ")]
list =[a,b,c]
list_2 = []

for x in range(len(list)):
    mini = min(list)
    list_2.append(mini)
    list.remove(mini)

for x in range(0, len(list_2)):
    a = list_2[x]

    if x == 0:
        req = str(a) + " "
    else:
        req += str(a) + " "

q = req.rstrip()
print(q)
x,b,z = input().split()
a=int(x)
c=int(z)
while b!="?":
    if b=="+":
        print(a+c)
    elif b=="-":
        print(int(a)-int(c))
    elif b=="*":
        print(a*c)
    elif b=="/":
        print(int(a/c))
    a,b,c = input().split()

### FIXED CODE ###

x,b,z = input().split()
a=int(x)
c=int(z)
while b!="?":
    if b=="+":
        print(a+c)
    elif b=="-":
        print(int(a)-int(c))
    elif b=="*":
        print(a*c)
    elif b=="/":
        print(int(a/c))
    x,b,z = input().split()
    a=int(x)
    c=int(z)
N, M = map(int,input().split())

tg = [input() for _ in range(N)]

#tmpl0〜M-1
tmpl = [input() for _ in range(M)]

#tg0〜N-Mにつき、tmpl0を探し、一致したら同じ添字のtmpl1~M-1を探す
for i in range(0,N-M+1):
  for j in range(0,N-M+1):
    if tmpl[0] == tg[i][j:j+M]:
      for k in range(i+1,i+M):
        if tmpl[k] != tg[i+k][j:j+M]: break
      else:
        print('Yes')
        exit()
print('No')


### FIXED CODE ###

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

tg = [input() for _ in range(N)]

#tmpl0〜M-1
tmpl = [input() for _ in range(M)]

#tg0〜N-Mにつき、tmpl0を探し、一致したら同じ添字のtmpl1~M-1を探す
for i in range(0,N-M+1):
  for j in range(0,N-M+1):
    if tmpl[0] == tg[i][j:j+M]:
      if N == 1:
        print('Yes')
        exit()
      for k in range(1,M):
        if tmpl[k] != tg[i+k][j:j+M]: break
      else:
        print('Yes')
        exit()
print('No')
"use strict"

function Main(input) {
  input = input.trim().split('\n');
  const N = Number(input[0].trim());
  const B = input[1].trim().split(' ').map(Number);

  let cnt = N-2;
  let ret = B[0];
  for(let i=0; i<cnt; i++){
    ret += Math.min(B[i], B[i+1])
  }
  ret += B[cnt];
  console.log(ret);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

### FIXED CODE ###

import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    B = il()
    ret = B[len(B) - 1] + B[0]
    for n in range(N - 2):
        ret += min(B[n+1], B[n])
    print(ret)


if __name__ == '__main__':
    main()
import sys
sys.setrecursionlimit(2000)

input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, M = map(int, input().split())
mod = 10 ** 9 + 7
a = [0] * M
memo = [-1] * (N + 1)

for i in range(M):
	a[i] = int(input())

def step(n):
	if memo[n] >= 0:
		return memo[n]
	elif n < 2:
		memo[n] = 1
		return 1
	else:
		memo[n] = (step(n - 1) + step(n - 2)) % mod
		return memo[n]
			
for i in a:
	memo[i] = 0
	
print(step(N))

### FIXED CODE ###

import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

N, M = map(int, input().split())
mod = 10 ** 9 + 7
a = [0] * M
dp = [0] * (N + 2)
dp[0] = 1
dp[1] = 1

for i in range(M):
	a[i] = int(input())
	
now = 0
next = 0

for i in a:
	next = i
	for j in range(now + 1, next + 1):
		if j == i:
			dp[i] = 0
		else:
			dp[j] = (dp[j - 1] + dp[j - 2]) % mod
	
	now = next

next = N
for j in range(now + 1, next + 1):
		dp[j] = (dp[j - 1] + dp[j - 2]) % mod
print(dp[N])
#c 
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = [0] * M
B = [0] * M
for i in range(M):
    A[i], B[i] = map(int, input().split())
a=[1]*N
for x in range(M):
    if H[A[x]-1]>H[B[x]-1]:
        a[A[x]-1]*=1
        a[B[x]-1]*=0
    elifH[A[x]-1]==H[B[x]-1]:
        a[A[x]-1]*=0
        a[B[x]-1]*=0
    else:
        a[A[x]-1]*=0
        a[B[x]-1]*=1
sum=0
for y in a:
    sum+=y
print(sum)

### FIXED CODE ###

#c 
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = [0] * M
B = [0] * M
for i in range(M):
    A[i], B[i] = map(int, input().split())
a=[1]*N
for x in range(M):
    if H[A[x]-1]>H[B[x]-1]:
        a[A[x]-1]*=1
        a[B[x]-1]*=0
    elif H[A[x]-1]==H[B[x]-1]:
        a[A[x]-1]*=0
        a[B[x]-1]*=0
    else:
        a[A[x]-1]*=0
        a[B[x]-1]*=1
sum=0
for y in a:
    sum+=y
print(sum)
while(1):
    count =0
    inp = raw_input().split(" ")
    if inp == "0 0":
        break
    for i in range(1,int(inp[0])+1):
        for j in range(1,int(inp[0])+1):
            if i != j:
                sum = i + j
                if sum == int(inp[1]):
                    count += 1
    print count


### FIXED CODE ###

# coding: UTF-8
def find_comb(n,x):
    count = 0
    #探索
    for i in range(1,n-1):
        for j in range(i+1,n):
            k = x - i - j #←がi < j < k <= nを満たせばその時点で総和がxとなる
            if  j < k <= n:
                count += 1
    print count
while(1):
    n,x = map(int, raw_input().split(" "))
    if(n == 0 and x == 0):
        break
    find_comb(n,x)
from itertools import permutations

N, C = map(int, input().split())
D = [[int(x) for x in input().split()] for _ in range(C)]
c = [[int(x) for x in input().split()] for _ in range(N)]

n_color = [[0 for _ in range(3)] for _ in range(C)]
for i in range(N):
    for j in range(N):
        X = c[i][j] - 1
        n_color[(i + j + 2) % 3][X] += 1

ans = float('inf')
for paint in permutations(range(C), 3):
    cost = 0
    for ij3 in range(3):
        Y = paint[ij3]
        for X in range(C):
            cost += D[X][Y] * n_color[ij3][X]
    ans = min(ans, cost)
print(ans)

### FIXED CODE ###

from itertools import permutations

N, C = map(int, input().split())
D = [[int(x) for x in input().split()] for _ in range(C)]
c = [[int(x) for x in input().split()] for _ in range(N)]

n_color = [[0 for _ in range(C)] for _ in range(3)]
for i in range(N):
    for j in range(N):
        X = c[i][j] - 1
        n_color[(i + j + 2) % 3][X] += 1

ans = float('inf')
for paint in permutations(range(C), 3):
    cost = 0
    for ij3 in range(3):
        Y = paint[ij3]
        for X in range(C):
            cost += D[X][Y] * n_color[ij3][X]
    ans = min(ans, cost)
print(ans)
a = [int(input()) for i in range(n)]
m = max(a)
p = a.index(m)
s = max(a)
for i in range(n):
    if i != p:
        print(m)
    else:
        print(s)


### FIXED CODE ###

n = int(input())
a = [int(input()) for i in range(n)]
m = max(a)
p = a.index(m)
a.remove(m)
s = max(a)
for i in range(n):
    if i != p:
        print(m)
    else:
        print(s)
a=list(map(int, input().split()))
l=[a[0]]
if a[0]==1 or a[1]==1:
    print(0)
    exit()
def d(a,b):
    if a<b:
        if min(l)!=b-a:
            l.append(b-a)
            d(b-a,a)
        else:
            print(b-a)
            exit()
    elif b<a:
        if min(l)!=a-b:
            l.append(a-b)
            d(a-b,b)
        else:
            print(a-b)
            exit()
    else:
        print(0)
        exit()
d(a[0],a[1])

### FIXED CODE ###

a=list(map(int, input().split()))
def d(a,b):
    _1=a%b
    _2=b-(a%b)
    if _1<_2:
        print(_1)
    else:
        print(_2)
d(a[0],a[1])
print('Odd' if int(input())%2!=0 and int(input())%2!=0 else 'Even')

### FIXED CODE ###

a,b = map(int,input().split())
print('Odd' if a%2!=0 and b%2!=0 else 'Even')
inport math

r=input().strip()
print('{0:5f} {1:5f}'.format(r**2*math.pi,2*r*math.pi)


### FIXED CODE ###

import math

r=float(input().strip())
print('{0:5f} {1:5f}'.format(r**2*math.pi,2*r*math.pi))
a , b = map(int(),input().split())
 
X = ''
Y = ''
 
if a < b:
	for i in b:
		X = 'X' + 'a'
    print(X)
 
else:
	for v in a:
		Y = 'Y' + 'b'
	print(Y)

### FIXED CODE ###

a , b =input().split()
 
if a <= b:
    print(a*int(b))
else:
	print(b*int(a))
n = int(input())
input(s)
if s == s[n - 1:]:
    print("Yes")
    else
    print ("No")

### FIXED CODE ###

import sys

n = int(input())
s = input()
if n == 1:
  print("No")
  sys.exit()
n = n // 2
if s[:n]  == s[n:]:
    print("Yes")
else:
    print ("No")
X = int(input())
for i in range(-200, 200):
    for j in range(-200, 200):
        if i**5 - j**5 == X:
            print(i,j)
            exit()

### FIXED CODE ###

S = input()
print('ABC' if S =='ARC' else 'ARC')
k,x=map(int, input().split())
print(" ".join([x-k+i for i in range(1, 2k)]))

### FIXED CODE ###

k,x=map(int, input().split())
print(" ".join([str(x-k+i) for i in range(1, 2*k)]))
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = max(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

### FIXED CODE ###

import math
n = input()
a = list(map(int, input().split()))
ans = 0
for i in a:
    ans = ans + (len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))
A,B = map(int,input().split())
print(6-A-B)

### FIXED CODE ###

A = int(input())
B = int(input())
print(6-A-B)
N,Q=map(int,input().split())
tree=[[] for i in range(N)]

for i in range(N-1):
  a,b=map(int,input().split())
  if tree[a-1]==None:
    tree[a-1]=[b-1]
  else:
    tree[a-1].append(b-1)

point=[0]*N

def search(p,add):
  if p>=N:
    return
  else:
    point[p]=point[p]+add
    for j in range(len(tree[p])):
      search(tree[p][j],add)

for i in range(Q):
  p,x=map(int,input().split())
  p=p-1
  search(p,x)
  
print(*point)


### FIXED CODE ###

N,Q=map(int,input().split())
tree={}
for i in range(N-1):
  a,b=map(int,input().split())
  if (a-1) in tree:
    tree[a-1].append(b-1)
  else:
    tree[a-1]=[b-1]
  if (b-1) in tree:
    tree[b-1].append(a-1)
  else:
    tree[b-1]=[a-1]

point=[0]*N

for i in range(Q):
  p,x=map(int,input().split())
  point[p-1]+=x

ans=[0]*N
stack=[]
stack.append([0,0,-1])
while len(stack)>0:
  nodes=stack.pop()
  node=nodes[0]
  sump=nodes[1]
  parent=nodes[2]
  sump=sump+point[node]
  ans[node]=sump
  if node in tree:
      childs=tree[node]
      for child in childs:
        if child!=parent:
          stack.append([child,sump,node])

print(*ans)
import math
H,N=map(int,input().split())
A=[]
B=[]
for i in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)

#DP=[0]*(H+max(A)-1)#DPの箱をH+max(A)-1個用意する

DP=[math.inf]*(H+max(A)-1)#DPの箱をH+max(A)-1個用意する

for Ai in A:#すでにあるものを埋める
    DP[Ai-1]=Ai 

for dpi in range(H+max(A)-1):
    kouho=[]
    for Ai,Bi in zip(A,B):
        kouho.append(DP[dpi])
        if dpi-Ai>=0:
            kouho.append(DP[dpi-Ai]+Bi)
    DP[dpi]=min(kouho)


print(min(DP[H-1:]))

### FIXED CODE ###

h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

max_a = max(a for a, _ in ab)
dp = [0] * (h+max_a)

for i in range(0, h+max_a):
    if i <= 0:
        dp[i] = 0
    else:
        dp[i] = min(dp[i-a] + b for a,b in ab) 

print(min(dp[h:]))
A,B,C,D = [int(i) for i in input().split()]
import math
l= C * D / math.gcd(C, D)

s=B - A + 1 - ((B//C - (A-1)//C)+(B//D - (A-1)//D)-(B//l))
print(s)


### FIXED CODE ###

import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
abcd = input().split(" ")
a = int(abcd[0])
b = int(abcd[1])
c = int(abcd[2])
d = int(abcd[3])
cd = lcm(c, d)
print(b-a-(b//c-((a-1)//c + 1))-(b//d - ((a-1)//d + 1))+(b//cd-((a-1)//cd + 1)))
def dfs(cur_node, candidates, visited, level, cnt):

  while len(candidates) > 0:
    node, level = candidates.pop(0)

    if visited[node]: continue
    visited[node] = True

    if level > 0: cnt += 1

    for n in adj_list[node][FRIEND]:
      if n in adj_list[cur_node][BLOCK]:
        candidates.append((n, 0))
      if visited[n] == False:
        candidates.append((n, level+1))

  return cnt

# -----------------------------------------

FRIEND, BLOCK = 0, 1

N, F, B = list(map(int, input().split()))
adj_list = defaultdict(dict)
for i in range(1, N+1):
  adj_list[i][0] = set()
  adj_list[i][1] = set()

for _ in range(F):
  u, v = list(map(int, input().split()))
  adj_list[u][FRIEND].add(v)
  adj_list[v][FRIEND].add(u)

for _ in range(B):
  u, v = list(map(int, input().split()))
  adj_list[u][BLOCK].add(v)
  adj_list[v][BLOCK].add(u)

ans = []

for i in range(1, N+1):
  visited = [False] * (N+1)
  visited[i] = True
  candidates = []
  for node in adj_list[i][FRIEND]:
    # if status == FRIEND:
    # node, level
    candidates.append((node, 0))

  cnt = 0
  cnt = dfs(i, candidates, visited, 0, 0)
  ans.append(cnt)

print(" ".join([str(i) for i in ans]))

### FIXED CODE ###

class UF():
  def __init__(self, N):
    self.par = [-1] * N

  def union(self, x, y):
    p1,p2 = self.find(x), self.find(y)
    if p1 == p2: return

    if self.par[p1] > self.par[p2]:
      p1,p2 = p2,p1
    self.par[p1] += self.par[p2]
    self.par[p2] = p1

  def find(self, x):
    if self.par[x] < 0:
      return x
    else:
      self.par[x] = self.find(self.par[x])
      return self.par[x]

  def size(self, x):
    return -self.par[self.find(x)]

  def same(self, x, y):
    return self.find(x) == self.find(y)

N,M,K = map(int,input().split())
uf = UF(N)
adj = [ [] for _ in range(N)]
for _ in range(M):
  u,v = map(int,input().split())
  u -= 1
  v -= 1
  adj[u].append(v)
  adj[v].append(u)
  uf.union(u,v)

res = []
for n in range(N):
  res.append(uf.size(n) - 1 - len(adj[n]))

for _ in range(K):
  u,v = map(int,input().split())
  u -= 1
  v -= 1
  if uf.same(u,v):
    res[u] -= 1
    res[v] -= 1

print(" ".join(map(str, res)))
import math
x=int(input())
print(int(math.sqrt(x))**2)


### FIXED CODE ###

S=input()
T=input()
if [S[0],S[1],S[2]]==[T[2],T[1],T[0]]:
  print('YES')
else:
  print('NO')
a,b=map(int,input().split())
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
	return a
print(a*b//gcd(a,b))

### FIXED CODE ###

a,b=map(int,input().split())
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
print(a*b//gcd(a,b))
from collections import deque

N = int(input())
S = input()
ans = deque(S)
S += " "

ind = 0
for _ in range(N):
    if S[ind] == "(" and S[ind+1] == ")":
        ind += 2
        continue
    elif S[ind] == ")":
        ans.appendleft("(")
    elif S[ind] == "(":
        ans.append(")")
    ind += 1

print("".join(ans))

### FIXED CODE ###

from collections import deque

N = int(input())
S = input()
ans = deque(S)


while S.find("()") != -1:
    S = S.replace("()","")

for i in range(len(S)):
    if S[i] == ")":
        ans.appendleft("(")
    elif S[i] == "(":
        ans.append(")")
print("".join(ans))
n, w = map(int, input().split())
a = []
for _ in range(n):
    w_in, v_in = map(int, input().split())
    a.append([w_in, v_in])

dp = [[0 for _ in range(w + 1)] for _ in range(n + 1)]
for j in range(w + 1):
    for i in range(n):
        w_in, v_in = a[i]
        if j + w_in <= w:
            dp[i + 1][j + w_in] = max(dp[i + 1][j + w_in], dp[i][j] + v_in)
            if i + 2 <= n:
                dp[i + 2][j + w_in] = max(dp[i + 2][j + w_in], dp[i + 1][j + w_in])
        dp[i + 2][j] = max(dp[i + 2][j], dp[i + 1][j])
print(max([max(d) for d in dp]))

### FIXED CODE ###

from itertools import accumulate
n, w = map(int, input().split())
w_0, v_0 = map(int, input().split())
v_list = [[] for _ in range(4)]
v_list[0].append(v_0)
for _ in range(n - 1):
    w_in, v_in = map(int, input().split())
    v_list[w_in - w_0].append(v_in)
v_list = [[0] + list(accumulate(sorted(v, reverse=True))) for v in v_list]
ans = 0
for i in range(len(v_list[0])):
    for j in range(len(v_list[1])):
        for k in range(len(v_list[2])):
            for l in range(len(v_list[3])):
                if ((i) * w_0) + ((j) * (w_0 + 1)) + ((k) * (w_0 + 2)) + (((l) * (w_0 + 3))) <= w:
                    ans = max(ans, v_list[0][i] + v_list[1][j] + v_list[2][k] + v_list[3][l])
                else:
                    break
print(ans)
print('win' if sum(list(map(int,input())))) == 21 else 'bust')

### FIXED CODE ###

print('win' if sum(map(int,input().split())) <= 21 else 'bust')
N, M = map(int, input().split( ))
#print(N)
#print(M)
datas = list(map(int, input().split( )))
#print(datas)
datas.sort()
#print(datas)
Ms = M - 1

dest = list()
K = 0
i = 0
for i in range(Ms):
  K = datas[i+1] - datas[i]
  dest.append(K)
  dest.sort()
  #print(K)

#print(dest)
L = 0
MN = M - N
for j in range(MN):
  L = L + dest[j]

print(L)

### FIXED CODE ###

a, b = map(int, input().split( ))
k = round((a / b), 10)
print("{0:.10f}".format(k))
def solve():
    N = int(input())
    A = list(map(int, input().split(" ")))

    if judge(A) == 1:
        print(N - 1)
        for i in range(1, N):
            print(i, i + 1)
    elif judge(A) == -1:
        print(N - 1)
        for i in range(N, 1, -1):
            print(i, i - 1)
    elif judge(A) == 0:
        print(2 * N - 1)
        MAX = max(A)
        MAX_INDEX = A.index(MAX) + 1
        MIN = min(A)
        MIN_INDEX = A.index(MIN) + 1
        if abs(MAX) >= abs(MIN):
            for i in range(1, N + 1):
                print(MAX_INDEX, i)
            for i in range(1, N):
                print(i, i + 1)
        elif abs(MAX) < abs(MIN):
            for i in range(1, N + 1):
                print(MIN_INDEX, i)
            for i in range(N, 1, -1):
                print(i, i - 1)


solve()

### FIXED CODE ###

def judge(L):
    cnt_plus = 0
    cnt_minus = 0
    for l in L:
        if l >= 0:
            cnt_plus += 1
        else:
            cnt_minus += 1

    if cnt_plus == len(L):
        return 1
    elif cnt_minus == len(L):
        return -1
    else:
        return 0


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

    if judge(A) == 1:
        print(N - 1)
        for i in range(1, N):
            print(i, i + 1)
    elif judge(A) == -1:
        print(N - 1)
        for i in range(N, 1, -1):
            print(i, i - 1)
    elif judge(A) == 0:
        print(2 * N - 1)
        MAX = max(A)
        MAX_INDEX = A.index(MAX) + 1
        MIN = min(A)
        MIN_INDEX = A.index(MIN) + 1
        if abs(MAX) >= abs(MIN):
            for i in range(1, N + 1):
                print(MAX_INDEX, i)
            for i in range(1, N):
                print(i, i + 1)
        elif abs(MAX) < abs(MIN):
            for i in range(1, N + 1):
                print(MIN_INDEX, i)
            for i in range(N, 1, -1):
                print(i, i - 1)


solve()
n,m=[int(i) for i in input().split()]
l=[]
c=[input() for i in range(n)]
l=sorted(c)
b=l[0:m]
maxs=max(b)-min(b)
for i in range(0,(n-m)):
    b.pop(0)
    b.append(l[i+m])
    c=(max(b)-min(b))
    if(c<maxs):
        maxs=c
print(maxs)

### FIXED CODE ###

N, K = map(int, input().split())
h = sorted([int(input()) for i in range(N)])

hmax = 0
hmin = 0
ans = 10**10
for i in range(N - K + 1):
    hmax = h[i + K - 1]
    hmin = h[i]
    if hmax - hmin < ans:
        ans = hmax - hmin
print(ans)
a,b = map(int,input())
if a == 2 or b==2:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b = map(int,input().split())
if a == 2 or b==2:
  print("No")
else:
  print("Yes")
S = input()
pos_a = -1
pos_z = -1
for i in range(len(S)):
  if S[i] == 'A' and pos_a < 0:
    pos_a = i
  if S[len(S)-i] == 'Z' and pos_z < 0:
    pos_z = len(S)-i
  if pos_a >= 0 and pos_z > 0:
    break
print(pos_z-pos_a+1)

### FIXED CODE ###

S = input()
pos_a = -1
pos_z = -1
for i in range(len(S)):
  if S[i] == 'A' and pos_a < 0:
    pos_a = i
  if S[len(S)-i-1] == 'Z' and pos_z < 0:
    pos_z = len(S)-i-1
  if pos_a >= 0 and pos_z > 0:
    break
print(pos_z-pos_a+1)
x,n = map(int, input().split())
p = sorted(map(int, input().split()))
if p == []:
    print(x)
else:
    a = p[-1]
    d =[]
    e = 0
    E = 0
    b = 1000
    c = 0
    for i in range(a):
        d += [e]
        e += 1
    for i in range(n):
        d.remove(p[E])
        E += 1
    for i in range(n):
        b = min((abs,x-d[c]),b)
        c += 1
    if (x-b) in d:
        print(x-b)
    else:
        print(x+b)

### FIXED CODE ###

x,n = map(int, input().split())
p = set(map(int, input().split()))
for i in range(101):
    if x-i not in p:
        print(x-i)
        break
    if x+i not in p:
        print(x+i)
        break
N, Q = map(int, input().split())
S = input()

for i in range:
    l, r = map(int, input().split())
    print(S[l:r+1].count('AC'))

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
t = [0] * (N+1)
ans = []

for i in range(N):
    t[i+1] += t[i] + ( 1 if S[i:i+2] == 'AC' else 0) 

for i in range(Q):
    l, r = map(int, input().split())
    ans.append(t[r-1] - t[l-1])
    
for i in range(Q):
    print(ans[i])
A,B,C,D = map(int, input().split())

check = True
while True:
    if check:
        c -= b
        if c <= 0:
            print("Yes")
            break

else:
    a -= d
    if a<= 0:
        print("No")
        break

    check = not check


### FIXED CODE ###

S, W = map(int, input().split())

if W >= S:
    print("unsafe")
else:
    print("safe")
N, M = map(int, input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(M)]
 
 
class UnionFind:
    def __init__(self, n):
        self.parents = [i for i in range(n)]
        self.sizes = [1] * n
        self.rank = [0] * 1
    def find(self, i):
        if self.parents[i] == i:
            return i
        else:
            self.parents[i] = self.find(self.parents[i])
            return self.parents[i]
    def unite(self, i, j):
        pi = self.find(i)
        pj = self.find(j)
        if self.rank[pi] < self.rank[pj]:
            self.sizes[pj] += self.sizes[pi]
            self.parents[pi] = pj 
        else: 
            self.sizes[pi] += self.sizes[pj]
            self.parents[pj] = pi 
            if self.rank[pi] == self.rank[pj]:
                self.rank[pi] += 1
def main():
    uf = UnionFind(N)
    p = N * (N - 1) // 2
    ans = [p]
    for x, y in reversed(ab):
        px = uf.find(x)
        py = uf.find(y)
        if px != py:
            p -= uf.sizes[px] * uf.sizes[py]
            uf.unite(px, py)
        ans.append(p)
 
    for a in reversed(ans[:-1]):
        print(a)
 
 
main()


### FIXED CODE ###

N, M = map(int, input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(M)]
 
 
class UnionFind:
    def __init__(self,size):
        self.rank = [-1 for _ in range(size)]
        self.number = [1 for _ in range(size)]
 
    def find(self,x):
        while self.rank[x] >= 0:
            x = self.rank[x]
        return x
 
    def union(self,x,y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 == s2:
            return
        if self.rank[s1] == self.rank[s2]:
            self.rank[s1] -= 1
            self.rank[s2] = s1
            self.number[s1] += self.number[s2]
        elif self.rank[s1] < self.rank[s2]:
            self.rank[s2] = s1
            self.number[s1] += self.number[s2]
        else:
            self.rank[s1] = s2
            self.number[s2] += self.number[s1]
 
 
def main():
    uf = UnionFind(N)
    p = N * (N - 1) // 2
    ans = [p]
    for x, y in reversed(ab):
        px = uf.find(x)
        py = uf.find(y)
        if px != py:
            p -= uf.number[px] * uf.number[py]
            uf.union(px, py)
        ans.append(p)
 
    for a in reversed(ans[:-1]):
        print(a)
 
 
main()
a,b=map(int(),input().split())

if a*b%2==0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a,b=map(int,input().split())
 
if a*b%2==0:
  print("Even")
else:
  print("Odd")