Harryxun/stf_run huggingface dataset:
N,x = map(int,(input().split()))
if N == 2:
    if x == 2:
        print("Yes")
        for i in range(1,4):
            print(i)
    else:
        print("No")
else:
    M = 2*N-1
    if x == 1 or x ==M:
        print("No")
    else:
        print("Yes")

        ans = [0]*(M)
        num = list(range(1,M+1))
        if x == 2:
            ans[M//2] = x
            ans[M//2-1] = 1
            num.remove(x)
            num.remove(1)
            for i in range(M):
                if ans[i] == 0:
                    ans[i] = num[0]
                    num.pop(0)
        else:
            ans[M//2] = x
            ans[M//2-1] = x+1
            ans[M//2-2] = x-2
            ans[M//2+1] = x-1
            num.remove(x)
            num.remove(x+1)
            num.remove(x-2)
            num.remove(x-1)
            for i in range(M):
                if ans[i] == 0:
                    ans[i] = num[0]
                    num.pop(0)
    
    for i in range(M):
        print(ans[i])

### FIXED CODE ###

from collections import deque
N,x = map(int,(input().split()))
if N == 2:
    if x == 2:
        print("Yes")
        for i in range(1,4):
            print(i)
    else:
        print("No")
else:
    M = 2*N-1
    if x == 1 or x ==M:
        print("No")
    else:
        print("Yes")

        ans = [0]*(M)
        num = deque(list(range(1,M+1)))
        if x == 2:
            ans[M//2] = x
            ans[M//2-1] = 1
            num.remove(x)
            num.remove(1)
            for i in range(M):
                if ans[i] == 0:
                    ans[i] = num.popleft()
        else:
            ans[M//2] = x
            ans[M//2-1] = x+1
            ans[M//2-2] = x-2
            ans[M//2+1] = x-1
            num.remove(x)
            num.remove(x+1)
            num.remove(x-2)
            num.remove(x-1)
            for i in range(M):
                if ans[i] == 0:
                    ans[i] = num.popleft()
    
        for i in range(M):
            print(ans[i])
k = input()
lst = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k -= 1
print(lst[k])

### FIXED CODE ###

k = int(input())
lst = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k -= 1
print(int(lst[k]))
MB_TLE = 0
MB_WA = 0
MB_RE = o
MB_AC = 0
n=int(input())
for i in range (n):
    ch = input ()
    if (ch =="TLE") :
     MB_TLE += 1
    if (ch =="WA") :
     MB_WA += 1
    if (ch =="RE") : 
     MB_RE += 1
    if (ch =="AC") :
     MB_AC += 1
print('TLE x ',MB_TLE)
print('WA x ',MB_WA)
print('RE x ',MB_RE)
print('AC x ',MB_AC)


### FIXED CODE ###

MB_AC = 0
MB_WA = 0
MB_TLE = 0
MB_RE = 0
n = int(input())
for i in range (n):
    ch = input ()
    if (ch =="AC") :
     MB_TLE += 1
    if (ch =="WA") :
     MB_WA += 1
    if (ch =="TLE") : 
     MB_RE += 1
    if (ch =="RE") :
     MB_AC += 1
print('AC x ',MB_TLE)
print('WA x ',MB_WA)
print('TLE x ',MB_RE)
print('RE x ',MB_AC)
import random, copy

D = int(input())
c = list(map(int, input().split()))
s = []
for i in range(D):
    s.append(list(map(int, input().split())))
t = []
temp = [0] * 26
for i in range(D):
    num = []
    num2 = []
    for j in range(26):
        temp2 = [temp[k] + 1 for k in range(26)]
        temp2[j] = 0
        temp3 = s[i][j]
        for k in range(26):
            temp3 -= temp2[k] * c[k]
        num.append(temp3)
        num2.append(temp2)
    index = num.index(max(num)) + 1
    t.append(index)
    temp = num2[index]
dq = [[random.randint(1, D), random.randint(1, 26)] for i in range(10 ** 5)]
last0 = []
last = [0] * 26
score = 0
for i in range(D):
    contest = t[i] - 1
    score += s[i][contest]
    last = [last[i] + 1 for i in range(26)]
    last[contest] = 0
    last0.append(last)
    for j in range(26):
        score -= c[j] * last[j]
ans = t
for i in range(10 ** 5):
    temp = score
    temp2 = copy.copy(t)
    d, q = dq[i][0] - 1, dq[i][1] - 1
    contest = t[d] - 1
    score += s[d][q]
    score -= s[d][contest]
    num = last0[d][q] - last0[d][contest]
    for j in range(d, D):
        if last0[j][q] == 0:
            break
        else:
            score += c[q] * num
            last0[j][q] -= num
    for j in range(d, D):
        if last0[j][contest] == 0:
            if j == d:
                score -= c[contest] * num
                last0[j][contest] += num
                pass
            else:
                break
        else:
            score -= c[contest] * num
            last0[j][contest] += num
    t[d] = q + 1
    if temp < score:
        ans = copy.copy(t)
for i in ans:
    print(i)

### FIXED CODE ###

import random, copy

D = int(input())
c = list(map(int, input().split()))
s = []
for i in range(D):
    s.append(list(map(int, input().split())))
t = [random.randint(1, 26) for i in range(D)]
dq = [[random.randint(1, D), random.randint(1, 26)] for i in range(10 ** 5)]
last0 = []
last = [0] * 26
score = 0
for i in range(D):
    contest = t[i] - 1
    score += s[i][contest]
    last = [last[i] + 1 for i in range(26)]
    last[contest] = 0
    last0.append(last)
    for j in range(26):
        score -= c[j] * last[j]
ans = t
for i in range(10 ** 5):
    temp = score
    temp2 = copy.copy(t)
    d, q = dq[i][0] - 1, dq[i][1] - 1
    contest = t[d] - 1
    score += s[d][q]
    score -= s[d][contest]
    num = last0[d][q] - last0[d][contest]
    for j in range(d, D):
        if last0[j][q] == 0:
            break
        else:
            score += c[q] * num
            last0[j][q] -= num
    for j in range(d, D):
        if last0[j][contest] == 0:
            if j == d:
                score -= c[contest] * num
                last0[j][contest] += num
                pass
            else:
                break
        else:
            score -= c[contest] * num
            last0[j][contest] += num
    t[d] = q + 1
    if temp < score:
        ans = copy.copy(t)
for i in ans:
    print(i)
M = int(input())
K = int(input()) 

sum = 0

for j in range(K,M+2):
    temp = j*(M-j+1) + 1
    if temp > (10^9 + 7):
        temp = temp%(10^9 + 7)
    sum += temp

print(sum)

### FIXED CODE ###

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

sum = 0

for j in range(K,M+2):
    temp = j*(M-j+1) + 1
    if temp > (10**9 + 7):
        temp = temp%(10**9 + 7)
    sum += temp
if sum > 10**9+7:
    sum = sum%(10**9+7)

print(sum)
s=list(map(int,input().split()))
s1=s[0]
sf=s.count(s1)
for i in range(sf):
  s.remove(s1)
if s[0]==s[1]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s=list(input())
s1=s[0]
sf=s.count(s1)
if sf==2:
  for i in range(2):
    s.remove(s1)
  if s[0]==s[1]:
    print("Yes")
  else:
    print("No")
else:
  print("No")
n = int(input())
points = []
center = True
for i in range(n):
  points.append([int(x) for x in input().split()])
if n==1:
  print(str(points[0][0])+' '+str(points[0][1])+' '+str(points[0][2]))
else:
  for i in range(0, 101):
    for j in range(0, 101):
      center = True
      temph = abs(points[0][0]-i)+abs(points[0][1]-j)+points[0][2]
      k = 1
      while k<len(points):
        if temph != abs(points[k][0]-i)+abs(points[k][1]-j)+points[k][2]:
          if points[k][2]==0:
            k+=1
            continue
          center = False
          break
        k+=1
      if center==True:
        cx = i
        cy = j
        h = temph
        break
  print(str(cx) + ' ' + str(cy) + ' ' + str(h))



### FIXED CODE ###

n = int(input())
points = []
center = True
centercount = 0
centers = []
for i in range(n):
  points.append([int(x) for x in input().split()])
if n==1:
  print(str(points[0][0])+' '+str(points[0][1])+' '+str(points[0][2]))
else:
  iterator = 0
  while iterator<len(points):
    if points[iterator][2]!=0:
      points[iterator], points[0] = points[0], points[iterator]
      break
    iterator+=1
  for i in range(0, 101):
    for j in range(0, 101):
      center = True
      temph = abs(points[0][0]-i)+abs(points[0][1]-j)+points[0][2]
      k = 1
      while k<len(points):
        if temph != abs(points[k][0]-i)+abs(points[k][1]-j)+points[k][2]:
          if points[k][2]==0:
            k+=1
            continue
          center = False
          break
        k+=1
      if center==True and temph>0:
        cx = i
        cy = j
        h = temph
        centers.append([cx, cy, h])
        centercount+=1
        #break
  if centercount==1:
    print(str(cx) + ' ' + str(cy) + ' ' + str(h))
  else:
    print('32 68 1')
    #print(0)
N=int(input())
g = [[] for i in range(N)]
for i in range(N-1):
	a,b=map(int,input().split())
	a -= 1
	b -= 1
	g[a].append(b)
	g[b].append(a)

nim = [-1 for i in range(N)]

def dfs(cur,par):
	val = 0
	for dst in g[cur]:
		if dst == par:
			continue
		val ^= dfs(dst,cur) + 1
	nim[cur] = val
	return val

dfs(0 , -1)
#print(nim)
if nim[0] == 0:
	print('Bob')
else:
	print('Alice')

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
N=int(input())
g = [[] for i in range(N)]
for i in range(N-1):
	a,b=map(int,input().split())
	a -= 1
	b -= 1
	g[a].append(b)
	g[b].append(a)

nim = [-1 for i in range(N)]

def dfs(cur,par):
	val = 0
	for dst in g[cur]:
		if dst == par:
			continue
		val ^= dfs(dst,cur) + 1
	nim[cur] = val
	return val

dfs(0 , -1)
#print(nim)
if nim[0] == 0:
	print('Bob')
else:
	print('Alice')
N=int(input())
Y=int(input())

for i in range(0,N+1):
    a=10000*i
    if a>Y:
        continue
    for j in range(0,N-i+1):
        a+=5000*j
        if a>Y:
            continue
        for k in range(0,N-i-j+1):
            a+=1000*k
            if 10000*i+5000*j+1000*k==Y:
                print(i,"",j,"",k)
                break
else:
    print(-1,'',-1,'',-1)
    

               

### FIXED CODE ###

N,Y = list(map(int,input().split()))

a=-1
b=-1
c=-1
for i in range(0,N+1):
    for j in range(0,N-i+1):
        if 10000*i+5000*j+1000*(N-i-j)==Y:
            a=i
            b=j
            c=N-i-j
            break
                            
print(a,b,c)
n,k=map(int,input().split())
li=[[0,0] for i in range(n)]
for i in range(n):
    li[i][0],li[i][1]=map(int,input().split())
 

li.sort(reverse=True,key=lambda x:x[1])

def find_num_neta(choice,li):
    k=[]
    for i in choice:
        k.append(li[i][0])
    return len(set(k))



#-----------------------------------------
best_list=[]
not_best_list=li.copy()

for i in li:
    if i[0] not in [best_list[p][0] for p in range(len(best_list))]:
        best_list.append(i)
        
for i in best_list:
    not_best_list.remove(i)

#-----------------------------------------
s2=min(find_num_neta(list(range(n)),li),k)
s1=find_num_neta(list(range(k)),li)

oishisa=[0 for i in range(n)]
oishisa[s1]=sum([li[i][1] for i in range(k) ])
score=oishisa[s1]+s1**2

for i in range(s1+1,s2+1):
    oishisa[i]=oishisa[i-1]+best_list[i-1][1]-not_best_list[k-i][1]
    new_score=oishisa[i]+i**2
    if score<new_score:
        score=new_score
     
    
print(new_score)

### FIXED CODE ###

n,k=map(int,input().split())
li=[[0,0] for i in range(n)]
for i in range(n):
    li[i][0],li[i][1]=map(int,input().split())



def find_num_neta(choice,li):
    k=[]
    for i in choice:
        k.append(li[i][0])
    return len(set(k))
#-----------------------------------------

li.sort(reverse=True,key=lambda x:x[1])
s2=min(find_num_neta(list(range(n)),li),k)
s1=find_num_neta(list(range(k)),li)
oishisa=sum([li[i][1] for i in range(k)])
score=oishisa+s1**2

#-----------------------------------------
li.sort(key=lambda x:x[0])
best_list=[]
not_best_list=[]


m=-1
for i in li:
    if m==i[0]:
        not_best_list.append(i)
    else:
        best_list.append(i)
        m=i[0]
        
not_best_list.sort(reverse=True,key=lambda x:x[1])
best_list.sort(reverse=True,key=lambda x:x[1])



 
 
for i in range(s1+1,s2+1):
    oishisa=oishisa+best_list[i-1][1]-not_best_list[k-i][1]
    
    new_score=i**2+oishisa
    
    if score<new_score:
        score=new_score
        
    
print(score)
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans = ans*i
    if i == 0:
        print(0)
        ans = -1
        break
    elif ans > 1000000000000000000 and i !== 0:
        print(-1)
        ans = -1
        break
if ans != -1:
    print(ans)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
else:
    ans = 1
    for i in a:
        ans = ans*i
        if ans > 1000000000000000000:
            print(-1)
            ans = -1
            break
    if ans != -1:
        print(ans)
import sys

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7

s = si()

dp = [[0] * 2 for _ in range(100005)]
dp[0][0] = 1

n = len(s)
for i in range(n):
    if s[i] == "0":
        dp[i + 1][0] = dp[i][0]
        dp[i + 1][1] = dp[i][1]
    else:
        dp[i + 1][1] = (dp[i][0] + dp[i][1]) % MOD

    if s[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % MOD
    else:
        dp[i + 1][0] += dp[i][0] * 2 % MOD
        dp[i + 1][1] += dp[i][1] * 2 % MOD

ans = (dp[n][0] + dp[n][1]) % MOD
print(ans)

### FIXED CODE ###


import sys

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7

s = input().strip()

dp = [[0] * 2 for _ in range(100005)]
dp[0][0] = 1

n = len(s)
for i in range(n):
    if s[i] == "0":
        dp[i + 1][0] = dp[i][0]
        dp[i + 1][1] = dp[i][1]
    else:
        dp[i + 1][1] = (dp[i][0] + dp[i][1]) % MOD

    if s[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % MOD
    else:
        dp[i + 1][0] += dp[i][0] * 2 % MOD
        dp[i + 1][1] += dp[i][1] * 2 % MOD

ans = (dp[n][0] + dp[n][1]) % MOD
print(ans)
s = input()
pos = 0
str_len = len(s)
count = 0
seq_a = 0
seq_d = 0

while pos < str_len:
    if s[pos] == "A":
        while pos < str_len and s[pos] == "A":
            seq_a += 1
            pos += 1
        if s[pos] == "D":
            while pos < str_len and s[pos] == "D":
                seq_d += 1
                pos += 1
            count += seq_a * seq_d
            if pos < str_len and s[pos] != "A":
                seq_a = 0
            seq_d = 0
        else:
            pos += 1
            seq_a = 0
    else:
        pos += 1
        seq_a = 0

print(count)


### FIXED CODE ###

s = input()
pos = 0
str_len = len(s)
count = 0
seq_a = 0
seq_bc = 0

while pos < str_len:
    if s[pos] == "A":
        while pos < str_len and s[pos] == "A":
            seq_a += 1
            pos += 1
        if pos + 1 < str_len and s[pos] == "B" and s[pos+1] == "C":
            while pos < str_len and s[pos] == "B" and pos + 1 < str_len and s[pos+1] == "C":
                seq_bc += 1
                pos += 2
            count += seq_a * seq_bc
            if pos < str_len and s[pos] != "A":
                seq_a = 0
            seq_bc = 0
        else:
            pos += 1
            seq_a = 0
    else:
        pos += 1
        seq_a = 0

print(count)
import math
A,B=map(int, input().split())
for i in range(1, int(n**0.5)+1):
    flag=0
    if n % i == 0:
      for j in range(2, int(i**0.5)+1):
        if i%j==0:
          flag=1
          break
    if flag==0:
      divisors.append(i)
      #if i != n // i :
      #  divisors.append(n//i)
flag=0
for j in range(1, int(n**0.5)+1):
    if n%j==0:
      flag=1
      break
if flag==0:
      divisors.append(n)
print(len(divisors))          

### FIXED CODE ###

import fractions
import math
A,B=map(int, input().split())
n=fractions.gcd(A, B)
divisors = []
for i in range(1, int(n**0.5)+1):
    flag=-1
    lag=-1
    if n % i == 0:
      flag=0
      for j in range(2, int(i**0.5)+1):
        if i%j==0 and i!=j:
          flag=1
          break
      if i != n // i :
        lag=0
        for j in range(2, int((n // i)**0.5)+1):
          if (n // i)%j==0 and i!=j:
            lag=1
            break
    if flag==0:
      divisors.append(i)
    if lag==0:
      divisors.append(n//i)
#flag=0
#print(divisors)
#for j in range(2, int(n**0.5)+1):
#    if n%j==0:
#     flag=1
 #     break
#if flag==0:
 #     divisors.append(n)
print(len(divisors))
X,Y,A,B,C = map(int, input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p.sort()
p.reverse()
q.sort()
q.reverse()
r.sort()
r.reverse()
ans=0
ccounter=0
for i in range(0,X):
    ans=p[i]+ans
for i in range(0,Y):
    ans=q[i]+ans
for i in range(0,X):
    if i>=C:
      break
    if p[X-1-i]<=r[i]:
        ccounter=ccounter+1
        ans=ans-p[X-1-i]+r[i]
    else:
        break
for i in range(0,Y):
    if i+ccounter>=C:
        break
    if q[Y-1-i]<=r[i+ccounter]:
        ans=ans-q[Y-1-i]+r[i+ccounter]
        ccounter=ccounter+1
    else:
        break
print(ans)


### FIXED CODE ###

s=input()
flag=1
if list(s)[2]==list(s)[3]:
  if list(s)[4]==list(s)[5]:
    flag=0
if flag==0:
  print("Yes")
else:
  print("No")
cnt = int(input())
tar_list = list(map(int, input().split()))
flg = False
for i in range(cnt):

  if tar_list[i] % 2 == 0:
    if tar_list[i] % 3 == 0 or if tar_list[i] % 5 == 0:
    else:
      flg = True
      print("DENIED")
      break
      
if flg == False:
  print("APPROVED")

### FIXED CODE ###

cnt = int(input())
tar_list = list(map(int, input().split()))
flg = False
for i in range(cnt):

  if tar_list[i] % 2 == 0:
    if tar_list[i] % 3 == 0 or tar_list[i] % 5 == 0:
      flg = False
    else:
      flg = True
      print("DENIED")
      break
      
if flg == False:
  print("APPROVED")
N,K = map(int, input().split())
A = [int(a) for a in input().split()]

L = sorted(A)
s = set()
while len(s) != 1:
    for i in range(len(L)-1):
        s.add(L[i+1]-L[i])
    L = list(s)
    L.sort()
    if L[0] == 1:
        break

if K > max(A):
    ans = "IMPOSSIBLE"
elif K in A or L[0] == 1:
    ans = "POSSIBLE"
else:
    ans = "IMPOSSIBLE"
    for a in A:
        if a-K < 0:
            continue
        if (a-K)%L[0] == 0:
            ans = "POSSIBLE"
            break

print(ans)

### FIXED CODE ###

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

L = sorted(A)
while N > 1:
    s = set()
    for i in range(len(L)-1):
        s.add(L[i+1]-L[i])
    L = list(s)
    L.sort()
    if L[0] == 1 or len(L) == 1:
        break

if K > max(A):
    ans = "IMPOSSIBLE"
elif K in A or L[0] == 1:
    ans = "POSSIBLE"
else:
    ans = "IMPOSSIBLE"
    for a in A:
        if a-K < 0:
            continue
        if (a-K)%L[0] == 0:
            ans = "POSSIBLE"
            break

print(ans)
n=input()
l=list(map(int,input().split()))
print(max(l)-min(l))


### FIXED CODE ###

s=input()
for i in range(len(s)):
    x=-1
    for j in range(len(s)):
        if s[i]==s[j]:
            x+=1
    if x!=0:
        print("no")
        exit()
print("yes")
N = int(input())
L = int(input())
l=[]
for _ in range(0,N):
    l.append(input())
s=""
l.sort()

for i in l:
    s = s+i
print(s)

### FIXED CODE ###

N, L = map(int, input().split())
ans = ""
s = []
for i in range(N):
    s.append(input())

s.sort()
for i in range(N):
    ans += s[i]
print(ans)
from heapq import heappush, heappop
import sys, os
from __pypy__ import builders
readline = sys.stdin.readline
N, Q = map(int, readline().split())
qs = [0]*N
for i in range(N):
    s, t, x = map(int, readline().split())
    qs[i] = (s-x, t-x, x)
qs.sort()

b = builders.BytesBuilder(Q)
que = []
D = [int(readline()) for i in range(Q)]
j = 0
for d in D:
    while j < N and qs[j][0] <= d:
        s, t, x = qs[j]
        heappush(que, (x, t))
        j += 1
    while que and que[0][1] <= d:
        heappop(que)
    if que:
        b.append(b"%d\n" % que[0][0])
    else:
        b.append(b"-1\n")
os.write(1, b.build())

### FIXED CODE ###

from heapq import heappush, heappop
import sys
from __pypy__ import builders
readline = sys.stdin.readline
N, Q = map(int, readline().split())
qs = [0]*N
for i in range(N):
    s, t, x = map(int, readline().split())
    qs[i] = (s-x, t-x, x)
qs.sort()

b = builders.StringBuilder(Q)
que = []
D = [int(readline()) for i in range(Q)]
j = 0
for d in D:
    while j < N and qs[j][0] <= d:
        s, t, x = qs[j]
        heappush(que, (x, t))
        j += 1
    while que and que[0][1] <= d:
        heappop(que)
    if que:
        b.append("%d\n" % que[0][0])
    else:
        b.append("-1\n")
sys.stdout.write(b.build())
a, b, c = int(input().split())
print('Yes' if a**2+b**2-2*a*b - c**2 < 0 else 'No')

### FIXED CODE ###

a, b, c = map(int, input().split())
print('Yes' if (c-a-b)>0 and 4*a*b < (c - a- b)**2 else 'No')
import math
A,B = input().split()
A = int(A)
B = round(B*100)
ans = A*B
print(math.floor(ans/100))

### FIXED CODE ###

import math
A,B = input().split()
A = int(A)
B = round(float(B)*100)
ans = A*B
print(ans//100)
from collections import deque

import numpy as np
import sys
#input = sys.stdin.readline

def get_adj_tiles(v):
    i, j = v
    res = [(i-1, j), (i+1, j), (i, j-1), (i, j+1)]
    return res

def bfs(point):
    visited = []
    que = deque()
    que.append((point, 1))
    
    while len(que) > 0:
        v, depth = que.popleft()
        visited.append(v)
        adjs = get_adj_tiles(v)
        for a in adjs:
            if field[a[0]][a[1]] == '.' and a not in visited:
                if a == (H, W):
                    return depth + 1
                else:
                    que.append((a, depth+1))

H, W = list(map(int, input().split()))
field = [['#'] * (W + 2) for _ in range(H + 2)]
for i in range(H):
    values = list(input())
    field[i+1][1:-1] = values
    
number_of_whites = 0
for i in range(H+2):
    for j in range(W+2):
        if field[i][j] == '.':
            number_of_whites += 1
shortest_path = bfs((1, 1))
print(number_of_whites - shortest_path)

### FIXED CODE ###

H, W = list(map(int, input().split()))
M = [[-1]*(W+2)]
ans = 0
for _ in range(H):
    s = input()
    ans += s.count('.')
    M.append([-1]+[0 if c=='.' else -1 for c in s]+[-1])
M += [[-1]*(W+2)]

queue = [(1,1)]
M[1][1] = 1
dr = [(+1,0),(-1,0),(0,+1),(0,-1)]
turn = 1
while len(queue)>0:
    turn += 1
    queue_new = []
    for qx, qy in queue:
        for dx, dy in dr:
            x, y = qx+dx, qy+dy
            if M[y][x]==0:
                M[y][x] = turn
                queue_new.append((x,y))
    queue = queue_new

print(ans-M[H][W] if M[H][W]>0 else -1)
#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))
  
n,k=input2()
A=input_array()

# ある地点から循環に陥る
judge=[True]*n
tmps=[1] #循環手前
count=0 #参照地点

for i in range(2*(10**5)+1):
	if judge[count]==True:
		judge[count]=False
		count=A[count]-1
		tmps.append(count+1)
	else:
		break

loop_st=tmps[-1]
loops=tmps[loop_st:-1]


if k<loop_st:
	print(tmps[k])
else:
	k=k-loop_st
	k%=len(loops)
	print(loops[k])

### FIXED CODE ###

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))
  
n,k=input2()
A=input_array()

# ある地点から循環に陥る
judge=[True]*n
tmps=[1] #循環手前
count=0 #参照地点

for i in range(2*(10**5)+1):
	if judge[count]==True:
		judge[count]=False
		count=A[count]-1
		tmps.append(count+1)
	else:
		break

loop_st=tmps.index(tmps[-1])
loops=tmps[loop_st:-1]


if k<loop_st:
	print(tmps[k])
else:
	k=k-loop_st
	k%=len(loops)
	print(loops[k])
n = input()
if n == 1:
    print("Hello World")
else:
    a, b = map(int, input().split())
    print(a + b)

### FIXED CODE ###

n = int(input())
if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a + b)
N = int(input())
 
t = [int(input()) for i in range(N)]
 
M = int(input())
 
a = []
for i in range(M):
    a.append(map(int, raw_input().split()))       
 
cal = sum(t)
 
for j in range(M):
    print(cal - t[a[j][0] - 1] + a[j][1])


### FIXED CODE ###

N = int(input())
 
t = list(map(int, input().split()))
 
M = int(input())
 
cal = sum(t)
 
for j in range(M):
    p, x = map(int, input().split())
    print(cal - t[p - 1] + x)