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

from bisect import bisect_left
x,y,z,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
c=sorted([int(i) for i in input().split()],reverse=True)
ab_max=[]
for i in range(x):
    for j in range(y):
        ab_max.append(a[i]+b[j])
ab_max.sort()
def unti(t_sub):
    ret=0
    for i in range(x*y):
        h=z-bisect_left(c,t_sub-ab_max[i])
        if h!=0:
            ret+=h
        else:
            return ret
    return ret
l,r=0,ab_max[0]+max(c)
while r>l+1:
    t=(l+r)//2
    if unti(t)>=k:
        r=t
    else:
        l=t
ans=[]
f=False
for i in range(x*y):
    for j in range(z):
        u=ab_max[i]+c[j]
        if u>=r:
            ans.append(u)
        else:
            if j==0:f=True
            break
    if f:
        break
ans.sort(reverse=True)
for i in range(k):
    print(ans[i])


### FIXED CODE ###

import heapq
x,y,z,k=map(int,input().split())
#heapqは小さい順にしか並べられないので、-をつければ大きい順になる
a=sorted([-int(i) for i in input().split()])
b=sorted([-int(i) for i in input().split()])
c=sorted([-int(i) for i in input().split()])
check=set()
ans=[]
heapq.heappush(ans,(a[0]+b[0]+c[0],0,0,0))
check.add((0,0,0))
for i in range(k):
    h=heapq.heappop(ans)
    print(-h[0])
    if h[1]+1<x:
        if (h[1]+1,h[2],h[3]) not in check:
            heapq.heappush(ans,(a[h[1]+1]+b[h[2]]+c[h[3]],h[1]+1,h[2],h[3]))
            check.add((h[1]+1,h[2],h[3]))
    if h[2]+1<y:
        if (h[1],h[2]+1,h[3]) not in check:
            heapq.heappush(ans,(a[h[1]]+b[h[2]+1]+c[h[3]],h[1],h[2]+1,h[3]))
            check.add((h[1],h[2]+1,h[3]))
    if h[3]+1<z:
        if (h[1],h[2],h[3]+1) not in check:
            heapq.heappush(ans,(a[h[1]]+b[h[2]]+c[h[3]+1],h[1],h[2],h[3]+1))
            check.add((h[1],h[2],h[3]+1))
'''
while len(ans)!=0:
    print(heapq.heappop(ans)[0])
'''
### BUGGY CODE ###

import fractions
import math

A, B = map(int, input().split())
C = fractions.gcd(A, B)
pfac = []

def get_primes(n):
  primes = [2]
  for i in range(3, (n+1), 2):
    for p in primes:
      if i % p == 0:
        break
      if i < p ** 2:
        primes.append(i)
        break
    else:
      primes.append(i)
  return primes

