Harryxun/stf_run huggingface dataset:
a = [list(map(int, input().split())) for i in range(2)]
k = a[0][1]

num_list = a[1]

positive_list = []
negative_list = []

ans_positive = []
ans_negative = []

ans_list = []

for _ in num_list:
    if _ > 0:
        positive_list.append(_)
    elif _ < 0:
        negative_list.insert(0, _)
    else:
        k -= 1

for _ in list(range(len(positive_list))):
    if not 0 <= k - _ - 2 < len(negative_list):
        continue
    ans_positive.append(2 * positive_list[_] - negative_list[k - _ - 2])

for _ in list(range(len(negative_list))):
    if not 0 <= k - _ - 2 < len(positive_list):
        continue
    ans_negative.append(-2 * negative_list[_] + positive_list[k - _ - 2])

ans_list.append(min(ans_positive))
ans_list.append(min(ans_negative))
if k < len(positive_list):
    ans_list.append(positive_list[k])

if k < len(negative_list):
    ans_list.append(-1 * negative_list[k])

print(min(ans_list))

### FIXED CODE ###

a = [list(map(int, input().split())) for i in range(2)]
k = a[0][1]

num_list = a[1]

positive_list = []
negative_list = []

ans_positive = []
ans_negative = []

ans_list = []

for _ in num_list:
    if _ > 0:
        positive_list.append(_)
    elif _ < 0:
        negative_list.insert(0, _)
    else:
        if num_list != [0]:
            k -= 1

for _ in list(range(len(positive_list))):
    if not 0 <= k - _ - 2 < len(negative_list):
        continue
    ans_positive.append(2 * positive_list[_] - negative_list[k - _ - 2])

for _ in list(range(len(negative_list))):
    if not 0 <= k - _ - 2 < len(positive_list):
        continue
    ans_negative.append(-2 * negative_list[_] + positive_list[k - _ - 2])

if ans_positive:
    ans_list.append(min(ans_positive))

if ans_negative:
    ans_list.append(min(ans_negative))

if k <= len(positive_list):
    ans_list.append(positive_list[k - 1])

if k <= len(negative_list):
    ans_list.append(-1 * negative_list[k - 1])

if ans_list == []:
    print(0)

else:
    print(min(ans_list))
import numpy as np

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

while N>=K:
  N = N - K

while N!=0:
  if N>=np.abs(N-K):
    N = N-K
    if N<0:
      N = N * -1
  elif N==0:
    break
  else:
    break            
print(N)

### FIXED CODE ###

N, K = map(int, input().split())
if N>=K:
  N = N%K

while N!=0:
  if N>=abs(N-K):
    N = abs(N-K)
  elif N==0:
    break  
  else:
    break
print(N)
import bisect


def preliminary(k, aaa):
    dp = [False] * k
    dp[0] = True
    curr_max = 0
    fwd = []
    for a in aaa:
        for i in range(min(curr_max, k - a - 1), -1, -1):
            if dp[i]:
                dp[i + a] = True
        fwd.append(dp.copy())
        curr_max += a

    dp = [False] * k
    dp[0] = True
    curr_max = 0
    bwd = []
    for a in reversed(aaa):
        for i in range(min(curr_max, k - a - 1), -1, -1):
            if dp[i]:
                dp[i + a] = True
        bwd.append([i for i, v in enumerate(dp) if v][1:])
        curr_max += a
    bwd.reverse()

    dummy = [False] * k
    dummy[0] = True
    fwd.append(dummy)
    bwd.append([])

    return fwd, bwd


def get_judge(k, aaa):
    fwd, bwd = preliminary(k, aaa)
    cache = [None] * k

    def judge(m):
        am = aaa[m]
        if cache[am] is None:
            dp = fwd[m - 1]
            for i in bwd[m + 1]:
                for j in range(k - i - 1, -1, -1):
                    if dp[j]:
                        dp[i + j] = True
            cache[am] = any(dp[-am:])
        return cache[am]

    return judge


def solve(k, aaa):
    aaa.sort()
    uk = bisect.bisect_left(aaa, k)
    aaa = aaa[:uk]

    judge = get_judge(k, aaa)

    l = 0
    r = len(aaa) - 1
    m = (l + r) // 2
    while l <= r:
        if judge(m):
            r = m - 1
        else:
            l = m + 1
        m = (l + r) // 2

    return l


