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

s = input()
cnt=0
 
for i in range(len(s)//2):
    if '10' in s:
        cnt+=2 * s.count('10')
        s=s.replace('10', '') 
    elif '01' in s:
        cnt+=2 * s.count('01')
        s=s.replace('01', '') 
print(cnt)

### FIXED CODE ###

#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)
### BUGGY CODE ###

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

max_sum = 0
Kdaice_list = []
for i in range(N - K + 1):
    K_sum = sum(p_list[i:i + K])
    if max_sum < K_sum:
        max_sum = K_sum
        Kdaice_list = []
        for d in p_list[i:i + K]:
            Kdaice_list.append(d)


def ave(num):
    sum_num = 0
    for n1 in range(1, num + 1):
        sum_num += n1
    return sum_num / num


ans = 0
for n in Kdaice_list:
    ans += ave(n)
print(ans)


### FIXED CODE ###

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

c_s_list = [0] #Cumulative sum_list
c_sum = 0 #Cumulative sum
for dice in p_list:
    average = (dice + 1) / 2 #ダイスの期待値
    c_sum += average
    c_s_list.append(c_sum)

ans = 0
for i in range(N-K+1):
    tmp = c_s_list[i+K] - c_s_list[i]
    if tmp >= ans:
        ans = tmp
print(ans)
### BUGGY CODE ###

#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 998244353
mans = inf ;ans = 0 ;count = 0 ;pro = 1
sys.setrecursionlimit(10**6)

n = int(input())
# XD = [tuple(map(int,input().split())) for i in range(n)]
XD = [(-10**10,inf)]
for i in range(n):
  x,d = map(int,input().split())
  XD.append((x,d))
XD.sort()
visited = [0] * (n+1)
def dfs(node):
  visited[node] = 1
  res = 1
  for i in range(node+1,n+1):
    if XD[i][0] < XD[node][0] + XD[node][1]:
      if visited[i]:continue
      res *= dfs(i)
      res %= mod
    else: break
  # print(node,res+1)
  return res + 1
print((dfs(0)-1)%mod)
# print(visited)
# print(XD)
# dfs(1)

### FIXED CODE ###

#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 998244353
mans = inf ;ans = 0 ;count = 0 ;pro = 1
sys.setrecursionlimit(10**6)

n = int(input())
XD = [(-10**10,inf)]
for i in range(n):
  x,d = map(int,input().split())
  XD.append((x,d))
XD.sort()
visited = [0] * (n+1)
def dfs(node):
  visited[node] = 1
  res = 1
  i = node + 1
  while i < n+1:
    if XD[i][0] < XD[node][0] + XD[node][1]:
      if visited[i]:continue
      pro,i = dfs(i)
      res *= pro
      res %= mod
    else: break
  # print(node,res+1)
  return res + 1 , i
print((dfs(0)[0]-1)%mod)
# print(visited)
# print(XD)
# dfs(1)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**8)

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

g = [[] for i in range(n+1)]

for i in range(n-1):
    a,b = map(int,input().split())
    g[a].append(b)
    g[b].append(a)
    
check = [0] * (n+1)
count = [0] * (n+1)

for i in range(q):
    p,x = map(int,input().split())
    count[p] += x
    
def dfs(x):
    check[x] = 1
    for u in g[x]:
        if check[u] == 1:
            continue
        count[u] += count[x]
        dfs(u)


dfs(1)

print(*count[1:])

### FIXED CODE ###

import collections

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

g = [[] for i in range(n+1)]

for i in range(n-1):
    a,b = map(int,input().split())
    g[a].append(b)
    g[b].append(a)

count = [0] * (n+1)
check = [0] * (n+1)

for i in range(q):
    p,x = map(int,input().split())
    count[p] += x

q = collections.deque()  
q.append(1)

while q:
    v = q.pop()
    check[v] = 1
    for u in g[v]:
        if check[u] == 1:
            continue
        count[u] += count[v]
        q.append(u)
        
print(*count[1:])
### BUGGY CODE ###

q = int(input())

def lcs(X, Y):
    x_len = len(X)
    y_len = len(Y)
    dp = [[0 for _ in range(y_len+1)] for _ in range(x_len+1)]
    
    for i in range(1, x_len+1):
        for j in range(1, y_len+1):
            if X[i-1] == Y[j-1]:
                dp[i][j] = dp[i-1][j-1] + 1
            else:
                dp[i][j] = max(dp[i-1][j], dp[i][j-1])
                               
    return max(max(dp))
    
for _ in range(q):
    X = input()
    Y = input()
    print(lcs(X, Y))

### FIXED CODE ###

q = int(input())

def lcs(X, Y):
    dp = [0]*(len(Y)+1)
    
    for x in X:
        tmp = dp[:]
        for j, y in enumerate(Y):
            if x == y:
                dp[j+1] = tmp[j] + 1
            elif dp[j+1] < dp[j]:
                dp[j+1] = dp[j]
                               
    return dp[-1]
    
for _ in range(q):
    X = input()
    Y = input()
    print(lcs(X, Y))
### BUGGY CODE ###

from sys import stdin, maxsize

def main():
    n, m, k = [int(x) for x in stdin.readline().rstrip().split()]
    canread = [maxsize] *(n+m+2)

    pileda = 0
    a = [0]
    for x in stdin.readline().rstrip().split():
        x = int(x)
        pileda += x
        if pileda > k:
            break
        a.append(pileda)
        
    
    piledb = 0
    b = [0]
    for x in stdin.readline().rstrip().split():
        x = int(x)
        piledb += x
        if piledb > k:
            break
        b.append(piledb)

    for ai, at in enumerate(a):
        for bi, bt in enumerate(b):
            if at + bt > k:
                break
            if canread[ai+bi] > at+bt:
                canread[ai+bi] = at+bt
    ans = 0
    for i, time in enumerate(canread):
        if time > k:
            break
        ans = i
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

from sys import stdin

def main():
    n, m, k = [int(x) for x in stdin.readline().rstrip().split()]

    pileda = 0
    a = [0]
    for x in stdin.readline().rstrip().split():
        x = int(x)
        pileda += x
        a.append(pileda)
    
    piledb = 0
    b = [0]
    for x in stdin.readline().rstrip().split():
        x = int(x)
        piledb += x
        b.append(piledb)

    ans = 0
    bi = m
    for ai, at in enumerate(a):
        if at > k:
            break

        while at + b[bi] > k:
            bi -= 1
        
        ans = max(ans, ai+bi)
    
    print(ans)
            

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

N = int(input())
X = [int(i) for i in input().split()]
for i in range(N):
    start = i + 1
    x = sorted(X[:i] + X[start:])
    l = len(x)
    b = (l + 1) // 2
    print(x[b - 1])


### FIXED CODE ###

n = int(input())
x = [int(i) for i in input().split()]
xsort = sorted(x)
l1 = xsort[n // 2 - 1]
l2 = xsort[n // 2]
for i in range(n):
    print(l1 if x[i] >= l2 else l2)
### BUGGY CODE ###

from fractions import gcd
n,m=map(int,input().split())
s=input()
t=input()
l=n*m//gcd(n,m)
for i in range(l):
  if ((i-1)*n)%l==0 and ((i-1)*m)%l==0:
    if not s[((i-1)*n)//l]==t[((i-1)*m)//l]:
      print(-1)
      exit()
print(l)

### FIXED CODE ###

from fractions import gcd
n,m=map(int,input().split())
s=input()
t=input()
g=gcd(n,m)
l=n*m//g
for i in range(n):
  if i%(n//g)==0 and not s[i]==t[i*m//n]:
    print(-1)
    exit()
print(l)
### BUGGY CODE ###

# /usr/bin/python
# -*- coding: utf-8 -*-
#
import math
import sys


# input
X,Y,Z,K = map(int, input().split())
A = list(map(int, sys.stdin.readline().rstrip().split()))
B = list(map(int, sys.stdin.readline().rstrip().split()))
C = list(map(int, sys.stdin.readline().rstrip().split()))

# solve
AB = [0 for i in range(X*Y)]
i = 0
for a in A:
  for b in B:
    AB[i] = a+b
    i += 1
AB = sorted(AB, key=lambda x:-x)[:K]

ABC = [0 for i in range(len(AB)*Z)]
i = 0
for ab in AB:
  for c in C:
    ABC[i] = ab+c
    i += 1
ABC = sorted(ABC, key=lambda x:-x)[:K]

for ans in ABC:
  print(ans)




### FIXED CODE ###

# /usr/bin/python
# -*- coding: utf-8 -*-
#
import math
import sys
import heapq


# input
X,Y,Z,K = map(int, input().split())
A = list(map(int, sys.stdin.readline().rstrip().split()))
B = list(map(int, sys.stdin.readline().rstrip().split()))
C = list(map(int, sys.stdin.readline().rstrip().split()))
A = sorted(A, key=lambda x:-x)
B = sorted(B, key=lambda x:-x)
C = sorted(C, key=lambda x:-x)

# solve
heap_q = []
heapq.heappush(heap_q, [-1*(A[0]+B[0]+C[0]), 0, 0, 0])
smt,at,bt,ct = [0, 0, 0, 0]

for _ in range(K):
  sm,a,b,c = heapq.heappop(heap_q)
  print(-sm)

  if len(heap_q) > 0:
    smt,at,bt,ct = heapq.heappop(heap_q)
  while len(heap_q) > 0 and sm==smt and a==at and b==bt and c==ct:
    smt,at,bt,ct = heapq.heappop(heap_q)
  heapq.heappush(heap_q, [smt,at,bt,ct])

  if a+1 < X:
    heapq.heappush(heap_q, [-A[a+1]-B[b]-C[c], a+1, b, c])
  if b+1 < Y:
    heapq.heappush(heap_q, [-A[a]-B[b+1]-C[c], a, b+1, c])
  if c+1 < Z:
    heapq.heappush(heap_q, [-A[a]-B[b]-C[c+1], a, b, c+1])
### BUGGY CODE ###

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

def fun(list,c=0):
    if len(list) == 1:
        return c+1
    if list[0] == list[1]:
        return fun(list[1:],c)
    else:
        return fun(list[1:],c+1)

print(fun(S))

### FIXED CODE ###

N = int(input());S = list(input());print(len([(x,i) for i,x in enumerate(S) if i != N-1 if x != S[i+1]])+1)
### BUGGY CODE ###

K, S = map(int, input().split())
c = 0
for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i+j+k == S:
                c += 1
print(c)                

### FIXED CODE ###

K, S = map(int, input().split())
c = 0
for i in range(K+1):
    for j in range(K+1):
        b = S - i - j
        if b <= K and b >= 0:
            c += 1
print(c)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
N = map(int, input())
A = list(map(int, input().split()))

while len(A) >= 2:
    x = A.pop(A.index(max(A)))
    y = min(A)
    n = x % y
    if n == 0:
        pass
    else:
        A.append(n)

print(A[0])


### FIXED CODE ###

# -*- coding: utf-8 -*-
N = map(int, input())
A = list(map(int, input().split()))

while len(A) >= 2:
    idx = A.index(min(A))
    x = A.pop(idx)
    B = list()
    for i in range(len(A)):
        if A[i] % x != 0:
            B.append(A[i] % x)
    B.append(x)
    A = B[:]

print(A[0])
### BUGGY CODE ###

n,w=map(int,input().split())
cos=[0]*(w+1)
for i in range(n):
 w1,v1=map(int,input().split())
 for j in range(w,w1-1,-1):
  f=cos[j-w1]+v1
  if(cos[j]<f):
   cos[j]=f
print(cos[-1])

  


### FIXED CODE ###

import sys
input=sys.stdin.readline
def fun(n,w):
 cos=[0]*(w+1)
 for i in range(n):
  w1,v1=map(int,input().split())
  for j in range(w,w1-1,-1):
   f=cos[j-w1]+v1
   if(cos[j]<f):
    cos[j]=f
 print(cos[-1])
n,w=map(int,input().split())
fun(n,w)
### BUGGY CODE ###

from collections import defaultdict

N = int(input())

result = 0
store = []
for _ in range(N):
    d = defaultdict(int)
    s = input()
    for c in set(s):
        d[c] += s.count(c)
    result += store.count(d)
    store.append(d)
print(result)


### FIXED CODE ###

from collections import defaultdict
import sys
readline = sys.stdin.readline

N = int(input())

result = 0
d = defaultdict(int)
for _ in range(N):
    s = input()
    s = ''.join(sorted(s))
    if s in d:
        d[s] += 1
    else:
        d[s] = 1
print(sum([int((v)*(v-1) / 2) for k, v in d.items()]))
### BUGGY CODE ###

import itertools as itr

N, M = map(int, input().split())
A = [0] * M
B = [0] * M
C = []
for m in range(M):
    A[m], B[m] = map(int, input().split())
    C.append(set([int(cm) for cm in input().split()]))

INF = 100000000
dp = [[INF] * 2**N for _ in range(M + 1)]
for m in range(M + 1):
    dp[m][0] = 0


def Set2Bit(st):
    bt = ["0"]*N
    for i in st:
        bt[i-1] = "1"
    return bt


for m in range(0, M):
    key = Set2Bit(C[m])
    key_bit = int("".join(key), 2)
    for bit in itr.product("01", repeat=N):
        pre_bit = next_bit = int("".join(bit), 2)
        dp[m+1][next_bit] = dp[m][pre_bit]
    for bit in itr.product("01", repeat=N):
        pre_bit = int("".join(bit), 2)
        next_bit = pre_bit | key_bit
        dp[m+1][next_bit] = min(dp[m+1][next_bit], dp[m][next_bit], dp[m][pre_bit] + A[m])

if dp[-1][-1] == INF:
    print(-1)
else:
    print(dp[-1][-1])

### FIXED CODE ###

N, M = map(int, input().split())
A = [0] * M
B = [0] * M
C = [0]*M
for m in range(M):
    A[m], B[m] = map(int, input().split())
    C[m] = [int(cm) for cm in input().split()]

INF = 100000000
dp = [[INF] * 2**N for _ in range(M + 1)]
dp[0][0] = 0


def Set2Bit(st):
    bt = ["0"]*N
    for i in st:
        bt[i-1] = "1"
    return bt


for m in range(0, M):
    key = Set2Bit(C[m])
    key_bit = int("".join(key), 2)
    for bit in range(2**N):
        pre_bit = next_bit = bit
        dp[m+1][next_bit] = dp[m][pre_bit]
    for bit in range(2**N):
        pre_bit = bit
        next_bit = pre_bit | key_bit
        dp[m+1][next_bit] = min(dp[m+1][next_bit], dp[m][next_bit], dp[m][pre_bit] + A[m])

if dp[-1][-1] == INF:
    print(-1)
else:
    print(dp[-1][-1])
### BUGGY CODE ###

N = int(input())
A = [int(a)-i-1 for i,a in enumerate(input().split(),1)]
a = max(A)
b = min(A)
c = 10**9
for j in range(b,a+1):
    k = sum(map(lambda x:abs(x-j), A))
    c = min(k,c)
print(c)

### FIXED CODE ###

import statistics
N = int(input())
A = [int(a)-i-1 for i,a in enumerate(input().split(),1)]
b = statistics.median_low(A)
c = statistics.median_high(A)
d = sum(map(lambda x:abs(x-b),A))
e = sum(map(lambda x:abs(x-c),A))
print(min(d,e))
### BUGGY CODE ###

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

if M%N == 0:
	print(M//N)
	exit()

A = []
for i in range (1, M//N+1):
	if M%i == 0:
		A.append(i)

print(A[-1])

### FIXED CODE ###

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

if M%N == 0:
	print(M//N)
	exit()

A = []
for i in range (1, M//N+1):
	if M%i == 0:
		A.append(i)

print(A[-1])
### BUGGY CODE ###

(N,D,A) = map(int,input().split())
l = []
for i in range(N):
    l.append([int(x) for x in input().split()])
    l.sort()
for i in range(N):
    l[i][1] = -((-l[i][1])//A)

m = []
for i in range(N):
    cnt = 0
    j = i
    while l[j][0]-l[i][0] <= 2*D:
        cnt += 1
        j += 1
        if j >= N:
            break
    m.append(cnt)

ans = 0
for i in range(N):
    if  l[i][1] != 0:
        for p in range(1,m[i]):
            if l[i+p][1] >= l[i][1]:
                l[i+p][1] -= l[i][1]
            else:
                l[i+p][1] = 0
    ans += l[i][1]

print(ans)

### FIXED CODE ###

(N,D,A) = map(int,input().split())
l = []
for i in range(N):
    l.append([int(x) for x in input().split()])
l.sort()
k = [0 for i in range(N)]
for i in range(N):
    k[i] = -((-l[i][1])//A)

m = [0] * N
ub = 0
cnt = 1
for i in range(N):
    if ub < N-1:
        while l[ub + 1][0]-l[i][0] <= 2*D:
            cnt += 1
            ub += 1
            if ub == N - 1:
                break
        m[i] = cnt
    else:
        m[i] = cnt
    cnt -= 1

ans = 0
al = 0
s = [0 for i in range(N)]
j = 0
for i in range(N):
    s[i] = max(k[i]-al,0)
    ans += s[i]
    al += s[i]
    if i < N-1:
        while j+m[j]-1 < i+1:
            al -= s[j]
            if j < N-1:
                j += 1

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

import sys
read = sys.stdin.readline


def main():
    n = int(read())
    V = 1001000

    g = [[] for _ in range(V)]
    deg = [0] * V
    vlist = set()

    for i in range(1, n + 1):
        a = list(map(int, read().rstrip().split()))
        for j in range(n - 2):
            v1 = min(i, a[j]) * 1001 + max(i, a[j])
            v2 = min(i, a[j + 1]) * 1001 + max(i, a[j + 1])
            vlist.add(v1)
            vlist.add(v2)
            g[v1].append(v2)
            deg[v2] += 1

    d = [0] * V
    check_cnt = 0
    q = []
    for v in vlist:
        if deg[v] == 0:
            q.append(v)

    if len(q) == 0:
        print(-1)
        exit()

    for v in q:
        check_cnt += 1
        for nv in g[v]:
            d[nv] = max(d[nv], d[v] + 1)
            deg[nv] -= 1
            if deg[nv] == 0:
                q.append(nv)
    if check_cnt == n * (n - 1) // 2:
        print(max(d) + 1)
    else:
        print(-1)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
read = sys.stdin.readline

n = int(read())
V = 1001000

g = [[] for _ in range(V)]
deg = [0] * V
vlist = set()

for i in range(1, n + 1):
    a = list(map(int, read().rstrip().split()))
    for j in range(n - 2):
        v1 = min(i, a[j]) * 1001 + max(i, a[j])
        v2 = min(i, a[j + 1]) * 1001 + max(i, a[j + 1])
        vlist.add(v1)
        vlist.add(v2)
        g[v1].append(v2)
        deg[v2] += 1

d = [0] * V
check_cnt = 0
q = []
for v in vlist:
    if deg[v] == 0:
        q.append(v)

if len(q) == 0:
    print(-1)
    exit()

for v in q:
    check_cnt += 1
    for nv in g[v]:
        d[nv] = max(d[nv], d[v] + 1)
        deg[nv] -= 1
        if deg[nv] == 0:
            q.append(nv)
if check_cnt == n * (n - 1) // 2:
    print(max(d) + 1)
else:
    print(-1)
### BUGGY CODE ###

S=str(input())
S.split()
ans=0


for i in range(len(S)):
    for j in range(i+3,len(S)):
        s=''.join(S[i:j+1])
        if int(s)%2019==0:
            ans=ans+1
print(ans)

### FIXED CODE ###

S=str(input())
l=len(S)
ans=0
dig=1
mod=[0]*2019
mod[0]=1
t=0
for i in range(l):
    t=(t+int(S[-i-1])*dig)%2019
    mod[t]+=1
    dig=(dig*10)%2019
    
for j in mod:
    ans=ans+(j*(j-1))//2
print(ans)
### BUGGY CODE ###

N = int(input())
Counted = []
num = [0 for _ in range(N)]

for i in range(N):
  S = input()
  if S in Counted:
    num[Counted.index(S)] += 1
  else:
    Counted.append(S)
    num[Counted.index(S)] += 1

Dict = list(zip(Counted, num))
Dict_sorted = sorted(Dict,key=lambda x: x[1], reverse = True)

VVV = []

for i in range(len(Dict_sorted)):
  if Dict_sorted[i][1] == Dict_sorted[0][1]:
    VVV.append(Dict_sorted[i][0])
  else:
    break

SSS = sorted(VVV)

for _ in range(len(SSS)):
  print(SSS[_])

### FIXED CODE ###

N = int(input())
dic = {}
Max = 1

for _ in range(N):
  S = input()
  if not S in dic:
    dic[S] = 1
  else:
    dic[S] += 1
    Max = max([Max, dic[S]])

ans = []
    
for x in dic:
  if dic[x] == Max:
    ans.append(x)

ans_sorted = sorted(ans)
for y in range(len(ans)):
  print(ans_sorted[y])
### BUGGY CODE ###

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

while True:
  if 2*n<m:
    n += 1
    m -= 2
  else:
    if n*2 == m:
      print(n)
      break
    elif n*2>m:
      print(m//2)
      break


### FIXED CODE ###

n, m = map(int, input().split())
Scc = min(n, m//2)
cccc = (m-Scc*2)//4
print(Scc+cccc)
### BUGGY CODE ###

def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

import itertools
from pprint import pprint

N, K = mapint_inp()
l = list(range(N+1))
ans = 0
while(K < N+2):
    mn = sum(l[:K])
    mx = sum(l[::-1][:K])
    ans += mx-mn+1
    K+=1

print(ans)

### FIXED CODE ###

def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

N, K = mapint_inp()
MOD = 10**9+7

ans = 0
for i in range(K, N+2):
    mn = i*(i-1) // 2
    mx = i*(2*N-i+1) // 2
    ans += mx - mn + 1

print(ans%MOD)
### BUGGY CODE ###

K,S=map(int,input().split())
A=[]

for i in range(K+1) :
    for j in range(K+1) :
        if S-i-j>K or S-i-j<0 :
             continue
        A.append([i,j,S-i-j])

print(len(A))

### FIXED CODE ###

K,S=map(int,input().split())
ans=0

for i in range(K+1) :
    if S-i>2*K :
        continue
    elif S-i<0 :
        break
    elif 0<=S-i<=K :
        ans+=S-i+1
    else :
        ans+=2*K+i-S+1

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

import sys

input = sys.stdin.readline
H, N = map(int, input().split())
magic = [list(map(int, input().split())) for _ in range(N)]

dp = [0] * (H + 1)

for i in range(1, H + 1):
    dp[i] = min(dp[max(i - damage, 0)] + cost for damage, cost in magic)

ans = dp[H]

print(ans)


### FIXED CODE ###

import sys

input = sys.stdin.readline
H, N = map(int, input().split())
magic = [list(map(int, input().split())) for _ in range(N)]

max_damage = max(damage for damage, cost in magic)
dp = [0] * (H + max_damage)

for i in range(1, H + max_damage):
    dp[i] = min(dp[i - damage] + cost for damage, cost in magic)

ans = min(dp[H:])

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

from scipy.misc import*;n,m,k=map(int,input().split());s=lambda x,y:sum(y*y*i*(x-i)for i in range(x));print((s(n,m)+s(m,n))*comb(n*m-2,k-2,1)%(10**9+7))

### FIXED CODE ###

class Factorial:
    def __init__(self,n,mod):
        self.f=[1]
        for i in range(1,n+1):
            self.f.append(self.f[-1]*i%mod)
        self.i=[pow(self.f[-1],mod-2,mod)]
        for i in range(1,n+1)[::-1]:
            self.i.append(self.i[-1]*i%mod)
        self.i.reverse()
    def factorial(self,i):
        return self.f[i]
    def ifactorial(self,i):
        return self.i[i]
    def comb(self,n,k):
        return self.f[n]*self.i[n-k]*self.i[k]
n,m,k=map(int,input().split())
M=10**9+7
print((sum(m*m*i*(n-i)for i in range(n))+sum(n*n*i*(m-i)for i in range(m)))*Factorial(n*m,M).comb(n*m-2,k-2)%M)
### BUGGY CODE ###

from math import  *
import copy

input = int(input())

def getMoney(money):
    prices = [100, 101, 102, 103, 104, 105]
    rem = []
    for element in prices:
        rem.append(money - money * floor(money/element))
    bounds = [floor(money/element) + 1 for element in prices]
    for index1 in range(bounds[0]):
        for index2 in range(bounds[1]):
            for index3 in range(bounds[2]):
                for index4 in range(bounds[3]):
                    for index5 in range(bounds[4]):
                        for index6 in range(bounds[5]):
                            if (index1 * prices[0] + index2 * prices[1] +index3 * prices[2] + index4 * prices[3] + index5 * prices[4] + index6 * prices[5] == money):
                                return 1
    return 0

print(getMoney(input))


### FIXED CODE ###

x = int(input())
 
for i in range(2000):
    if i * 100 <= x <= i * 105:
        print(1)
        exit()
 
print(0)
### BUGGY CODE ###

N = int(input())
S = input()
ans = S.count("R") * S.count("G") * S.count("B")
for i in range(N):
    for j in range(i + 1, N):
        k = j - i + j
        if k < N:
            if {S[i], S[j], S[k]} == {"R", "G", "B"}:
                ans -= 1
print(ans)

### FIXED CODE ###

N = int(input())
S = input()
ans = S.count("R") * S.count("G") * S.count("B")
for i in range(N):
    for j in range(i + 1, N):
        k = j - i + j
        if k < N:
            if {S[i], S[j], S[k]} == {"R", "G", "B"}:
                ans -= 1
print(ans)
### BUGGY CODE ###


X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

E = []
for a in range(len(A)):
    for b in range(len(B)):
        E.append(A[a]+B[b])

E.sort(reverse=True)
E = E[:K]

ans = []
for c in range(len(C)):
    for e in range(len(E)):
        ans.append(C[c]+E[e])
        
ans.sort(reverse=True)

for i in range(K):
    print(ans[i])

### FIXED CODE ###


X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

sum = []
for x in range(X):
    for y in range(Y):
        for z in range(Z):
            if (x+1)*(y+1)*(z+1) <= K:
                sum.append(A[x] + B[y] + C[z])
            else:
                break

sum.sort(reverse=True)
for i in range(K):
    print(sum[i])