Harryxun/stf_run huggingface dataset:
many, A, B, C = map(int, input().split())
bamboos = [int(input()) for i in range(many)]

# point: 訳が分からなくなるものは自分でルールづけをする
# 合成魔法を全て最初に行う、というルールづけ

# 解法: DFS or 4進数(4patternsで2の累乗だからできる)
# PS: DFS(深さ優先探索), BFS(幅優先探索)

infinity = 1e10

def dfs(depth, a, b, c):
    if depth == many:
        # 謎の場合分け
        if min(a, b, c) > 0:
            # 竹が何もない状態でも各竹に+10がかかっていることから-30する必要がある。
            # また、+10が一個はないとベースとなる竹がないことになるので
            # a,b,c = 0はコストを無限にすることで避ける。
            return abs(a-A) + abs(b-B) + abs(c-C) - 30
    else:
        ret0 = dfs(depth+1, a, b, c)
        ret1 = dfs(depth+1, a+bamboos[depth], b, c) + 10
        ret2 = dfs(depth+1, a, b+bamboos[depth], c) + 10
        ret3 = dfs(depth+1, a, b, c+bamboos[depth]) + 10
        return min(ret0, ret1, ret2, ret3)

print(dfs(0, 0, 0, 0))


### FIXED CODE ###

N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]
INF = 10 ** 9

def dfs(cur, a, b, c):
    if cur == N:
        return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
    ret0 = dfs(cur + 1, a, b, c)
    ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
    ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
    ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
    return min(ret0, ret1, ret2, ret3)

print(dfs(0, 0, 0, 0))
ans = 0
for i in ai:
    ans=ans+1/i

print(1/ans)


### FIXED CODE ###

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

#print(ai)

ans = 0
for i in ai:
    ans=ans+1/i

print(1/ans)
a, b, c, d = map(int, input().split())
N = list(range(a, b+1, 1))
t = 0
for n in N:
  if n % c != 0 and n % d != 0:
    t += 1
print(t)

### FIXED CODE ###

import math
a, b, c, d = map(int, input().split())

s1 = (a-1) // c
s2 = (a-1) // d
s3 = (a-1) // (c*d//math.gcd(c,d))
S = (a-1) - (s1 + s2 -s3)

l1 = b // c
l2 = b // d
l3 = b // (c*d//math.gcd(c,d))
L = b - (l1 + l2 - l3)

print(L-S)
r, d, x = map(int, input().split())

for i in range(10):
    x = r*x-d
    print(xi)


### FIXED CODE ###

r, d, x = map(int, input().split())

for i in range(10):
    x = r*x-d
    print(x)
n = input().split()
n = [int(i) for i in n]
m = input().split()
m = [int(i) for i in m]


ans_1 = n[0]
ans_2 = n[0]

ans = []
while True:
  	if n[1] == 0:
      ans.append(0)
      
    ans_1 += 1
    ans_2 -= 1
    if not ans_1 in m:
        ans.append(ans_1)
        
    elif not ans_2 in m:
        ans.append(ans_2)
    
    if len(ans) > 0:
        break
        
print(min(ans))

### FIXED CODE ###

n = input().split()
n = [int(i) for i in n]
if not n[1] == 0:
	m = input().split()
	m = [int(i) for i in m]
else:
  	m =[0]

ans_1 = n[0]
ans_2 = n[0]
ans = []
while True:
    if n[1] == 0:
        ans.append(n[0])
    if not n[0] in m:
      ans.append(n[0])
    if len(ans) > 0:
        break    
        
    ans_1 += 1
    ans_2 -= 1
    if not ans_1 in m:
        ans.append(ans_1)
    if not ans_2 in m:
        ans.append(ans_2)
    
    
        
print(min(ans))
# -*- coding:utf-8 -*-
import bisect

def solve():
    N = int(input())
    Ls = list(map(int, input().split()))
    Ls.sort()

    # O(N^2 * logN)の全探索で解く
    ans = 0
    for a_i in range(N):
        for b_i in range(a+1, N):
            c_i = bisect.bisect_left(Ls, Ls[a_i]+Ls[b_i])
            if c_i > b_i:
                ans += c_i - b_i - 1
            else:
                pass

    print(ans)

if __name__ == "__main__":
    solve()


### FIXED CODE ###

# -*- coding:utf-8 -*-
import bisect