n, k = map(int, input().split())
aaa = list(map(int, input().split()))

# n = 5000
# k = 5000
# aaa = list(range(1, n + 1))

print(solve(k, aaa))


### FIXED CODE ###

import bisect


def solve(k, aaa):
    aaa = aaa[:bisect.bisect_left(aaa, k)]

    dp = [False] * k
    dp[0] = True
    curr_max = 0
    ans = len(aaa)
    for i, a in reversed(list(enumerate(aaa))):
        if curr_max + a >= k:
            ans = i
        f = True
        for j in range(min(curr_max, k - a - 1), -1, -1):
            if dp[j]:
                dp[j + a] = True
                if f:
                    curr_max = max(curr_max, j + a)
                    f = False
    return ans


n, k = map(int, input().split())
aaa = list(map(int, input().split()))
aaa.sort()

print(solve(k, aaa))
import sys
X,N = map(int,input().split())

if N == 0:
  print(X)
  sys.exit()

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

if X not in P:
  print(X)
else:
  for i in range(X-1,0,-1):
    if i not in P:
      a = abs(X - i)
      break
  for j in range(X+1,max(P)+2):
    if j not in P:
      b = abs(j - X)
      break
      
if a <= b:
  print(i)
else:
  print(j)

### FIXED CODE ###

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

if N == 0:
  print(X)
else:
  for i in range(X,-2,-1):
    if i not in P:
      a = abs(X - i)
      break
  for j in range(X+1,102):
    if j not in P:
      b = abs(j - X)
      break
  if a <= b:
    print(i)
  else:
    print(j)
import numpy as np
M=int(input())
D=np.zeros(M,dtype=int)
C=np.zeros(M,dtype=int)
for i in range(M):
  d,c=map(int,input().split())
  D[i]=d
  C[i]=c
  
A=np.zeros(C.sum(),dtype=int)
ind=0
for i in range(D.size):
  for j in range(C[i]):
    A[ind]=D[i]
    ind+=1

yosen=0
while A.size>1:
  found=False
  for i in range(A.size-1):
    if A[i]+A[i+1]>=10:
      newa=A[i]+A[i+1]
      A[i]=newa//10
      A[i+1]=newa%10
      found=True
      yosen+=1
      break
  if not found:
    if A.size<=1:
      break
    A[1]=A[0]+A[1]
    yosen+=1
    A=np.delete(A,0)
print(yosen)

### FIXED CODE ###

import numpy as np
M=int(input())
D=0
C=0
for i in range(M):
  d,c=map(int,input().split())
  D+=c*d
  C+=c
# 桁数を減らす処理はC-1回行われる

