Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

a=input()
b=input()
i=0
good=0
while(i<len(a)):
    if(a[i]!=b[i]):
        good+=1
print(good)        

### FIXED CODE ###

a=input()
b=input()

good=0
for i in range(len(a)):
    if(a[i]!=b[i]):
        good+=1
print(good)
### BUGGY CODE ###

N = int(input())
A = [list(map(lambda x: int(x)-1, input().split())) for i in range(N)]

days = 0
games_amount = 0
for i in range(N*(N-1)//2):
    games = 0
    played = set()
    for j in range(N):
        if len(A[j]) == 0 or j in played or A[j][0] in played:
            continue
        if A[A[j][0]][0] == j:
            t1 = A[j].pop(0)
            played.add(t1)
            played.add(A[t1].pop(0))
            games += 1
            games_amount += 1
    if games == 0:
        print(-1)
        exit(0)
    else:
        days += 1
    if games_amount == N*(N-1)//2:
        break
print(days)

### FIXED CODE ###

import time

start = time.time()

N = int(input())
A = [list(map(lambda x: int(x)-1, input().split())) for i in range(N)]
B = [0]*N
days = 0
games_amount = 0

for i in range(N*(N-1)//2):
    games = 0
    played = set()
    for j in range(N):
        if len(A[j]) == 0 or j in played or A[j][0] in played:
            continue
        if A[A[j][0]][0] == j:
            t1 = A[j].pop(0)
            played.add(t1)
            played.add(A[t1].pop(0))
            games += 1
            games_amount += 1
    if games == 0:
        print(-1)
        exit(0)
    else:
        days += 1
    if games_amount == N*(N-1)//2:
        break
    if time.time() - start > 1.9:
        print(N*(N-1)//2)
        exit(0)
print(days)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
x = [0 for i in range(65)]
for i in range(n):
    b = bin(a[i])
    for i in range(len(b)-2):
        x[-i-1] += int(b[-i-1])
mod = 10**9+7
ans = 0
for i in range(1,65):
    ans = (ans + x[-i]*(n-x[-i])*pow(2,i-1,mod))%mod
print(ans)


### FIXED CODE ###

# 入力
N = int(input())
A = list(map(int,input().split()))

ans = 0
P = 10**9+7
bit = [0 for i in range(70)]

# 各bit独立に1が何個あるか数える
for i in range(N):
    S = bin(A[i])
    for j in range(1,len(S)-1):
        if S[-1*j] == '1':
            bit[j-1] += 1

# 各bitの1の個数と0の個数の積が、XOR和が1になる数字の個数と一致
for i in range(70):
    ans += (2**i)*bit[i]*(N-bit[i])
    ans %= P

print(ans)
### BUGGY CODE ###

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

primelist=[]
powerlist=[]

p=2
while P >= p**N:        
    f = 0
    for q in primelist:
        if p % q == 0:
            f = 1
            break
    if f == 1:
        p += 1
        continue
    else:
        k = 0
        while P % (p**N) == 0:
            P //= (p**N)
            k += 1
        primelist.append(p)
        powerlist.append(k)
        p += 1

ans = 1
for i in range(len(primelist)):
    ans *= (primelist[i]**powerlist[i])

print(ans)

### FIXED CODE ###

import math

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

if N == 1:
    print(P)
    exit()

ans = 1
p = 2
logP = math.log(P)
while N * math.log(p) <= logP:
    k = 0
    while P % p == 0:
        P //= p
        k += 1
    ans *= p**(k//N)
    if k > 0:
        logP = math.log(P)

    r = p % 6
    if r == 1:
        p += 4
    elif r == 5:
        p += 2
    else:
        p += 1

print(ans)
### BUGGY CODE ###

from sys import stdin
from collections import defaultdict as dd
from collections import deque as dq
import itertools as it
from math import sqrt, log, log2
from fractions import Fraction

n, k = map(int, input().split())
intensity = list(map(int, stdin.readline().split()))

count = 0
while count < k:
    totsum = 0
    prefs = [0]*n
    zeros = []
    for i in range(n):
        l = i - intensity[i]
        r = i + intensity[i] + 1

        prefs[max(l, 0)] += 1
        if r <= n-1: 
            prefs[r] += -1
            
    for i in range(1, n):
        prefs[i] += prefs[i-1]
        totsum += prefs[i]
    
    if totsum == n*n:
        print(*prefs)
        exit()
    
    intensity = prefs
    count += 1

print(*prefs)

### FIXED CODE ###

from sys import stdin
# from collections import defaultdict as dd
# from collections import deque as dq
# import itertools as it
# from math import sqrt, log, log2
# from fractions import Fraction

n, k = map(int, input().split())
intensity = list(map(int, stdin.readline().split()))

count = 0
while count < k:
    totsum = 0
    prefs = [0]*n
    zeros = []
    for i in range(n):
        l = i - intensity[i]
        r = i + intensity[i] + 1

        prefs[max(l, 0)] += 1
        if r <= n-1: 
            prefs[r] += -1
            
    for i in range(1, n):
        prefs[i] += prefs[i-1]
        totsum += prefs[i]
    
    if sum(prefs) == n*n:
        print(*prefs)
        exit()
    
    intensity = prefs
    count += 1

print(*prefs)
### BUGGY CODE ###

import sys
from heapq import *

H,W=map(int,input().split())
si,sj=[int(x)-1 for x in input().split()]
ti,tj=[int(x)-1 for x in input().split()]

big=10**9
A=[]
for row in sys.stdin:
    A.append([big if x=='.' else '#' for x in row])
A[si][sj]=0

ans=-1
hp=[(0,si,sj)]
dirs=[-2,-1,0,1,2]
while hp:
    k,i,j=heappop(hp)
    if i==ti and j==tj:
        ans=k
        break
    for di in dirs:
        for dj in dirs:
            if di==dj==0:
                continue
            ni,nj=i+di,j+dj
            if not (0<=ni<H and 0<=nj<W):
                continue
            if A[ni][nj]=='#':
                continue
            if (abs(di)==1 and dj==0) or (di==0 and abs(dj)==1):
                nk=k
            else:
                nk=k+1
            if nk>=A[ni][nj]:
                continue
            A[ni][nj]=nk
            heappush(hp,(nk,ni,nj))

print(ans)


### FIXED CODE ###

import sys
from heapq import *

H,W=map(int,input().split())
si,sj=[int(x)-1 for x in input().split()]
ti,tj=[int(x)-1 for x in input().split()]
A=list(sys.stdin)

ans=-1
hp=[(0,si,sj)]
dirs=[-2,-1,0,1,2]
dist=[[float('inf')]*W for _ in range(H)]
dist[si][sj]=0
while hp:
    k,i,j=heappop(hp)
    if i==ti and j==tj:
        ans=k
        break
    if k>dist[i][j]:
        continue
    for di in dirs:
        for dj in dirs:
            if di==dj==0:
                continue
            ni,nj=i+di,j+dj
            if not (0<=ni<H and 0<=nj<W):
                continue
            if A[ni][nj]=='#':
                continue
            if abs(di)+abs(dj)==1:
                nk=k
            else:
                nk=k+1
            if nk>=dist[ni][nj]:
                continue
            dist[ni][nj]=nk
            heappush(hp,(nk,ni,nj))

print(ans)
### BUGGY CODE ###

import sys
from math import factorial
#import numpy as np

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) # applies to numbers only
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

MOD = 10 ** 9 + 7
N, K = rl()
A = rl()
A.sort()
min = A[0]
A = [(x - min)%MOD for x in A]
#最大値として何回登場するか
count = 0
fac = factorial
for i in range(K-1, N):
    # A[i] * iC(k-1)
    count += A[i] * fac(i) * pow(fac(K-1) * fac(i-(K-1)) % MOD, MOD-2, MOD) % MOD
    count %= MOD
for i in range(N-K+1):
    # A[i] * (N-(i+1)) C (k-1)
    n = (N-(i+1)); k = K-1
    count -= A[i] * fac(n) * pow(fac(k) * fac(n-k) % MOD, MOD-2, MOD) % MOD
    count %= MOD

print(count)


### FIXED CODE ###

import sys
from math import factorial
import numpy as np

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) # applies to numbers only
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

def cumprod(arr, MOD):
    L = len(arr); Lsq = int(L**.5+1)
    arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
    for n in range(1, Lsq):
        arr[:, n] *= arr[:, n-1]; arr[:, n] %= MOD
    for n in range(1, Lsq):
        arr[n] *= arr[n-1, -1]; arr[n] %= MOD
    return arr.ravel()[:L]

def make_fact(U, MOD):
    x = np.arange(U, dtype=np.int64); x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64); x[0] = pow(int(fact[-1]), MOD-2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    return fact, fact_inv

U = 10**6
MOD = 10 ** 9 + 7
fact, fact_inv = make_fact(U, MOD)
N, K = rl()
A = rl()
A.sort()
min = A[0]
A = [(x - min)%MOD for x in A]
#最大値として何回登場するか
count = 0

for i in range(K-1, N):
    # A[i] * iC(k-1)
    count += A[i] * fact[i] % MOD * fact_inv[K-1] % MOD * fact_inv[i-(K-1)] % MOD
    count %= MOD
for i in range(N-K+1):
    # A[i] * (N-(i+1)) C (k-1)
    count -= A[i] * fact[N-(i+1)] % MOD * fact_inv[K-1] % MOD * fact_inv[N-(i+1)-(K-1)] % MOD
    count %= MOD

print(count)
### BUGGY CODE ###

from collections import Counter

N = int(input())
S = input()
count = Counter(S)

# print(count)
ans = 0
R = count["R"]
G = count["G"]
B = count["B"]
ans = R * G * B

# for i in range(N - 2):
#     if S[i] == "R":
#         for j in range(i + 1, N - 1):
#             if S[j] == "G":
#                 b_count = Counter(S[j:])["B"]
#                 ans += b_count

# print(R, G, B, ans)

for i in range(N):
    for j in range(N):
        if i + j * 2 < N and S[i] == "R" and S[i + j] == "G" and S[i + j * 2] == "B":
            ans -= 1
        if i + j * 2 < N and S[i] == "R" and S[i + j] == "B" and S[i + j * 2] == "G":
            ans -= 1
        if i + j * 2 < N and S[i] == "G" and S[i + j] == "R" and S[i + j * 2] == "B":
            ans -= 1
        if i + j * 2 < N and S[i] == "G" and S[i + j] == "B" and S[i + j * 2] == "R":
            ans -= 1
        if i + j * 2 < N and S[i] == "B" and S[i + j] == "G" and S[i + j * 2] == "R":
            ans -= 1
        if i + j * 2 < N and S[i] == "B" and S[i + j] == "R" and S[i + j * 2] == "G":
            ans -= 1
print(ans)


### FIXED CODE ###

from collections import Counter

N = int(input())
S = input()
count = Counter(S)

# print(count)
ans = 0
R = count["R"]
G = count["G"]
B = count["B"]
ans = R * G * B

# for i in range(N - 2):
#     if S[i] == "R":
#         for j in range(i + 1, N - 1):
#             if S[j] == "G":
#                 b_count = Counter(S[j:])["B"]
#                 ans += b_count

# print(R, G, B, ans)

for i in range(N):
    for j in range(N):
        if i + j * 2 < N and S[i] == "R" and S[i + j] == "G" and S[i + j * 2] == "B":
            ans -= 1
        if i + j * 2 < N and S[i] == "R" and S[i + j] == "B" and S[i + j * 2] == "G":
            ans -= 1
        if i + j * 2 < N and S[i] == "G" and S[i + j] == "R" and S[i + j * 2] == "B":
            ans -= 1
        if i + j * 2 < N and S[i] == "G" and S[i + j] == "B" and S[i + j * 2] == "R":
            ans -= 1
        if i + j * 2 < N and S[i] == "B" and S[i + j] == "G" and S[i + j * 2] == "R":
            ans -= 1
        if i + j * 2 < N and S[i] == "B" and S[i + j] == "R" and S[i + j * 2] == "G":
            ans -= 1
print(ans)
### BUGGY CODE ###

s = input()
n = len(s)

if n<5: ans = 0
else:
    ans = 0
    for i in range(n):
        for j in range(i+5, n+1):
            num = int(s[i:j])
            if int(num)%2019==0: ans += 1

print(ans)


### FIXED CODE ###

arr = [0 for i in range(2019)]
arr[0] = 1

s = input()
n = len(s)

num = 0
for i,ele in enumerate(s[::-1]):
    num += int(ele) * pow(10, i, 2019)
    arr[num%2019] += 1


ans = 0
for m in arr:
    if m==0: continue
    ans += m*(m-1)//2

print(ans)
### BUGGY CODE ###

import itertools
n, x, y = map(int, input().split())
x -= 1
y -= 1
list1 = [0] * (n * n)

for i in range(n):
    for j in range(n):
        if list1[n * j + i]  != 0:
            continue
        
        list1[n * i + j] = min([abs(j - i), abs(x - i) + 1 + abs(j - y), abs(y - i) + 1 + abs(x - j)])
        
#list2 = list(itertools.chain.from_iterable(list1))

for k in range(1,n):
    print(list1.count(k))

### FIXED CODE ###

n, x, y = map(int, input().split())
x -= 1
y -= 1

cnt_list = [0] * (n - 1)

for i in range(n):
    for j in range(n):
        if j <= i:
            continue
        
        #i < j,x < yのとき、i→y→x→jが最短になることはない
        num = min([j - i, abs(x - i) + 1 + abs(y - j)]) - 1 #距離 - 1、距離ゼロはif文で排除
        cnt_list[num] += 1

for n in cnt_list:
    print(n)
### BUGGY CODE ###

import sys
def main():
    input = sys.stdin.readline
    Dy = [0,1,0,-1]
    Dx = [1,0,-1,0]
    H, W, K = map(int, input().split())
    y1,x1,y2,x2 = map(int, input().split())
    C = ["@" + input() for _ in range(H)]
    C = ["@"*(W+2)] + C + ["@"*(W+2)]
    Nexts = [[[1]*(W+2) for _ in range(H+2)] for _ in range(4)]
    q = [(y1, x1)]
    ans = 0
    while q:
        q_new = []
        for y0, x0 in q:
            if (y0, x0) == (y2, x2):
                print(ans)
                exit()
            for dy, dx, Next in zip(Dy, Dx, Nexts):
                y, x = y0, x0
                sum_next = 0
                Path = [(y, x)]
                while True:
                    sum_next += Next[y][x]
                    y = y0 + dy * sum_next
                    x = x0 + dx * sum_next
                    if sum_next > K or C[y][x] != ".":
                        break
                    Path.append((y, x))
                    q_new.append((y, x))
                for path_y, path_x in Path:
                    Next[path_y][path_x] = abs(path_y-y) + abs(path_x-x)
        q = q_new
        ans += 1
    print(-1)

main()


### FIXED CODE ###

Dy = [0,1,0,-1]
Dx = [1,0,-1,0]
H, W, K = map(int, input().split())
y1,x1,y2,x2 = map(int, input().split())
C = ["@" + input() + "@" for _ in range(H)]
C = ["@"*(W+2)] + C + ["@"*(W+2)]
L = [[1]*(W+2) for _ in range(H+2)]
R = [[1]*(W+2) for _ in range(H+2)]
U = [[1]*(W+2) for _ in range(H+2)]
D = [[1]*(W+2) for _ in range(H+2)]
q = [(y1, x1)]
ans = 0
while q:
    q_new = []
    for y0, x0 in q:
        if (y0, x0) == (y2, x2):
            print(ans)
            exit()
        for dy, dx, Next in zip(Dy, Dx, [L, R, U, D]):
            y, x = y0, x0
            sum_next = 0
            Path = [(y, x)]
            while True:
                sum_next += Next[y][x]
                y = y0 + dy * sum_next
                x = x0 + dx * sum_next
                if sum_next > K:
                    break
                if C[y][x] == "@":
                    break
                Path.append((y, x))
                q_new.append((y, x))
            for path_y, path_x in Path:
                Next[path_y][path_x] = abs(path_y-y) + abs(path_x-x)
    q = q_new
    ans += 1

print(-1)
### BUGGY CODE ###

N,Q=map(int,input().split())
road=[]
Ans=[]
for i in range(N):
    s,t,x=map(int,input().split())
    road.append((x,s-0.5-x,t-0.5-x))
road.sort()
for i in range(Q):
    s=int(input())
    ans=-1
    for i in range(N):
        if road[i][1]<=s<=road[i][2]:
            ans=road[i][0]
            break
    Ans.append(ans)
for i in range(Q):
    print(Ans[i])

### FIXED CODE ###

import bisect
N,Q=map(int,input().split())
road=[]
pos=[]
for _ in range(N):
    s,t,x=map(int,input().split())
    road.append((s-x,t-x,x))
for _ in range(Q):
    pos.append(int(input()))
road.sort(key=lambda x:x[2])
ans=[-1]*Q
ischecked=[-1]*Q
for s,t,x in road:
    l=bisect.bisect_left(pos,s)
    r=bisect.bisect_left(pos,t)
    while l<r:
        if ischecked[l]==-1:
            ischecked[l]=r
            ans[l]=x
            l+=1
        else:
            l=ischecked[l]
for i in range(Q):
    print(ans[i])
### BUGGY CODE ###

from collections import deque

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

rev_p = [0] * (n * n)
for offset in range(len(p)):
    rev_p[p[offset] - 1] = offset

ans = 0
for i, pi in enumerate(p):
    d = deque()
    d.append((0, pi-1))
    memo = set()

    while d:
        cost, pos = d.popleft()

        if pos < n or pos >= n * (n-1) or pos % n == 0 or pos % n == n-1:
            ans += cost
            break

        for offset in [-1, -n, 1, n]:
            if 0 <= pos + offset < n * n:
                if pos + offset not in memo:
                    memo.add(pos + offset)

                    if rev_p[pos + offset] < i:
                        d.appendleft((cost, pos + offset))
                    else:
                        d.append((cost + 1, pos + offset))

print(ans)


### FIXED CODE ###

from collections import deque

n = int(input())
n2 = n * n
p = list(map(int, input().split()))

costs = [0] * n2

for i in range(n2):
    costs[i] = min(i // n, n - i // n - 1, i % n, n - i % n - 1)

remains = [1] * n2

ans = 0
for i, pi in enumerate(p):
    ans += costs[pi-1]
    remains[pi-1] = 0

    d = deque()
    d.append((pi-1, costs[pi-1]))

    while d:
        pos, cost = d.popleft()

        for offset in [-1, -n, 1, n]:
            if 0 <= pos + offset < n2:
                next_cost = cost + remains[pos]

                if costs[pos+offset] > next_cost:
                    costs[pos+offset] = next_cost
                    d.append((pos+offset, next_cost))

print(ans)
### BUGGY CODE ###

n = int(input())
s = input()
ans=10000000
for i in range(n+1):
    s1 = s[0:i]
    s2 = s[i:n]
    w=s1.count('W')
    e=s2.count('E')
    counter=w+e
    ans=min(ans,counter)
print(ans)

### FIXED CODE ###

n = int(input())
s = input()
east = s.count('E')
ans = east
for i in range(n):
  if s[i]=='E': east-=1
  if i>=1:
    if s[i-1]=='W': east+=1
  ans = min(ans,east)
print(ans)
### BUGGY CODE ###

N = [int(i) for i in input().split()][0]
string = list(input())
Q = [int(i) for i in input().split()][0]
queries =[[i for i in input().split()] for _ in range(Q)]


for que in queries:
  type_, pos, st = que
  if type_ == "1":
    string[int(pos)-1] = st
  else:
    lq = int(pos) - 1
    rq = int(st)
    print(len(set(string[lq:rq])))


### FIXED CODE ###



N = [int(i) for i in input().split()][0]
string = list(input())
Q = [int(i) for i in input().split()][0]
queries = [[i for i in input().split()] for _ in range(Q)]

tmp = N 
c = 0
while tmp > 0:
  c += 1
  tmp //= 2
N2 = 2**c
offset = N2 - 1

seg_tree = [0 for _ in range(N2*2 -1)]
for n in range(N):
  ind = ord(string[n]) - ord("a")
  seg_tree[offset + n] = 1 << ind

def set_seg_tree(i, seg_trees):
  if i >= N2 -1:
    return seg_trees[i]
  left = 2*i + 1
  right = 2*i + 2
  l_seg = set_seg_tree(left, seg_trees)
  r_seg = set_seg_tree(right, seg_trees)
  seg_trees[i] = l_seg | r_seg
  return seg_trees[i]
set_seg_tree(0, seg_tree)
    
def update(i, c, seg_trees):
  i += offset
  seg_trees[i] = 1 << c
  while i > 0:
    i = (i - 1)//2
    seg_trees[i] = seg_trees[i * 2 + 1] | seg_trees[i * 2 + 2]

def get_sum(a, b, k, l, r, seg_trees):
  if (b <= l) or (r <= a):
    return 0
  if (a <= l) and (r <= b):
    return seg_trees[k]
  vl = get_sum(a, b, k * 2 + 1, l, (l + r)//2, seg_trees)
  vr = get_sum(a, b, k * 2 + 2, (l + r)//2, r, seg_trees)
  return vl | vr

for query in queries:
  type_, i, q = query
  if type_ == "1":
    i = int(i) - 1
    pos = ord(q) - ord("a")
    update(i, pos, seg_tree)
  else:
    l = int(i) - 1
    r = int(q)
    ret = get_sum(l, r, 0, 0, N2, seg_tree)
    print(bin(ret).count("1"))
### BUGGY CODE ###

import sys
input = sys.stdin.readline

N,M,V,P = map(int, input().split())
a = list(map(int, input().split()))
A = sorted(a)[::-1]
           
right = P-1
left = N

while left - right !=1:
    
    i = (left+right)//2
    b = (V-((P-1)+(N-i)))
    target = A[i]+M
        
    if b<0:
        if A[P-1]<=target:
            right = i
    else:
        if target<A[P-1]:
            left = i
        else:
            Q_sum=sum(A[P-1:i])
            len_Q =i-(P-1)
            if target*len_Q-Q_sum>=b*M:
                right = i
            else:
                left =i


print(right+1)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N,M,V,P = map(int, input().split())
a = list(map(int, input().split()))
A = sorted(a)[::-1]
           
right = P-1
left = N

while left - right !=1:
    
    i = (left+right)//2
    b = (V-((P-1)+(N-i)))
    target = A[i]+M

        
    if b<0:
        if A[P-1]<=target:
            right = i
        else:
            left = i
    else:
        if target<A[P-1]:
            left = i
        else:
            Q_sum=sum(A[P-1:i])
            len_Q =i-(P-1)
            if target*len_Q-Q_sum>=b*M:
                right = i
            else:
                left =i


print(right+1)
### BUGGY CODE ###

import itertools
import heapq
import copy

def inv(l):
    return list(map(lambda x: x*-1, l))

def solve(A,B,C, K):
    A,B,C = inv(A), inv(B), inv(C)
    A = sorted(A)
    B = sorted(B)
    C = sorted(C)
    ind = set([(0,0,0)])

    h = [(A[0]+ B[0]+ C[0], (0,0,0))]
    res = []

    for _ in range(K):
        h2 = copy.copy(h)
        for (val, (i,j,k)) in h2:
            if i+1 < len(A) and (i+1,j,k) not in ind:
                heapq.heappush(h, (A[i+1]+B[j]+C[k], (i+1, j, k)))
                ind |= set([(i+1,j,k)])
            if j+1 < len(B) and (i,j+1, k) not in ind:
                heapq.heappush(h, (A[i]+B[j+1]+C[k], (i, j+1, k)))
                ind |= set([(i,j+1,k)])
            if k+1 < len(C) and (i,j, k+1) not in ind:
                heapq.heappush(h, (A[i]+B[j]+C[k+1], (i, j, k+1)))
                ind |= set([(i,j,k+1)])
        res += [heapq.heappop(h)]
    for r in res:
        print(r[0]*-1)

la,lb,lc,K = list(map(int, input().split(' ')))
A = list(map(int, input().split(' ')))
B = list(map(int, input().split(' ')))
C = list(map(int, input().split(' ')))

solve(A,B,C,K)

### FIXED CODE ###

import itertools
import heapq
import copy

def inv(l):
    return list(map(lambda x: x*-1, l))

def solve(A,B,C, K):
    A,B,C = inv(A), inv(B), inv(C)
    A = sorted(A)
    B = sorted(B)
    C = sorted(C)
    ind = set([(0,0,0)])

    h = [(A[0]+ B[0]+ C[0], (0,0,0))]
    res = []

    for _ in range(K):
        h2 = copy.copy(h)
        val, (i,j,k) = heapq.heappop(h)
        res += [-val]
        if i+1 < len(A) and (i+1,j,k) not in ind:
            heapq.heappush(h, (A[i+1]+B[j]+C[k], (i+1, j, k)))
            ind |= set([(i+1,j,k)])
        if j+1 < len(B) and (i,j+1, k) not in ind:
            heapq.heappush(h, (A[i]+B[j+1]+C[k], (i, j+1, k)))
            ind |= set([(i,j+1,k)])
        if k+1 < len(C) and (i,j, k+1) not in ind:
            heapq.heappush(h, (A[i]+B[j]+C[k+1], (i, j, k+1)))
            ind |= set([(i,j,k+1)])
    for r in res:
        print(r)

la,lb,lc,K = list(map(int, input().split(' ')))
A = list(map(int, input().split(' ')))
B = list(map(int, input().split(' ')))
C = list(map(int, input().split(' ')))

solve(A,B,C,K)
### BUGGY CODE ###

import numpy as np

S = input()
check = []
ans = 0
plo = np.zeros(13, dtype = int)
N = len(S)
for i in range(N):
    if S[N - 1 - i] == '?':
        check.append(i)
    else:
        ans += int(S[N - 1 - i])*10**i
if len(check) == 0:
    print((ans % 13 == 5) * 1)
else:
    p = check.pop()
    for i in range(10):
        j = (i * 10 ** p) % 13
        plo[j] = 1
    for p in check:
        temp = np.zeros(13, dtype = int)
        for i in range(10):
            j = (i * 10 ** p) % 13
            temp += np.r_[plo[-j:],plo[:-j]]
        plo = temp
        plo = plo % (10**9+7)
    l = (5 - ans % 13) % 13
    print(plo[l] % (10 ** 9 + 7))

### FIXED CODE ###

from copy import copy

MOD = 10**9 + 7
s = input()
count = [0 for _ in range(13)]
count[0] = 1
for i in range(len(s)):
    new = [0 for _ in range(13)]
    for m in range(13):
        new[(m * 10) % 13] = count[m]
    count = new
    if s[i] != "?":
        div = int(s[i])
        count = count[-div:] +  count[:-div]
    else:
        new = [0 for _ in range(13)]
        pre = sum(count[:3])
        SUM = sum(count) % MOD
        for j in range(13):
            pre += count[(j+3) % 13]
            pre -= count[j % 13]
            new[j] = (SUM - pre) % MOD
        count = new
print(count[5])
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
if ans > 10**18:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
    if a[i] == 0:
        print(0)
        exit()
for i in range(n):
    ans *= a[i]
    if ans > 1000000000000000000:
        break
if ans > 1000000000000000000:
    print(-1)
else:
    print(ans)