def solve():
    N = int(input())
    Ls = list(map(int, input().split()))
    Ls.sort()

    # O(N^2 * logN)の全探索で解く
    ans = 0
    for a_i in range(N):
        for b_i in range(a_i+1, N):
            c_i = bisect.bisect_left(Ls, Ls[a_i]+Ls[b_i])
            if c_i > b_i:
                ans += c_i - b_i - 1
            else:
                pass

    print(ans)

if __name__ == "__main__":
    solve()
j = int(input())
i = list(map(int, input().split()))
l=0
for k in range(j):
    if i[k]%2==0:
        if i[k]%3!=0 and i[k]%5!=0:
            print('DENIED')
            l=1
            break
if l == 0:
    print('APPROVED')

### FIXED CODE ###

i = list(map(int, input().split()))
if i[0]==i[1] and i[0]!=i[2]:
    print('Yes')
elif i[0]==i[2] and i[0]!=i[1]:
    print('Yes')
elif i[1]==i[2] and i[0]!=i[1]:
    print('Yes')
else:
    print('No')
s=input()
ans="Yes"
for a in range((len(s)//2)*2,2):
  if not s[a:a++2]=="hi"
  ans="No"
print(ans)

### FIXED CODE ###

# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from heapq import heappop,heappush
import time
import os
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
#############################################
s=input()
ans="Yes"
for a in range(0,len(s),2):
  if len(s)-1==a or (not s[a:a+2]=="hi"):
  	ans="No"
print(ans)
import itertools
N = int(input())

ans = [0]*(10**5)
for i1 in range(1, 10000):
    i2 = i1+1
    i3 = i1+2
    if i3 > N:
        break
    L = list(itertools.combinations_with_replacement((i1, i2, i3), 3))
    for i in L:
        i = list(i)
        x = i[0]
        y = i[1]
        z = i[2]
        n = (x**2)+(y**2)+(z**2)+(x*y)+(y*z)+(z*x)
        if len(list(set(i))) == 1:
            ans[n] += 1
        if len(list(set(i))) == 2:
            ans[n] += 3
        if len(list(set(i))) == 3:
            ans[n] += 6
        
for k in range(1, N+1):
    print(ans[k])

### FIXED CODE ###

n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v = i*i+j*j+k*k+i*j+j*k+k*i
            if v<10050:
                ans[v]+=1
for i in range(n):
    print(ans[i+1])
n = int(input())
for i in range(1, n+1):
 if i%3 == 0:
  print(" " + i)
 elif i%10 == 3:
  print(" " + i)
 div = i
 while div//10:
  div = div//10
  if div%10 == 3:
   print(" " + div)
   div = 0

### FIXED CODE ###

n = int(input())
ans = ''
for i in range(1, n+1):
 if i%3 == 0:
  ans += " " + str(i)
 elif i%10 == 3:
  ans += " " + str(i)
 else:
  div = i
  while div//10:
   div = div//10
   if div%10 == 3:
    ans += " " + str(i)
    div = 0
print(ans)
n=int(input())
h=list(map(int,input().split()))
for i in range(n-1):
  if h[n-2-i]-1>h[n-1-i]:
      print('No')
      exit()
  elif h[n-2-i]-1=h[n-1-i]:
      h[n-2-i]=h[n-2-i]-1
print('Yes')

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
for i in range(n-1):
  if h[n-2-i]-1>h[n-1-i]:
      print('No')
      exit()
  elif h[n-2-i]-1==h[n-1-i]:
      h[n-2-i]=h[n-2-i]-1
print('Yes')
n = int(input())
s = input()

r = s.count('R')

if (r > s // 2):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = int(input())
s = input()

r = s.count('R')
b = len(s) - r

if (r > b):
  print('Yes')
else:
  print('No')
a=[]
b=[i+1 for i in range(n)]
for i in range(n):
  m,l=(j for j in input().split())
  a.append([m,l])
for i in range(n):
  for j in range(n-1):
    if a[j+1][0]<a[j][0] or (a[j+1][0]==a[j][0] and a[j][1]<a[j+1][1]):
                 c=a[j]
                 a[j]=a[j+1]
                 a[j+1]=c
                 d=b[j]
                 b[j]=b[j+1]
                 b[j+1]=d
for i in range(n):
  for j in range(n):
    if b[j]==i+1:
      print(j+1)

### FIXED CODE ###

n=int(input())
a=[]
b=[i+1 for i in range(n)]
for i in range(n):
  m,l=(j for j in input().split())
  a.append([m,int(l)])
for i in range(n):
  for j in range(n-1):
    if a[j+1][0]<a[j][0] or (a[j+1][0]==a[j][0] and a[j][1]<a[j+1][1]):
                 c=a[j]
                 a[j]=a[j+1]
                 a[j+1]=c
                 d=b[j]
                 b[j]=b[j+1]
                 b[j+1]=d
for i in range(n):
  print(b[i])
n = int(input())
s = input()

if s.endswith(s[:n/2]):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())

fin = n//2
s = input()

debut = s[0:fin]

if s == debut + debut:
    print("Yes")
else:
    print("No")
ref={"A":"BD","B":"ACE","C":"BF","D":"AEG","E":"BDFH","F":"CEI","G":"DH","H":"EGI","J":"HF"}
for i in range(1000):
	p=raw_input()
	for i in range(len(p)-1):
		if p[i+1] not in ref[p[i]]:
			break
	else:
		print p
	

### FIXED CODE ###

ref={"A":"BD","B":"ACE","C":"BF","D":"AEG","E":"BDFH","F":"CEI","G":"DH","H":"EGI","I":"HF"}
for i in range(1000):
	p=raw_input()
	for i in range(len(p)-1):
		if p[i+1] not in ref[p[i]]:
			break
	else:
		print p
n,k=map(input().split())
l=list(map(int,input().split()))
l.sort()
print(sum(l[:n-k-1]))

### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
print(sum(h[:max(0,n-k)]))
N, K = map(int, input().split())
# print('N:{}, K:{}'.format(N, K))

if K % 2 == 0:
    print(((N-K//2)//K+1)**3+(N//K)**3)
else:
    print((N//K)**3)


### FIXED CODE ###

import collections

n=int(input())
v=list(map(int,input().split()))
v1=collections.Counter(v[0::2]).most_common()
v2=collections.Counter(v[1::2]).most_common()
v1.append((0,0))
v2.append((0,0))

if v1[0][0]!=v2[0][0]:
    ans=len(v) - v1[0][1] - v2[0][1]
else:
    ans=min(len(v) - v1[0][1] - v2[1][1],len(v) - v1[1][1] - v2[0][1])

print(ans)
import sys
sys.setrecursionlimit(10000)
input = sys.stdin.readline

N, M = map(int, input().split())
L = [[int(v) - 1 for v in input().split()] for _ in range(M)]

class UnionFind:
    def __init__(self, n):
        self.data = [0] * N
        for i in range(N):
            self.data[i] = i
            
    def get_root(self, x):
        r = self.data[x]
        if r == x:
            return r
        p = self.get_root(r)
        self.data[x] = p
        return p
    
    def unite(self, x, y):
        rx = self.get_root(x)
        ry = self.get_root(y)
        
        if rx != ry:
            self.data[rx] = ry
            
    def same(self, x, y):
        return self.get_root(x) == self.get_root(y)
    
u = UnionFind(N)
for a, b, _ in L:
    u.unite(a, b)
    
s = set()
for i in range(N):
    s.add(u.get_root(i))

print(len(s))

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline

N, M = map(int, input().split())
L = [[int(v) - 1 for v in input().split()] for _ in range(M)]

class UnionFind:
    def __init__(self, n):
        self.data = [0] * N
        for i in range(N):
            self.data[i] = i
            
    def get_root(self, x):
        r = self.data[x]
        if r == x:
            return r
        p = self.get_root(r)
        self.data[x] = p
        return p
    
    def unite(self, x, y):
        rx = self.get_root(x)
        ry = self.get_root(y)
        
        if rx != ry:
            self.data[rx] = ry
            
    def same(self, x, y):
        return self.get_root(x) == self.get_root(y)
    
u = UnionFind(N)
for a, b, _ in L:
    u.unite(a, b)
    
s = set()
for i in range(N):
    s.add(u.get_root(i))

print(len(s))
import math
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=q
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
def binary_search(li,item):#二分探索
	left,right = 0, len(li)
	while left<=right:
		mid = (left+right)//2
		if li[mid]==item:
			return mid
		elif li[mid]<item:
			left = mid+1
		else:
			right = mid-1
	return -1

N = readInt()
S = readChar()
rgb = {"R":[],"G":[],"B":[]}
for i in range(N):
	rgb[S[i]].append(i)

c=s=0
c=len(rgb["R"])*len(rgb["G"])*len(rgb["B"])
for i in range(1,N):
	for j in range(i+1,N):
		k = 2*j-i
		if S[i]==s[j] and s[i]==s[k]:
			s+=1

ans=c-s
print(ans)


### FIXED CODE ###

import math
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=q
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
def binary_search(li,item):#二分探索
	left,right = 0, len(li)
	while left<=right:
		mid = (left+right)//2
		if li[mid]==item:
			return mid
		elif li[mid]<item:
			left = mid+1
		else:
			right = mid-1
	return -1

N = readInt()
S = readChar()
rgb = {"R":[],"G":[],"B":[]}
for i in range(N):
	rgb[S[i]].append(i)

c=s=0
c=len(rgb["R"])*len(rgb["G"])*len(rgb["B"])
for i in range(N):
	for j in range(i+1,N):
		k = 2*j-i
		if k>=N:
			continue
		if S[i]!=S[j] and S[i]!=S[k] and S[k]!=S[j]:
			s+=1

ans=c-s
print(ans)
list = input().split
l = list(map(int,list))
a =l[0]
b =l[1]

if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b'


### FIXED CODE ###

l = map(int,input().split())
l = list(l)
a =l[0]
b =l[1]

if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
cnt = 0
current_sum = a[0]#現在の操作後の値
# 正負どちらを起点にするかで2通り考える必要がある。
# a[0]に従うパターン
for i in range(n-1):
    if current_sum * (current_sum + a[i+1]) < 0:#符号が違う
        current_sum += a[i+1]
        cnt += 0#そのまま
    elif current_sum < 0:
        cnt += 1 - (current_sum + a[i+1])
        current_sum = 1 
    else:
        cnt += (current_sum + a[i+1]) +1 
        current_sum = -1
case1 = cnt

cnt = abs(a[0])+1
current_sum = -1 * a[0] // abs(a[0])#現在の操作後の値
for i in range(n-1):
    if current_sum * (current_sum + a[i+1]) < 0:#符号が違う
        current_sum += a[i+1]
        cnt += 0#そのまま
    elif current_sum < 0:
        cnt += 1 - (current_sum + a[i+1])
        current_sum = 1 
    else:
        cnt += (current_sum + a[i+1]) +1 
        current_sum = -1
#print(cnt,case1)
print(min(cnt,case1))

### FIXED CODE ###

#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
def solve(cnt,current_sum):
    for i in range(n-1):
        if current_sum * (current_sum + a[i+1]) < 0:#符号が違う
            current_sum += a[i+1]
            cnt += 0#そのまま
        elif current_sum < 0:
            cnt += 1 - (current_sum + a[i+1])
            current_sum = 1 
        else:
            cnt += (current_sum + a[i+1]) +1 
            current_sum = -1
    return cnt
if a[0] > 0:
    print(min(solve(0,a[0]),solve(1+abs(a[0]),-1)))
elif a[0] < 0:
    print(min(solve(0,a[0]),solve(1+abs(a[0]),1)))
else:
    print(min(solve(1,1),solve(1,-1)))
a,b,c=map(int,input().split())
if (a,b)==(0,0):
  print(0,0)
  exit(0)
if(a-k<0):
  print (0,max(0,k-(b-a))
else:
        print(a-k,b)


### FIXED CODE ###

a, b, k = map(int, input().split())
if (a, b) == (0, 0):
    print(0, 0)
    exit(0)
if a - k < 0:
    print(0, max(0, b - (k-a)))
else:
    print(a-k, b)
n = int(input())
string = input()

lst_w = []
lst_e = []

count = 0
for i in string:
    if i == 'W':
        lst_w.append(count)
        count += 1
    else:
        lst_w.append(count)
        
count = 0
for i in string[::-1]:
    if i == 'E':
        lst_e.append(count)
        count += 1
    else:
        lst_e.append(count)
lst_e = lst_e[::-1]

print(min(np.array(lst_w) + np.array(lst_e)))

### FIXED CODE ###

import numpy as np

n = int(input())
string = input()

lst_w = []
lst_e = []

count = 0
for i in string:
    if i == 'W':
        lst_w.append(count)
        count += 1
    else:
        lst_w.append(count)
        
count = 0
for i in string[::-1]:
    if i == 'E':
        lst_e.append(count)
        count += 1
    else:
        lst_e.append(count)
lst_e = lst_e[::-1]

print(min(np.array(lst_w) + np.array(lst_e)))
#coding: utf-8

import sys
import math

l = []
for line in sys.stdin:
    l.append(int(line))

check = 0
point_list = []
for i in range(len(l)):
    if check == 0:
        last_row = i + l[i]
        check = 1
    else:
        point_list.append(i)
        if i == last_row:
            point_list.sort()
            point_list = point_list[1:-1]
            ave = sum(point_list)*1.0 / len(point_list)
            print int(math.floor(ave))
            check = 0

### FIXED CODE ###

while True:
    n = int(raw_input())
    if n == 0:
        break
    else:
        l = []
        for i in range(n):
            num = int(raw_input())
            l.append(num)
            l.sort()
        l = l[1:-1]
        ave = float(sum(l))/len(l)
        print int(ave)
from collections import deque

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

a = deque()
for _ in range(M):
    a.append(int(input()))

before1 = 1
before2 = 0
ai = a.popleft()
for i in range(N):
    if i == (ai-1):
        before2 = before1
        before1 = 0
        if len(a)>0:
            ai = a.popleft()
    else:
        current = divmod(before1 + before2, 10**9+7)[1]
        before2 = before1
        before1 = current
    
print(before1)


### FIXED CODE ###

from collections import deque
 
N, M = map(int, input().split())
 
a = []
aindex = 0
for _ in range(M):
    a.append(int(input()))
 
before1 = 1
before2 = 0
ai=0
if len(a)>0:
    ai = a[aindex]
 
for i in range(1, N+1):
    if i == ai:
        before2 = before1
        before1 = 0
        if aindex < len(a)-1:
            aindex += 1
            ai = a[aindex]
    else:
        current = divmod(before1 + before2, 10**9+7)[1]
        before2 = before1
        before1 = current
 
 
print(before1)
x=input()
x=x**3
print(x)


### FIXED CODE ###

x=input()
print(int(x)**3)
S=input()
i=0
s=S
count=0
while True:
    if (i==(len(s)-1))or(len(s)==0):
        break
    if not(s[i]==s[i+1]):
        #print(s[:i],s[i+2:])
        s="".join((s[:i],s[i+2:]))
        #print(s)
        input()
        i=0
        count=count+1
    else:
        i=i+1
print(count*2)

### FIXED CODE ###

S=input()
i=0
s=S
count0=0
count1=0
for i in range(len(S)):
    if S[i]=="0":
        count0=count0+1
    else:
        count1 = count1 + 1
print(min(count0,count1)*2)
n = int(input())
a = list(map(int, input().split()))
l = [0] * 30
b = []
for i in range(n):
  x = a[i]
  t = ''
  j = 29
  while j >= 0:
    if x < 2**j:
      t += '0'
    else:
      x -= 2**j
      t += '1'
      l[j] += 1
    j -= 1
  b.append(t)
ans = []
for i in range(n):
  t = b[i]
  for j in range(30):
    k = l[j]
    if t[j] == '1':
      k += 1
    k %= 2
    d += k * 2**j
  ans.append(d)
print(*ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
l = [0] * 30
b = []
for i in range(n):
  x = a[i]
  t = ''
  j = 29
  while j >= 0:
    if x < 2**j:
      t += '0'
    else:
      x -= 2**j
      t += '1'
      l[j] += 1
    j -= 1
  b.append(t)
ans = []
for i in range(n):
  t = b[i]
  d = 0
  for j in range(30):
    k = l[j]
    if t[-(j+1)] == '1':
      k += 1
    k %= 2
    d += k * 2**j
  ans.append(d)
print(*ans)
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M, X = il()
    CA = [il() for _ in range(N)]

    ret = MAX
    for n in range(1 << N):
        k = 0
        A = [0] * M
        for m in range(M):
            c, *a = CA[m]

            if n >> m & 1:
                k += c
                for i in range(len(a)):
                    A[i] += a[i]

                if all([aa >= X for aa in A]):
                    break
        else:
            continue

        ret = min(ret, k)

    print(-1 if ret == MAX else ret)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M, X = il()
    CA = [il() for _ in range(N)]

    ret = MAX
    for n in range(1 << N):
        k = 0
        A = [0] * M
        for j in range(N):
            c, *alist = CA[j]
            if n >> j & 1:
                k += c
                for i in range(len(alist)):
                    A[i] += alist[i]
            if all([a >= X for a in A]):
                ret = min(ret, k)
                break
        else:
            continue

    print(-1 if ret == MAX else ret)


if __name__ == '__main__':
    main()