Harryxun/stf_run huggingface dataset:
a､b､k=map(int,input().split())
m = a-k
if(m>=0):
  print(m,b)
else:
  l = 0-m
  n = b-l
  if(n>=0):
    print(0,n)
  else:
    print(0,0)

### FIXED CODE ###

a,b,k=map(int,input().split())
m = a-k
if(0<=m):
  print(m,b)
else:
  l = 0-m
  n = b-l
  if(0<=n):
    print(0,n)
  else:
    print(0,0)
a, b, k = map(int, input().split())
m = 0
ans = []

if a < b:
    m = b
    n = a
else:
    m = a
    n = b

for i in range(1, m):
    if n % i == 0 and m % i == 0:
        ans.append(i)

if ans:
    print(ans[-k])
else:
    print("1")


### FIXED CODE ###

a, b, k = map(int, input().split())
m = 0
ans = []

if a < b:
    m = b
    n = a
else:
    m = a
    n = b

for i in range(1, n+1):
    if m % i == 0 and n % i == 0:
        ans.append(i)

if ans:
    print(ans[-k])
else:
    print("1")
import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
permutation = list(itertools.permutations([x for x in range(1, N + 1)]))

a = permutation.index(P) + 1
b = permutation.index(Q) + 1
print(abs(a - b))


### FIXED CODE ###

K, X = map(int, input().split())
print('Yes' if K * 500 >= X else 'No')
a = input()
b = input()
c = a * b
if c % 2 == 0:
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

a,b = map(int,input().split())
c = a * b
if c % 2 == 0:
    print("Even")
else:
    print("Odd")
S = int(input())
h = S / 3600
m = (S - h * 3600) / 60
s = S - h * 3600 - s * 60
print(h, m, s, sep = ':')

### FIXED CODE ###

S = int(input())
h = S // 3600
m = S % 3600 // 60
s = S % 60
print(h, m, s, sep = ':')
s = map( str, input().split(",") )
print( s[0] + " " + s[1] + " " + s[2] )

### FIXED CODE ###

s = list( map( str, input().split(",") ) )
print( s[0] + " " + s[1] + " " + s[2] )
def get_arounds(target):
    return [(target[0] + x, target[1] + y) for x, y in ((1, 0), (0, 1), (-1, 0), (0, -1))]

def search_path(step, start, end, limit):
    if step == limit:
        return start == end

    return any([search_path(step + 1, a, end, limit) for a in get_arounds(start)])


if __name__ == '__main__':
    n = int(input())

    path = [tuple(map(int, input().split())) for _ in range(n)]

    step = 0
    start = (0, 0)
    for p in path:
        goal = (p[1], p[2])
        if not search_path(step, start, goal, p[0]):
            print('No')
            break
        step = p[0]
        start = goal
    else:
        print('Yes')


### FIXED CODE ###

n = int(input())

goals = [tuple(map(int, input().split())) for _ in range(n)]

step = 0
start = (0, 0)
for g in goals:
    s = g[0] - step
    d = abs(g[1] - start[0]) + abs(g[2] - start[1])

    if s < d or s % 2 != d % 2:
        print('No')
        break

    step = g[0]
    start = (g[1], g[2])
else:
    print('Yes')
N = input()
Ti = []

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

def lcm(a,b):
    return (a*b)/gcd(a,b)

for i in range(int(N)):
    tmp = input()
    Ti.append(int(tmp))
Ti.sort()

ans_gcd = gcd(Ti[0],Ti[1])
ans_lcm = lcm(Ti[0],Ti[1])
for i in range(2,len(Ti)):
    ans_gcd = gcd(ans_gcd,Ti[i])
    ans_lcm = lcm(ans_lcm,Ti[i])

print(int(ans_lcm))

### FIXED CODE ###

def gcd(a,b):
    m = max(a,b)
    n = min(a,b)
    if n==0:
        return m
    return gcd(n, m%n)

def lcm(a,b):
    return (a*b)//gcd(a,b)

N = input()
Ti = []

for i in range(int(N)):
    tmp = input()
    Ti.append(int(tmp))

ans_lcm = 1
for i in range(len(Ti)):
    ans_lcm = lcm(ans_lcm,Ti[i])