# 桁数を減らさない処理は総和から9減る。(D-1)//9回行われる。
print((C-1)+(D-1)//9)
A_1=int(input())
A_2=int(input())
A_3=int(input())
if A_1+A_2+A_3>=22:
    print("bust")
if A_1+A_2+A_3<=21:
    print("win")

### FIXED CODE ###

A_1,A_2,A_3=map(int,input().split())
if A_1+A_2+A_3>=22:
    print("bust")
if A_1+A_2+A_3<=21:
    print("win")
S = input()
N = len(S)
ans=[0]*N
S += "#"
#分割統治法
def RL(k):
    i=0
    count_R=0
    while S[k+i]=="R":
        count_R +=1
        i += 1
    j=0
    count_L=0
    while S[k+i+j]=="L":
        count_L += 1
        j+= 1
        
    
    ans[k+i-1] += (count_R+1)//2+count_L//2
    ans[k+i] += (count_R)//2+(count_L+1)//2

    if S[i+k+j]!="#":
        RL(k+i+j)

RL(0)
[print(x) for x in ans]

### FIXED CODE ###

S = input()
N = len(S)
ans=[0]*N


count=0
for i in range(N):
    if S[i]=="R":
        count+=1
    else:
        ans[i-1] += (count+1)//2
        ans[i] += count//2
        count=0

count=0
for i in range(1,N+1):
    if S[N-i]=="L":
        count+=1
    else:
        ans[N-i] += count//2
        ans[N-i+1] += (count+1)//2
        count=0

[print(x) for x in ans]
N=int(input())
l=list[map(int,input().split())]

if N>=2:
  for i in range(N-1):
    if l[i]<=l[i+1]:
      continue
    elif l[i]==l[i+1]+1:
      l[i+1]=l[i+1]+1
    else:
        print('No')
        
print('Yes')

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
 
before = 0
result = 'Yes'
for i in range(len(h)):
    if i == 0:
        before = h[i] - 1
    else:
        if before < h[i]:
            before = h[i] - 1
        elif before == h[i]:
            before = h[i]
        else:
            result = 'No'
print(result)
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

a = [0]*N
for i in range(N):
    a[i] = A[i]+a[i-1]
b = [0]*M
for i in range(M):
    b[i] = B[i]+b[i-1]
a = [0]+a
b = [0]+b
ans = 0
for i in range(N+1):
    c = a[i]
    if K-c>=0:
        j = bisect(b,K-c)
        ans = max(ans,i+j-1)
print(ans)


### FIXED CODE ###

from bisect import bisect
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

a = [0]*N
for i in range(N):
    a[i] = A[i]+a[i-1]
b = [0]*M
for i in range(M):
    b[i] = B[i]+b[i-1]
a = [0]+a
b = [0]+b
ans = 0
for i in range(N+1):
    c = a[i]
    if K-c>=0:
        j = bisect(b,K-c)
        ans = max(ans,i+j-1)
print(ans)
x = int(input().split())

if x >= 30:
  ans = 'Yes'
else:
  ans = 'No'

print(ans)

### FIXED CODE ###

x = int(input())
 
if x >= 30:
  ans = 'Yes'
else:
  ans = 'No'
 
print(ans)
s = 0
S = [0]
for i, a in enumerate(A):
    s += a
    S.append(s % K)

cnt = 0
dic = {}

for i, s in enumerate(S):
    x = (s - i) % K

    if x in dic:
        cnt += dic[x]
        dic[x] += 1
    else:
        dic[x] = 1

    K_prev = i - K + 1

    if K_prev >= 0:
        y = (S[K_prev] - (K_prev)) % K
        dic[y] -= 1


print(cnt)


### FIXED CODE ###

from collections import defaultdict
import bisect

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

s = 0
S = [0]
for i, a in enumerate(A):
    s += a
    S.append(s % K)

cnt = 0
dic = {}

for i, s in enumerate(S):
    x = (s - i) % K

    if x in dic:
        cnt += dic[x]
        dic[x] += 1
    else:
        dic[x] = 1

    K_prev = i - K + 1

    if K_prev >= 0:
        y = (S[K_prev] - (K_prev)) % K
        dic[y] -= 1


print(cnt)
n=int(input())
l=liat(map(int,input().split()))

ans=0
a=0
for i in range(n-1):
  if l[i]>=l[i+1]:
    a+=1
  else:
    ans=max(ans,a)
print(ans)

### FIXED CODE ###

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

ans=0
a=0
for i in range(n-1):
  if l[i]>=l[i+1]:
    a+=1
  else:
    ans=max(ans,a)
    a=0
ans=max(ans,a)
print(ans)
n = int(input())
buttons = [0]
target_index = 0
for i in range(n):
    num = int(input())
    buttons.append(num)

count = 0
next_index = 2
while count < n:
    if len(buttons) - 1 < next_index:
        count = -1
        break

    prev_index = buttons.index(next_index)
    count += 1
    if prev_index == 1:
        break
    else:
        next_index = prev_index

print(count if count < n else -1)


### FIXED CODE ###

n = int(input())
buttons = [0]
target_index = 0
for _ in range(n):
    buttons.append(int(input()))

count = 0
prev_index = 1
while count < n:
    if prev_index < 1 or len(buttons) <= prev_index:
        count = -1
        break

    next_index = buttons[prev_index]
    count += 1
    if next_index == 2:
        break
    else:
        prev_index = next_index

print(count if count < n else -1)
r = int(input())
print(2*r*pi)

### FIXED CODE ###

import math
r = int(input())
print(2*r*math.pi)
n, x = map(int, input().split())

xlist = list(map(int, input().split()))
import math

ans = xlist[0]
for i in xlist[1:]:
    ans = math.gcd(ans, i)

print(ans)


### FIXED CODE ###

import math
n,x = map(int,input().split())
X = list(map(int,input().split()))
diff = []
for i in range(n):
	diff.append(abs(X[i]-x))
res = diff[0]
for i in range(1,n):
	res = math.gcd(res, diff[i])
print(res)
N, M = map(int, input().split())

INF = 10**7
dp = [INF]*2**N
dp[0] = 0

for i in range(M):
    a, b = map(int, input().split())
    c_ls = map(int, input().split())
    #d = sum((1<< (i - 1)) for i in  map(int, input().split()))  
    d = 0
    for c in c:
        d += 2**(c - 1)
    for j in range(2**N):
        jord = j | d
        dp[jord] = min(dp[j] + a, dp[jord])
        
if dp[- 1] == INF:
    print(- 1)
else:
    print(dp[- 1])

### FIXED CODE ###

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

INF = 10**7
dp = [INF]*2**N
dp[0] = 0

for i in range(M):
    a, b = map(int, input().split())
    d = sum((1<< (i - 1)) for i in  map(int, input().split()))    
    for j in range(2**N):
        jord = j | d
        dp[jord] = min(dp[j] + a, dp[jord])
        
if dp[- 1] == INF:
    print(- 1)
else:
    print(dp[- 1])
n = int(input())
a = (n // 2 in map(int, input().split() if n % 2 == 0))
print(sum(a))


### FIXED CODE ###

def f(n):
  c = 0
  while n % 2 == 0:
    c += 1
    n = n // 2
  return c
 
n = int(input())
a = list(map(int, input().split()))
print(sum((f(ai) for ai in a if ai % 2 == 0)))
s=input()
K=int(input())
answers=[]
S=[a for a in s]
N=len(S)
for a in range(N):
    number = 0
    while a + number <= N and number<=K:
        z = S[a:a + number]
        answers.append(z)
        number += 1
kotae = []
for a in answers:
    if a in kotae:
        pass
    else:
        kotae.append(a)
kotae = sorted(kotae)
answer=kotae[K]
moji=''
for a in answer:
    moji+=a
print(moji)


### FIXED CODE ###

a,b,c,d=map(int,input().split())
if abs(c-a)<=d:
    print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
    print('Yes')
else:
    print('No')
n = int(input())
print((2*(x//11)) + (n%11>0 and n%11<=6) + (n>6))

### FIXED CODE ###

from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
   n = int(input())
   print((2*(n//11)) + (n%11>0 and n%11<=6) + 2*(n%11>6))



if __name__ == '__main__':
    main()
s = input()
s[3] = "8"
print(s)

### FIXED CODE ###

s = input()
print(s[:3]+"8"+s[4:])
n,m = map(int,input().split())
l = [0]*m
r = [0]*m
for i in range(m):
    l[i],r[i] = map(int,input().split())
if min(r)-max(l)<0:
    print(0)
else:
    print(min(r)-max(l)+1

### FIXED CODE ###

n,m = map(int,input().split())
l = [0]*m
r = [0]*m
for i in range(m):
    l[i],r[i] = map(int,input().split())
if min(r)-max(l) < 0:
    print(0)
else:
    print(min(r)-max(l)+1)
from collections import deque
import sys
n,p=map(int,input().split())

e=[]
for _ in range(n):
    s,t,x = map(int,input().split())
    e.append((s-x,1,x))
    e.append((t-x,-1,x))
e.sort()
q = deque()
for _ in range(p):
    q.append(int(input()))
s=set()
#print(e)
for t,f,x in e:
    while t > q[0] and q:
        #print((t,f,x,q.popleft()))
        q.popleft()
        if len(s) == 0:
            print(-1)
        else:
            print(min(s))
    if not q:
        sys.exit()
    if f == 1:
        s.add(x)
    else:
        s.remove(x)
while q:
    q.pop()
    print(-1)

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
n,q = map(int,input().split())
imos = []
for i in range(n):
    s,t,x = map(int,input().split())
    imos.append((s-x,x))
    imos.append((t-x,-x))
ans = set()
j = 0
for i in range(q):
    d = int(input())
    imos.append((d,1e100))
imos.sort()
m = 1e100
flag = False
for t,stop in imos:
    if stop == 1e100:
        if ans:
            if not flag:
                m = min(ans)
                flag = True
            print(m)
        else:
            print(-1)
    elif stop > 0:
        ans.add(stop)
        if stop < m:
            m = stop
            flag = True
    else:
        ans.remove(-stop)
        if m == -stop:flag = False
a,*b,c = input()
print(a,*b,c, sep='')

### FIXED CODE ###

a,*b,c = input()
print(a,len(b),c, sep='')
from collections import defaultdict

ans=[]
V=defaultdict(set)

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

a,b=map(int,input().split())
V[a].add(b)
V[b].add(a)
ans.append(a)
ans.append(b)

for i in range(1,M):
  a,b=map(int,input().split())
  V[a].add(b)
  V[b].add(a)

def solve(li):
  s=li[0]
  e=li[-1]
  for v in V[s]:
    if not(v in li):
      return solve([v]+li)
  for v in V[e]:
    if not(v in li):
      return solve(li+[v])
  print(len(li))
  print(*li)
  return

solve(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)

from collections import defaultdict
N, M = [int(_) for _ in input().split()]
V = defaultdict(list)
for i in range(M):
    A, B = [int(_) for _ in input().split()]
    V[A].append(B)
    V[B].append(A)

def solve(N, M, V):
    result = [1, V[1][0]]
    used = [False] * (N + 1)
    for x in result:
        used[x] = True

    def check_edge(i):
        for e in V[result[i]]:
            if not used[e]:
                if i == -1:
                    result.append(e)
                else:
                    result.insert(i, e)
                used[e] = True
                return True
        return False

    while True:
        if check_edge(0): continue
        if check_edge(-1): continue
        return result

result = solve(N, M, V)
print(len(result))
print(*result)
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break:
    elif (m == -1 or f == -1) or m+f < 30:
        print(F)
    elif m + f >= 80:
        print(A)
    elif 65 <= m + f < 80:
        print(B)
    elif 50 <= m + f < 65:
        print(C)
    elif 30 <= m + F < 50:
        if r >= 50:
            print(C)
        else:
            print(D)
    else:
        print(F)


### FIXED CODE ###

while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    elif (m == -1 or f == -1) or m+f < 30:
        print('F')
    elif m + f >= 80:
        print('A')
    elif 65 <= m + f < 80:
        print('B')
    elif 50 <= m + f < 65:
        print('C')
    elif 30 <= m + f < 50:
        if r >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')
import sys
n=int(input())
s=[[int(i) for i in l.split()] for l in sys.stdin]
for cx in range(101):
  for cy in range(101):
    flag=True
    flag2=True
    stack2==10**18
    for i in range(n):
      if flag==False:
        break
      x,y,h=s[i]
      H=abs(x-cx)+abs(y-cy)+h
      if h!=0 and flag2:
        stack=H
        flag2=False
      if h==0:
        stack2=min(stack2,H)
      if h!=0 and flag2==False:
        if stack!=H:
          flag=False
          break
    if flag and stack<=stack2:
      print(cx,cy,H)
      exit()

### FIXED CODE ###

n=int(input())
if n==1:
  print("Hello World")
else:
  a=int(input())
  b=int(input())
  print(a+b)
import heapq

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

hpq = list(map(lambda x: -1 * x, A))
for i in range(M):
    heapq.heapify(hpq)
    x = heapq.heappop(hpq)
    heapq.heappush(hpq, x / 2)

sum(map(lambda x: int(-1 * x), hpq)


### FIXED CODE ###

import heapq
 
N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
 
hpq = list(map(lambda x: -1 * x, A))
heapq.heapify(hpq)
for i in range(M):
    x = heapq.heappop(hpq)
    heapq.heappush(hpq, x / 2)

print(sum(map(lambda x: int(-1 * x), hpq)))
a = int(input())
if a = 1:
  print(a)
elif int(a/2) = 0:
  print((a/2)/a)
else:
  print((int(a/2)+1)/a)


### FIXED CODE ###

import math
a=int(input())
b=math.floor(float(a/2))
print(float((a-b)/a))
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

A, B, K = map(int, input().split())
l = list(range(A, B+1))
# if K >= len(l):
#     print(*l, sep="\n")
#     quit()
# ans = list(set(l[:K] + l[-K:]))
# ans.sort()
# 
# print(*ans, sep="\n")


### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1)):
  ans.append(i)
for i in range(max(b-k+1,a),b+1):
  ans.append(i)
ans = sorted(list(set(ans)))
for i in ans:
  print(i)
s = list(map(str,input().split()))
if s[1] == '+'
    print(int(s[0]) + int(s[2]))
else:
    print(int(s[0]) - int(s[2]))

### FIXED CODE ###

s = list(map(str,input().split()))
if s[1] == '+':
    print(int(s[0]) + int(s[2]))
else:
    print(int(s[0]) - int(s[2]))
import numpy as np
n=int(input())
a=np.array([int(x) for x in input().split()])
x=[]
for i in range(np.max(a)):
	s=np.sum((a-i)*(a-i))
	x.append(s)
print(min(x))

### FIXED CODE ###

import numpy as np
n=int(input())
a=np.array([int(x) for x in input().split()])
x=[]
for i in range(-100,101):
	s=np.sum((a-i)*(a-i))
	x.append(s)
print(min(x))
# coding: utf-8

############################

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

if n==0:
    print(x)
    exit()


z=101
p_list = list(map(int,input().split()))
pp_list = [i for i in range(min(p_list),max(p_list)+1)]

for j in p_list:
    pp_list.remove(j)

for k in pp_list:
    zettaiti = abs(x-k)

    if z > zettaiti:
        z = zettaiti
        ans = k

print(ans)

### FIXED CODE ###

# coding: utf-8

############################

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

if n==0:
    print(x)
    exit()

z=101
p_list = list(map(int,input().split()))
pp_list = [i for i in range(102)]

for j in p_list:
    pp_list.remove(j)

for k in pp_list:
    zettaiti = abs(x-k)

    if z > zettaiti:
        z = zettaiti
        ans = k

print(ans)
n = int(input())
people = {}

for i in range(n):
    sentenses = int(input())
    for j in range(sentenses):
        v = list(map(int, input().split()))
        if i in people.keys():
            people[i].append(v)
        else:
            people[i] = [v]
            
ans = 0

for i in range(2**n):
    speaker = []
    p_list = [0] * n
    for j in range(n):
        if ((i >> j) % 2) == 1:
            speaker.append(j)
            p_list[j] = 1

    continue_flag = True
    for s in speaker:
        if continue_flag:
            sentenses = people[s]
            for sent in sentenses:
                if p_list[sent[0]-1] == sent[1]:
                    p_list[sent[0]-1] = sent[1]
                else:
                    continue_flag = False
                    break
        else:
            break
        
    if continue_flag:
        temp_ans = len(speaker)
        ans = max(temp_ans, ans)

print(ans)
            

### FIXED CODE ###


n = int(input())
people = {}

for i in range(n):
    sentenses = int(input())
    if sentenses > 0:
        for j in range(sentenses):
            v = list(map(int, input().split()))
            if i in people.keys():
                people[i].append(v)
            else:
                people[i] = [v]
            
ans = 0

for i in range(2**n):
    speaker = []
    p_list = [0] * n
    for j in range(n):
        if ((i >> j) % 2) == 1:
            speaker.append(j)
            p_list[j] = 1

    continue_flag = True
    for s in speaker:
        if continue_flag:
            if s in people.keys():
                sentenses = people[s]
            else:
                continue
            for sent in sentenses:
                if p_list[sent[0]-1] == sent[1]:
                    p_list[sent[0]-1] = sent[1]
                else:
                    continue_flag = False
                    break
        else:
            break
        
    if continue_flag:
        temp_ans = len(speaker)
        ans = max(temp_ans, ans)

print(ans)
import math, numpy

n = int(input())

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

l = [1]

cumsum_a = numpy.cumsum(a[::-1])[::-1]

if (n > 0) and (a[0] > 0):
    print(-1)
else:
    for i in range(1, n):
        b_max1 = 2 * (l[i - 1] - a[i - 1])
        b_max2 = cumsum_a[i]

        if a[i] > 2 ** i - math.ceil(l[i-1]/2):
            l = -1
            break

        l.append(min(b_max1, b_max2))

    if l != -1:
        l.append(a[-1])
        print(sum(l))
    else:
        print(-1)

### FIXED CODE ###

n = int(input())

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

cumsum_a = a.copy()

for i in range(n-1, -1, -1):
    cumsum_a[i] += cumsum_a[i+1]

ans = 0
childable_node = 1

for i in range(n + 1):
    if a[i] > childable_node:
        ans = -1
        break

    ans += childable_node

    if i < n:
        b_max1 = 2 * (childable_node - a[i])
        b_max2 = cumsum_a[i + 1]
        childable_node = min(b_max1, b_max2)

print(ans)
data = input()
capitalized = data.upper()
list = capitalized.split(" ")
for word in list:
  br = str(word)
  result = br[0:1]
  final += result
print(final)

### FIXED CODE ###

data = input()
list = data.split(" ")
final = ""
for word in list:
  result = word[:1]
  result = result.upper()
  final = final + result
print(final)