def get_primes2(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

for p in get_primes(min(C, 10**6)):
  if p ** 2 > C:
    break
  if C % p == 0:
    pfac.append(p)
    while C % p == 0:
      C //= p
if C != 1:
  pfac.append(C)


print(len(pfac) + 1)

### FIXED CODE ###

import fractions
import math

A, B = map(int, input().split())
C = fractions.gcd(A, B)
pfac = []

def get_primes(n):
  primes = [2]
  for i in range(3, (n+1), 2):
    for p in primes:
      if i % p == 0:
        break
      if i < p ** 2:
        primes.append(i)
        break
    else:
      primes.append(i)
  return primes

def get_primes2(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n == 1:
        return []
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

for q in get_primes2(min(C, 10**6)):
  if q ** 2 > C:
    break
  if C % q == 0:
    pfac.append(q)
    while C % q == 0:
      C //= q
if C != 1:
  pfac.append(C)


print(len(pfac) + 1)
### BUGGY CODE ###

def main():
    H, W = map(int, input().split())
    A = []
    B = []
    M = 80 * (H + W)
    for _ in range(H):
        a = tuple(map(int, input().split()))
        A.append(a)
    for _ in range(H):
        b = tuple(map(int, input().split()))
        B.append(b)
    AB = [[0] * W for _ in range(H)]
    for i in range(H):
        for j in range(W):
            AB[i][j] = abs(A[i][j] - B[i][j])
    l = [[[0] * (M+1) for _ in range(W)] for _ in range(H)]
    for i in range(H):
        for j in range(W):
            if i == 0 and j == 0:
                l[i][j][AB[0][0]] = 1
            else:
                t = AB[i][j]
                for k in range(M+1):
                    if i > 0 and l[i-1][j][k] == 1:
                        l[i][j][k+t] = 1
                        l[i][j][abs(k-t)] = 1
                    if j > 0 and l[i][j-1][k] == 1:
                        l[i][j][k+t] = 1
                        l[i][j][abs(t-k)] = 1
    for k in range(M):
        if l[-1][-1][k] == 1:
            return k
print(main())



### FIXED CODE ###

import sys
def main():
    input = sys.stdin.readline
    H, W = map(int, input().split())
    A = []
    B = []
    M = 80 * (H + W)
    for _ in range(H):
        a = tuple(map(int, input().split()))
        A.append(a)
    for _ in range(H):
        b = tuple(map(int, input().split()))
        B.append(b)
    AB = [[0] * W for _ in range(H)]
    for i in range(H):
        for j in range(W):
            AB[i][j] = abs(A[i][j] - B[i][j])
    l = [set([]) for _ in range(W)]
    lt = [set([]) for _ in range(W)]
    for i in range(H):
        for j in range(W):
            if i == 0 and j == 0:
                lt[j].add(AB[0][0])
            else:
                t = AB[i][j]
                if i > 0:
                    for k in l[j]:
                        lt[j].add(k+t)
                        lt[j].add(abs(k-t))
                if j > 0:
                    for k in lt[j-1]:
                        lt[j].add(k+t)
                        lt[j].add(abs(k-t))
        l = lt
        lt = [set([]) for _ in range(W)]
    return min(l[-1])
print(main())
### BUGGY CODE ###

import numpy as np
A,B,C,D = map(int, input().split())
cmlist,dmlist=[],[]
count=0
for i in range(A,B+1):
    if i%C != 0 and i%D != 0:
        count+=1
print(count)

### FIXED CODE ###

A,B,C,D = map(int, input().split())

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

lcm=C*D//gcd(C,D)
con1=B//C - (A-1)//C
con2=B//D - (A-1)//D
con3=B//lcm - (A-1)//lcm

print(B-(A-1)-(con1+con2-con3))
### BUGGY CODE ###

from collections import deque

N, K = map(int, input().split())
LR = [tuple(map(int, input().split())) for _ in range(K)]

MOD = 998244353

D = deque([1], N)
for i in range(1, N):
  count = 0
  for l, r in LR:
    if l <= i:
      count += sum(D[i-k] for k in range(l, min(i, r) + 1))
  D.append(count % MOD)
print(D[-1])

### FIXED CODE ###

N, K = map(int, input().split())
LR = [tuple(map(int, input().split())) for _ in range(K)]

D = [1]
M = 100
memo = []
memo2 = []
for i in range(1, N):
  count = 0
  for l, r in LR:
    if l <= i:
      l1 = i - min(i, r)
      r1 = i - l + 1
      l2 = (l1 + M - 1) // M
      r2 = r1 // M
      l3 = (l2 + M - 1) // M
      r3 = r2 // M
      if r3 > l3:
        count += sum(D[l1:l2*M]) + sum(memo[l2:l3*M]) + sum(memo2[l3:r3]) + sum(memo[r3*M:r2]) + sum(D[r2*M:r1])
      elif r2 > l2:
        count += sum(D[l1:l2*M]) + sum(memo[l2:r2]) + sum(D[r2*M:r1])
      else:
        count += sum(D[l1:r1])
  D.append(count % 998244353)
  if len(D) % M == 0:
    memo.append(sum(D[-M:]))
    if len(memo) % M == 0:
      memo2.append(sum(memo[-M:]))
print(D[-1])
### BUGGY CODE ###

from collections import deque

h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
#s = np.array(s)
#s = (s == ".") * 1
def neext(a):
    l, m = a[0], a[1]
    return [(l, m+1), (l, m-1), (l+1, m), (l-1, m)]
def solve(i, j):
    if s[i][j] == '#':
        return 0
    else:
        pre = 0
        p = [[-1] * w for _ in range(h)]
        check = deque([((i, j), 0)])#(from,now, dist)
        while check:
            now, d = check.popleft()
            p[now[0]][now[1]] = d
            pre = max(pre, d)
            for b, c in neext((now[0], now[1])):
                if b < 0 or c < 0 or b >= h or c >= w:
                    continue 
                if p[b][c] != -1 or s[b][c] == '#':
                    continue
                else:
                    check.append(((b, c), d + 1))
        return pre
ans = 0
for H in range(len(s)):
    for W in range(len(s[0])):
        ans = max(ans, solve(H, W))
print(ans)

### FIXED CODE ###

import numpy as np
from collections import deque
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
ans = 0
for i in range(len(s)):
    for j in range(len(s[0])):
        if s[i][j] == '#':
            continue
        pre = 0
        p = np.full((h, w), -1)
        p[i][j] = 0
        check = deque([((i, j), 0)])#(from,now, dist)
        while check:
            now, d = check.popleft()
            pre = max(pre, d)
            for k, l in [(1,0), (-1,0),(0,1), (0,-1)]:
                b = now[0] + k
                c = now[1] + l
                if b < 0 or c < 0 or b >= h or c >= w:
                    continue 
                elif p[b][c] == -1 and s[b][c] != '#':
                    check.append(((b, c), d + 1))
                    p[b][c] = d + 1
        ans = max(ans, pre)

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

kazu1 = list(map(int, input().split()))
kazu2 = list(map(int, input().split()))
n = 0

for i in range(kazu1[1]):
    kazu2[kazu2.index(max(kazu2))] = 0

n += sum(kazu2)

print(n)

### FIXED CODE ###

kazu1 = list(map(int, input().split()))
kazu2 = list(map(int, input().split()))
n = 0
kazu2.sort(reverse=True)

kazu2[:kazu1[1]] = [0]

n += sum(kazu2)

print(n)
### BUGGY CODE ###

#!/usr/bin/python

import math
import sys

def main(argv):
    for line in sys.stdin:
        n = int(line)

        print math.factorial(n) % (10 ** 9 + 7)

if __name__ == "__main__":
    main(sys.argv)

### FIXED CODE ###

#!/usr/bin/python

import math
import sys

def main(argv):
    for line in sys.stdin:
        n = int(line)

        answer = 737935835
        if n < 50000:
            answer = math.factorial(n)
        elif n > 50000:
            for i in xrange(50001, n + 1):
                answer = (answer * i) % (10**9 + 7)
        print answer % (10**9 + 7)

if __name__ == "__main__":
    main(sys.argv)
### BUGGY CODE ###

n = int(input())

p = [int(s) for s in input().split()]
flag = -1
m_ans = 0
for i in range(n):
    for j in range(i+1):
        if(p[j] < p[i]):
            #print(p[j],p[i])
            m_ans += 1
            break
    


print(n - m_ans)

### FIXED CODE ###

n = int(input())

p = [int(s) for s in input().split()]
flag = -1
m_ans = 1
p_z = p[0]
for i in range(1,n):
    p_z = min(p_z,p[i])
    if(p_z >= p[i]):
        #print(p[j],p[i])
        m_ans += 1
    
print(m_ans)
### BUGGY CODE ###

A, B, K = (int(i) for i in input().split()) 
 
for j in range(K):
  if A >0:
    A -= 1
  elif B >0:
    B -= 1
  else:
    break
 
print(A, B)

### FIXED CODE ###

i = list(map(int, input().split()))
A = i[0]
B = i[1]
K = i[2]

if K <= A :
    A -= K
elif K <= A + B :
    B -= K - A
    A = 0
else :
    A = 0
    B = 0

print(A, B)
### BUGGY CODE ###

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()
A = lr()
A.sort()
diffs = [0] * N
MOD = 10 ** 9 + 7
if K == 1:
    print(0)
    exit()
for x in range(K-1, N):
    # x は最大値と最小値のindexの差
    for i in range(N-x):
        diffs[x] += A[i+x] - A[i]

def cmb(n, k):
    # nCkを計算する
    k = min(k, n-k)
    return fac[n] * ifac[k] * ifac[n-k] % MOD

def make_tables(n):
    # 階乗テーブル、逆元の階乗テーブルを作成する
    fac = [1, 1] # 階乗テーブル
    ifac = [1, 1] # 逆元の階乗テーブル
    inverse = [0, 1] # 逆元テーブル 0の階乗は1 0の逆元は0

    for i in range(2, n+1):
        fac.append((fac[-1] * i) % MOD)
        inverse.append((-inverse[MOD % i] * (MOD//i)) % MOD)
        ifac.append((ifac[-1] * inverse[-1]) % MOD)
    return fac, ifac

fac, ifac = make_tables(N+1)
answer = 0
for i in range(K-1, N):
    # i-1 C K-2 を足す
    answer += diffs[i] * cmb(i-1, K-2)

print(answer % MOD)
# 51

### 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 ###

import sys
input=sys.stdin.readline
n=int(input())
x=input().rstrip()
def popcnt(x):
    cnt=str(bin(x)).count("1")
    x%=cnt
    return x

a=0
for i in range(n):
    if x[-i-1]=="1":
        a+=2**i
for i in range(n):
    if x[i]=="1":
        b=a-2**(n-i-1)
    else:
        b=a+2**(n-i-1)
    p=0
    while b>=1:
        b=popcnt(b)
        p+=1
    print(p)

### FIXED CODE ###

import sys
input=sys.stdin.readline
n=int(input())
x=input().rstrip()
x10=int(x,2)
pcx=x.count("1")

plus=x10%(pcx+1)
if pcx>=2:
    minus=x10%(pcx-1)

def popcnt(x):
    cnt=1
    while x>=1:
        x%=(bin(x).count("1"))
        cnt+=1
    return cnt

for i in range(n):
    if x[i]=="0":
        amari=(plus+pow(2,n-i-1,pcx+1))%(pcx+1)
        print(popcnt(amari))
    else:
        if pcx==1:
            print(0)
        else:
            amari=(minus-pow(2,n-i-1,pcx-1))%(pcx-1)
            print(popcnt(amari))
### BUGGY CODE ###

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

L_sorted = sorted(L)

def bis(left, right, SrcList, value):
    if SrcList[left] >= value:
        return -1 # no results
    elif SrcList[right] < value:
        return -2 # all results
    while (left + 1 < right):
        mid = (left + right) // 2
        if SrcList[mid] < value:
            left = mid
        else:
            right = mid
    return left


count = 0
for i in range(0, N-2):
    for j in range(i+1,N-1):
        r = bis(j+1, N-1, L_sorted, L_sorted[i] + L_sorted[j])
        if r == -1:
            pass
        elif r == -2:
            count += ((N-j) * (N-j-1))//2
            break
        else:
            count += r-j
        

print(count)

### FIXED CODE ###

from bisect import bisect_right

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

L_sorted = sorted(L)

count = 0
for i in range(N):  # longest stick
    for j in range(i):  # second longest stick
        r = bisect_right(L_sorted, L_sorted[i] - L_sorted[j])
        count += max(0, j - r)

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


N = input()
S = input()
sli = [c for c in S]

nR = sli.count('R')
nG = sli.count('G')
nB = sli.count('B')

dx = 1
ng = 0
for i, c in enumerate(sli):
    rl = []
    dx = 1
    while 1:
        if dx * 2 + i > len(sli) - 1:
            break
        rl.append([i, i + dx, i + dx*2])
        dx += 1

    for ind in rl:
        if len(set([sli[ind[0]], sli[ind[1]], sli[ind[2]]])) == 3:
            ng += 1


n = nR * nG * nB - ng
print(str(n))


### FIXED CODE ###

#!/usr/bin/env python3

N = int(input())
S = input()

ans = S.count('R') * S.count('G') * S.count('B')

for i in range(len(S)):
    for d in range(len(S)):
        j = i + d
        k = j + d
        if k >= N:
            break

        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            ans -= 1

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

#import sys
#input = sys.stdin.readline
from math import gcd
def eratosthenes(N):
    from collections import deque
    work = [True] * (N+1)
    work[0] = False
    work[1] = False
    ret = []
    for i in range(N+1):
        if work[i]:
            ret.append(i)
            for j in range(2* i, N+1, i):
                work[j] = False
    return ret

# def gcd(a, b):
#     while b != 0:
#         a, b = b, a % b
#     return a

def main():
    N = int( input())
    A = list( map( int, input().split()))
    # A.sort()
    g = A[0]
    for a in A:
        g = gcd(a, g)
    if g > 1:
        print("not coprime")
        return
    # for i in range(N-1):
    #     if A[i] == A[i+1]:
    #         print("setwise coprime")
    #         return
    E = eratosthenes(10**3)
    for e in E:
        cnt = 0
        for i in range(N):
            if A[i]%e == 0:
                cnt += 1
            while A[i]%e == 0:
                A[i] //= e
        if cnt > 1:
            print("setwise coprime")
            return
    A.sort()
    for i in range(N-1):
        if A[i] == A[i+1] and A[i] > 1:
            print("setwise coprime")
            return
    print("pairwise coprime")
    
    
if __name__ == '__main__':
    main()


### FIXED CODE ###

from math import gcd
def eratosthenes(N):
    from collections import deque
    work = [True] * (N+1)
    work[0] = False
    work[1] = False
    ret = []
    for i in range(N+1):
        if work[i]:
            ret.append(i)
            for j in range(2* i, N+1, i):
                work[j] = False
    return ret

# def gcd(a, b):
#     while b != 0:
#         a, b = b, a % b
#     return a

def main():
    N = int( input())
    A = list( map( int, input().split()))
    g = A[0]
    for a in A:
        g = gcd(a, g)
    if g > 1:
        print("not coprime")
        return
    E = eratosthenes(10**3)
    EE = [0]*len(E)
    R = []
    for a in A:
        for i, e in enumerate(E):
            if a%e == 0:
                if EE[i] > 0:
                    print("setwise coprime")
                    return
                EE[i] = 1
            while a%e == 0:
                a //= e
        if a > 1:
            R.append(a)
    R.sort()
    for i in range(len(R)-1):
        if R[i] == R[i+1]:
            print("setwise coprime")
            return
    print("pairwise coprime")
    
    
if __name__ == '__main__':
    main()
### BUGGY CODE ###

n=int(input())
dp=[2]*(n+1)
dp[0]=0
dp[1]=1
c=1
for i in range(2,n+1):
    for j in range(2,int(i**0.5)+1):
        if i%j==0:
            dp[i]+=2
    if int(i**0.5)*int(i**0.5)==i:
        dp[i]-=1
    c+=dp[i]*i
print(c)


### FIXED CODE ###

n=int(input())
c=0
ans=0
for i in range(1,n+1):
    c=n//i
    ans+=(c)*(c+1)*(i)//2
print(ans)
### BUGGY CODE ###

N, M = map(int, input().split())
A, B = [], []
dic = {i:[] for i in range(1, N+1)}
for _ in range(M):
    a, b = map(int, input().split())
    dic[a].append(b)
    dic[b].append(a)

node = [float('inf')] * N
node[0] = 0 #1までの距離
route = [0]*N #ランプ置く部屋
rooms = [1] #次調べる部屋

for r1 in rooms:
    for r2 in dic[r1]:
        if node[r1-1] + 1 <= node[r2-1]:
            node[r2-1] = node[r1-1] + 1
            route[r2-1] = r1
            rooms.append(r2)
            try:
                dic[r2].remove(r1)
            except:
                continue

if float('inf') in node:
    print('No')
else:
    print('Yes')
    for i in route[1:]:
        print(i)


### FIXED CODE ###

N, M = map(int, input().split())
A, B = [], []
dic = {i:[] for i in range(1, N+1)}
for _ in range(M):
    a, b = map(int, input().split())
    dic[a].append(b)
    dic[b].append(a)

node = [float('inf')] * N
node[0] = 0 #1までの距離
route = [0]*N #ランプ置く部屋
rooms = [1] #次調べる部屋
st = {1}

for r1 in rooms:
    for r2 in dic[r1]:
        if node[r1-1] + 1 <= node[r2-1]:
            node[r2-1] = node[r1-1] + 1
            route[r2-1] = r1
            if not r2 in st:
                rooms.append(r2)
                st.add(r2)
            try:
                dic[r2].remove(r1)
            except:
                continue

if float('inf') in node:
    print('No')
else:
    print('Yes')
    for i in route[1:]:
        print(i)
### BUGGY CODE ###

N = int(input())
S = input()

list = []

for i in range(0, N-2):
  for j in range(i+1, N-1):
    for k in range(j+1, N):
      list.append(S[i] + S[j] + S[k])

list = set(list)

print(len(list))


### FIXED CODE ###

N = int(input())
S = list(input())
S = list(map(lambda x: int(x), S))

ans = 0

for i in range(10):
  for j in range(10):
    for k in range(10):
      if i in S:
        a = S.index(i)
        if j in S[a+1:]:
          b = S[a+1:].index(j) + a + 1
          if k in S[b+1:]:
            ans += 1
          else:
            continue
        else:
          continue
      else:
        continue

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

N = int(input())

S = ["0"]*N

for i in range(N):
  S[i] = str(input())

cnt_ar = sorted(list(set(S)))

length = len(cnt_ar)

ar = [0]*length

for i in range(length):
  ar[i] = S.count(cnt_ar[i])

max_num = max(ar)

for i in range(length):
  if ar[i] == max_num:
    print(cnt_ar[i])


### FIXED CODE ###

N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)
### BUGGY CODE ###

# i, j, k

# N * (N - 1) * (N - 2)
# 4000^3

# 4
# RRGB

# B (k=4)
# G (j=3)
# R (i=1)

N = int(input())
S = input()

count = 0

for k in range(N): # (3, )
    for j in range(k): # (2, 1)
        for i in range(j):
            if S[k] != S[j] and S[j] != S[i] and S[i] != S[k] and not k-j == j-i:
                count += 1


print(count)


### FIXED CODE ###

# i, j, k

# N * (N - 1) * (N - 2)
# 4000^3

# 4
# RRGB

# B (k=4)
# G (j=3)
# R (i=1)

N = int(input())
S = input()

def resolve_v1(N, S):
    count = 0
    
    for k in range(N): # O(N)
        for j in range(k):# O(k)
            for i in range(1, j): # O(j)
                if S[k] != S[j] and S[j] != S[i] and S[i] != S[k] and not k-j == j-i:
                    count += 1

    return count

def resolve_v2(N, S):
    count = 0

    for i in range(N):
        for j in range(i+1, N):
            if S[i] == S[j]:
                continue

            for k in range(j+1, N):
                if S[i] == S[k] or S[j] == S[k] or k-j == j-i:
                    continue

                count += 1

    return count

# R GBR G BGRGRGRGR

# k - j = j - i
# k = 2 * j - i

def resolve_v3(N, S):
    r, g, b = 0, 0, 0
    for i in range(N):
        if S[i] == 'R':
            r += 1
        elif S[i] == 'G':
            g += 1
        elif S[i] == 'B':
            b += 1

    count = r * g * b

    for i in range(N-2):
        for j in range(i+1, N-1):
            k = 2 * j - i

            if k >= N:
                break

            if S[i] != S[j] and S[j] != S[k] and S[i] != S[k]:
                count -= 1

    return count


if __name__ == '__main__':
    
    count = resolve_v3(N, S)
    print(count)
### BUGGY CODE ###

n, k = map(int, input().split())
p = [int(i) for i in input().split()]
maxp = 0
for i in range(n - k + 1):
    sump = sum(p[i: i + k])
    if maxp < sump:
        maxp = sump
        j = i
print((maxp + k) / 2)

### FIXED CODE ###

n, k = map(int, input().split())
p = [int(i) for i in input().split()]
expp = [(i + 1) / 2 for i in p]
cumu, cumu_expp = 0, []
for i in expp:
    cumu += i
    cumu_expp.append(cumu)

max_expp = cumu_expp[k - 1]
for i in range(n - k):
    sumpk = cumu_expp[i + k] - cumu_expp[i]
    if max_expp < sumpk:
        max_expp = sumpk
print(max_expp)