print(ans_lcm)
MOD = 10 ** 9 + 7

N, M = map(int, input().split())
a = [-1] + [int(input()) for i in range(M)] + [N + 1]

factorial = {0: 1}
f = 1
for i in range(1, N):
    f *= i
    factorial[i] = f

c = {}
def nCr(n, r):
    if (n, r) in c:
        return c[(n, r)]
    a = factorial[n] // (factorial[n - r] * factorial[r])
    c[(n, r)] = a
    return a

d = {}
def step(n):
    if n in d:
        return d[n]
    a = 0
    for k in range(n // 2 + 1):
        a += nCr(n - k, k)
    d[n] = a
    return a

ans = 1
for i in range(M + 1):
    n = a[i + 1] - a[i] - 2
    if n < 0:
        ans = 0
    else:
        ans *= step(n)
print(ans % MOD)


### FIXED CODE ###

from collections import defaultdict

N, M = map(int, input().split())
a = defaultdict(lambda: True)
for i in range(M):
    a[int(input())] = False

dp = defaultdict(int)
dp[0] = 1
for i in range(1, N + 1):
    if a[i]:
        dp[i] = dp[i - 1] + dp[i - 2]
print(dp[N] % (10 ** 9 + 7))
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = S()
    if "7" in s:
        print("Yes")
    else:
        print("No")
    return


#main
if __name__ == '__main__':
    solve()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = S()
    if "7" in n:
        print("Yes")
    else:
        print("No")
    return


#main
if __name__ == '__main__':
    solve()
n=raw_input()
a=[]
for i in range(n):
  a[i]=raw_input()
print '%d %d %d' %(min(a), max(b), sum(a))

### FIXED CODE ###

n=input()
a=map(int,raw_input().split())
print "%d %d %d" % (min(a), max(a), sum(a))
def irohas_obsession(N: int, K: int, D: list) -> int:
    # D に含まれない最小の値
    min_not_d = min(d for d in range(10) if d not in D)

    # 数字を各桁に分解する。
    nums = []
    while N > 0:
        nums = [N % 10] + nums
        N //= 10

    # 上位の桁から見ていって最初に D に含まれる数字を探す。
    # convert_idx = len(nums)
    for i, n in enumerate(nums):
        if n not in D:
            # 変換の必要がない
            continue

        convert_idx = i
        break
    # print(convert_idx)
    for i in range(convert_idx, -1, -1):
        n = nums[i]
        for d in range(n, 10):
            # 変換先が n 以上 9 以下
            if d in D:
                # NG
                continue

            nums[i] = d
            break
        else:
            # 変換先が n 未満
            for d in range(n, 10):
                if d in D:
                    # NG
                    continue

                nums[i] = d

            # 上位の桁に繰り上がりを伝搬
            if i > 0:
                nums[i - 1] += 1
            else:
                nums = [min_not_d] + nums

    # 残りの桁は D に含まれない最小の値に変換する。
    nums = [min_not_d if n in D else n for n in nums]

    ret = 0
    digit = 1
    print(nums)
    for n in reversed(nums):
        ret += n * digit
        digit *= 10

    return ret


if __name__ == "__main__":
    N, K = map(int, input().split())
    D = [int(s) for s in input().split()]
    ans = irohas_obsession(N, K, D)
    print(ans)


### FIXED CODE ###

def irohas_obsession(N: int, K: int, D: list) -> int:
    # D に含まれない最小の値
    min_not_d = min(d for d in range(10) if d not in D)
    min_not_d_and_not_zero = min(d for d in range(10) if d not in D and d != 0)

    # 数字を各桁に分解する。
    nums = []
    while N > 0:
        nums = [N % 10] + nums
        N //= 10

    # 上位の桁から見ていって最初に D に含まれる数字を探す。
    convert_idx = -1
    for i, n in enumerate(nums):
        if n not in D:
            # 変換の必要がない
            continue

        convert_idx = i
        break
    # print(convert_idx)
    for i in range(convert_idx, -1, -1):
        n = nums[i]
        if n > 9:
            n %= 10
            if i > 0:
                nums[i - 1] += 1
            else:
                nums = [min_not_d_and_not_zero] + nums

        for d in range(n, 10):
            # 変換先が n 以上 9 以下
            if d in D:
                # NG
                continue

            nums[i] = d
            break
        else:
            # 変換先が n 未満
            for d in range(n, 10):
                if d in D:
                    # NG
                    continue

                nums[i] = d

            # 上位の桁に繰り上がりを伝搬
            if i > 0:
                nums[i - 1] += 1
            else:
                nums = [min_not_d_and_not_zero] + nums

    # 残りの桁は D に含まれない最小の値に変換する。
    nums = [min_not_d if n in D else n for n in nums]

    ret = 0
    digit = 1
    # print(nums)
    for n in reversed(nums):
        ret += n * digit
        digit *= 10

    return ret


if __name__ == "__main__":
    N, K = map(int, input().split())
    D = [int(s) for s in input().split()]
    ans = irohas_obsession(N, K, D)
    print(ans)
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
T = [0] * N
syuki = 0
for i in range(N):
    T[i] = int(input())
syuki = lcm(*T)
if max(T) > syuki:
    print(max(T) + syuki)
else:
    print(syuki)


### FIXED CODE ###

from functools import reduce

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

def lcm(a, b):
    return a * b // gcd(a, b)

def lcmm(*args):
    return reduce(lcm, args)

N = int(input())
T = [0] * N
syuki = 0
for i in range(N):
    T[i] = int(input())
syuki = lcmm(*T)
print(syuki)
#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b,x,m,n;
	cin>>a>>b>>x;
	m=a/x;
	if(a%x!=0)
		m++;
	n=b/x;
	cout<<n-m+1<<endl;
	return 0;
}

### FIXED CODE ###

s=input().split()
a=int(s[0])
b=int(s[1])
c=int(s[2])
print(b//c-(a-1)//c)
if(A > B):
  print("Alice")
elif(B > A):
  print("Bob")
else:
  print("Draw")


### FIXED CODE ###

A, B = map(int, input().split())
if(A ==1):
  A += 13
if(B ==1):
  B += 13
if(A > B):
  print("Alice")
elif(B > A):
  print("Bob")
else:
  print("Draw")
import math
import sys

UNDEF=-1
sys.setrecursionlimit(1000010)
N = int(input())
# print(N)
V=[[UNDEF,UNDEF,[],[] ] for _ in range(N) ]      # Vertex
E=[[] for _ in range(N-1) ]    # Edge 

for i in range(N-1):
    (xa,xb) = map(int,input().split())
    # print(xa,xb)
    E[i]=[xa,xb]
    V[xb-1][0]=xa
    V[xb-1][1]=i+1
    V[xa-1][2].append(xb)
    V[xa-1][3].append(i+1)


# print("Edge:", E)
# print("Vertex:",V)

def root_v():
    global UNDEF
    global V
    for i in range(len(V)):
        if V[i][0] == UNDEF:
            return i+1
    return UNDEF

# print("Root Node:",root_v())

def max_degree(s):
    if V[s-1][0] != UNDEF: 
        degree=len(V[s-1][2]) + 1 # Node S 's degree for non root
    else:
        degree=len(V[s-1][2])     # Node S 's degree for root 

    for c in V[s-1][2]:
        degree = max ( degree, max_degree(c) ) 
    return degree

# print("Max Degree:", max_degree(root_v()))
print(max_degree(root_v()))

# Initialize 'color list' for edges
color=[UNDEF for _ in range(N-1)]

def put_colors(s):
    # print("put_color",s)
    global color 
    pcolor = color[V[s-1][1]-1]
    ic = 1
    for i in range(len(V[s-1][3])):
        if ic == pcolor:
            ic = ic + 1
        # print("put_color",s,i,V[s-1][3][i], ic )
        color[V[s-1][3][i]-1] = ic 
        put_colors(V[s-1][2][i])
        ic = ic + 1
    
put_colors(root_v())
for i in range(N-1):
    print(color[i])


### FIXED CODE ###

import math
import sys

UNDEF=-1
sys.setrecursionlimit(1000010)
N = int(input())
# print(N)
V=[[UNDEF,UNDEF,[],[] ] for _ in range(N) ]      # Vertex
E=[[] for _ in range(N-1) ]    # Edge 

for i in range(N-1):
    (xa,xb) = map(int,input().split())
    # print(xa,xb)
    E[i]=[xa,xb]
    V[xb-1][0]=xa
    V[xb-1][1]=i+1
    V[xa-1][2].append(xb)
    V[xa-1][3].append(i+1)


# print("Edge:", E)
# print("Vertex:",V)

def root_v():
    global UNDEF
    global V
    for i in range(len(V)):
        if V[i][0] == UNDEF:
            return i+1
    return UNDEF

# print("Root Node:",root_v())

def max_degree(s):
    if V[s-1][0] != UNDEF: 
        degree=len(V[s-1][2]) + 1 # Node S 's degree for non root
    else:
        degree=len(V[s-1][2])     # Node S 's degree for root 

    for c in V[s-1][2]:
        degree = max ( degree, max_degree(c) ) 
    return degree

# print("Max Degree:", max_degree(root_v()))
print(max_degree(root_v()))

# Initialize 'color list' for edges
color=[UNDEF for _ in range(N-1)]

def put_colors(s):
    # print("put_color",s)
    global color 
    pcolor=UNDEF
    if V[s-1][1] != UNDEF:
        pcolor = color[V[s-1][1]-1]
    ic = 1
    for i in range(len(V[s-1][3])):
        if ic == pcolor:
            ic = ic + 1
        # print("put_color",s,i,V[s-1][3][i], ic )
        color[V[s-1][3][i]-1] = ic 
        put_colors(V[s-1][2][i])
        ic = ic + 1
    
put_colors(root_v())
for i in range(N-1):
    print(color[i])
import math

N = int(input())
sum = N - 1
b = int(math.sqrt(N))
for i in range(2, b+1):
    if(N%i==0):
        if((a/i+i-2)<=sum):
            sum = N/i+i-2

print(sum)

### FIXED CODE ###

import math

N = int(input())
sum = N - 1
b = int(math.sqrt(N))
for i in range(2, b+1):
    if(N%i==0):
        if((N//i+i-2)<=sum):
            sum = N//i+i-2

print(sum)
A = int(input())
B = int(input())
print((A - 1) * (B - 1))

### FIXED CODE ###

A, B = map(int, input().split())
print((A - 1) * (B - 1))
def neighbor_sum(N, A):
    A_1 = [] 
    A_2 = []
    i = 0
    j = N-1
    change = True
    while i < j:
        if change == True:
            A_1.append(A[i])
            A_2.append(A[j])
            i += 1
            j -= 1
            change = False
        else:
            A_1.append(A[j])
            A_2.append(A[i])
            i += 1
            j -= 1
            change = True
        return A_1[::-1] + A_2[:]

if __name__ == "__main__":
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A.sort()
    diff = neighbor_sum(N, A)
    diff_sum = [abs(diff[i+1] - diff[i]) for i in range(N-1)]
    print(sum(diff_sum))

### FIXED CODE ###

def create_sum(N):
    list_align = [2 for _ in range(N)]
    for i in range(N):
        if i % 2 == 0:
            list_align[i] *= -1
    list_align[0] //= 2
    list_align[N-1] //= 2
    list_align.sort()
    return list_align

def solve(N, Array):
    sum1 = 0
    sum2 = 0
    arr = create_sum(N)
    for i in range(N):
        sum1 += arr[i] * Array[i]
        sum2 += arr[i] * Array[N-1-i]
    print(max(abs(sum1), abs(sum2)))
    
if __name__ == "__main__":
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A.sort()
    solve(N, A)
n = int(input())

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

d.sort()

m = 0

for a in range(n-2):
	for b in range(a+1,n-1):
		for c in range(b+1,n):
			if d[c]<d[b]+d[a]:
				m += 1
				if d[c]==d[a]:
				m -= 1
			else:
				break

print(m)

### FIXED CODE ###

import bisect

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

m = 0

for a in range(n-2):
	for b in range(a+1,n-1):
		m+=bisect.bisect_left(d,d[a]+d[b])-1-b

print(m)
N,M = map(int,input().split())
o = {}
if N==1 and M==0:
  print(0)
else:
  for i in range(M):
    s,c = map(int,input().split())
    if o.get(s,-1)==-1:
        o[s]=c
    elif o.get(s,-1)!=-1 and o[s]!=c:
        print(-1)
        break
  else:
    m = [1]+[0]*(N-1)
    for k in o.keys():
        m[k-1]=o[k]
    if N!=1 and moji[0]==0:
      print(-1)
    else:
      print(''.join([str(a) for a in m]))


### FIXED CODE ###

N = int(input())
print(-((-N)//2))
from collections import deque
s=deque(list(input().split()))
ans=""
q=int(input())
flag=True
for i in range(q):
  ques=list(input().split())
  if ques[0]=="1":
    flag=not flag
    #print("1",s)
  else:
    if ques[1]=="1":
      if flag:
        s.appendleft(ques[2])
        #print("2",s)
      else:
        s.append(ques[2])
    else:
      if flag:
        s.append(ques[2])
      else:
        s.appendleft(ques[2])
      #print("22",s)
if flag==False:
    s = list(s).reverse()
print("".join(map(str, s)))

### FIXED CODE ###

from collections import deque

S = input()
Q = int(input())
ans = deque(S)
revcnt = 0
for i in range(Q):
    data = list(input().split())
    if data[0] == '1':
        revcnt += 1
        continue

    if data[1] == '1':
        if revcnt % 2 == 0:
            ans.appendleft(data[2])
        else:
            ans.append(data[2])
    else:
        if revcnt % 2 == 0:
            ans.append(data[2])
        else:
            ans.appendleft(data[2])

if revcnt % 2 != 0:
    print(''.join(reversed(list(ans))))
else:
    print(''.join(list(ans)))
N,K,Q = map(int,input().split())
A = [int(input()) for _ in range(Q)]

ans = [0]*N
for a in A:
    ans[a-1] += 1
for i in range(Q):
    if K-Q+ans[i] > 0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

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

ans = [0]*N
for a in A:
    ans[a-1] += 1
for i in range(N):
    if K-Q+ans[i] > 0:
        print("Yes")
    else:
        print("No")
h,w=map(int,input().split())
a=[input() for i in range(h)]

for j in a:
  if '#' not in a:
    a.pop(j)
    h-=1
    
b=[]
c=''

for k in range(w):
  for l in range(h):
    c+=a[l][k]
  b.append(c)

for m in range(w):
  if '#' not in b:
    b.pop(m)
    w-=1
    
d=''

for o in range(h):
  for p in range(w):
    d+=b[p][o]
    print(d)
   

### FIXED CODE ###

H, W = map(int, input().split())
a = []
for _ in range(H):
    i = list(input())
    if '#' in i:
        a.append(i)
ans = zip(*[i for i in zip(*a) if '#' in i])
for s in ans:
    print(*s, sep='')
#copy code
import sys
sys.setrecursionlimit(10000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def solver(T):
    if T == "":
        print("YES")
        quit()
    if len(T) >= 5:
        if T[:5] == "dream" or T[:5] == "erase":
            solver(T[5:])
    if len(T) >= 6:
        if T[:6] == "eraser":
            solver(T[6:])
    if len(T) >= 7:
        if T[:7] == "dreamer":
            solver(T[7:])
    return


def main():
    S = input()
    # 再帰的に解いて解く

    solver(S)
    print("NO")
    return


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    S = input()
    # 後ろから貪欲に評価すればよい
    while True:
        if S[-5:] == "dream" or S[-5:] == "erase":
            S = S[:-5]
            continue
        elif S[-6:] == "eraser":
            S = S[:-6]
            continue
        elif S[-7:] == "dreamer":
            S = S[:-7]
            continue
        else:
            break
    if S == "":
        print("YES")
    else:
        print("NO")
    return


if __name__ == "__main__":
    main()
from collections import defaultdict


def main():
    n = int(input())
    card_list = list(map(int, input().split()))

    ans = len(set(card_list))

    d = defaultdict(int)
    for card in card_list:
        d[card] += 1

    one, two = 0, 0
    for card, num in d.items():
        if num % 2 == 1:
            one += 1
        else:
            two += 1

    print(ans - two % 2)


if __name__ == '__main__':
    main()


### FIXED CODE ###

x = int(input())
if x < 1200:
    print("ABC")
else:
    print("ARC")
n = int(input())
a = list(map(int, input().split()))
l = [0]*(n)
l[1] = 1
for i in range(n):
    l[a[i]-1] = i + 1
print(" ".join(map(str, l)))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
l = [0]*(n)
for i in range(n):
    l[a[i]-1] = i + 1
print(" ".join(map(str, l)))
import numpy as np
from itertools import combinations_with_replacement

N,M,X = map(int,input().split())
CA = []
for i in range(N):
  CA.append(list(map(int,input().split())))

OK = True
CA = np.array(CA)
sums = np.sum(CA,axis=0)
for i in range(1,M+1):
  if sums[i] < X:
    OK = False
    break

if OK == False:
  print(-1)
else:
  As = []
  for A in combinations_with_replacement(range(0, N), r=M):
    As.append(tuple(set(A)))
  As = list(map(list, set(As)))
  last_val = sums[0]
  for ls in As:
    ls = list(set(ls))
    ans = [0] * M
    val = 0
    for a in ls:
      for ix,i in enumerate(CA[a-1][1:]):
        ans[ix] += i
      val += l[a-1][0]
    b = [i for i in ans if i >= X]
    if len(b) == len(ans):
      last_val = min(last_val, val)
  print(last_val)

### FIXED CODE ###

import numpy as np
from itertools import combinations_with_replacement

N,M,X = map(int,input().split())
CA = []
for i in range(N):
  CA.append(list(map(int,input().split())))

OK = True
CA = np.array(CA)
sums = np.sum(CA,axis=0)
for i in range(1,M+1):
  if sums[i] < X:
    OK = False
    break

if OK == False:
  print(-1)
else:
  # As = []
  # for A in combinations_with_replacement(range(0, N), r=M):
  #   As.append(tuple(set(A)))
  # As = list(map(list, set(As)))
  min_ = sums[0]
  hoge = []
  kouho = list(range(1,N+1))
  for i in combinations_with_replacement(kouho, N):
    hoge.append(list(set(i)))
  hoge = list(map(list, set(map(tuple, hoge))))
  for i in hoge:
    mini_CA = []
    for j in i:
      mini_CA.append(CA[j-1])
    mini_CA = np.array(mini_CA)
    OK2 = True
    sums = np.sum(mini_CA,axis=0)
    for k in range(1,M+1):
      if sums[k] < X:
        OK2 = False
        break
    if OK2 == True and sums[0] < min_:
      min_ = sums[0]
  print(min_)
n=int(input())
li = []
for i in range(n):
  li += [int(input())]
x = li[0]
ans = -1
count=0
for i in range(n):
  x = li[x-1]
  count +=1
  if x == 2:
    print(count+1)
    exit()
print(-1)

### FIXED CODE ###

a,b = (int(i) for i in input().split())
if a+b >= 10:
  print('error')
else:
  print(a+b)
import numpy as np
N = int(input())
i = int(np.sqrt(2*N))

if i * (i+1) == 2 * N:
    print('Yes')
    print(i+1)
    S = [[] for k in range(i+1)]
    now = 0
    for k in range(1, N+1):
        l = now % (i+1)
        m = (now + 1) % (i+1)
        S[l].append(k)
        S[m].append(k)
        now = m
    for j in range(i+1):
        print(i, end = ' ')
        for n in range(i):
            if n < i-1:
                print(S[j][n], end = ' ')
            else:
                print(S[j][n])
else:
    print('No')


### FIXED CODE ###

import numpy
N = int(input())
i = int(numpy.sqrt(2*N))

if i * (i+1) == 2 * N:
    print('Yes')
    print(i+1)
    S = [[] for k in range(i+1)]
    k = 1
    for now in range(0, i+1):
        for now2 in range(now+1, i+1):
            S[now].append(k)
            S[now2].append(k)
            k += 1
    for j in range(i+1):
        print(i, end = ' ')
        values = map(str, S[j])
        print(' '.join(values))
else:
    print('No')
h, w = map(int, src.input().split())

print(h*w, 2*h+2*w)



### FIXED CODE ###

h, w = map(int, input().split())

print(h*w, 2*h+2*w)
n= int("".join(num.split()))

import math
if math.sqrt(n) % 1 == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n= int("".join(input().split()))

import math
if math.sqrt(n) % 1 == 0:
    print("Yes")
else:
    print("No")