n, k, t = map(int, input().split())
p = [0] * k
for i in range(k):
    h, w, r = map(int, input().split())
    p[i] = (r, w, h)
p.sort()
q, a, b = [], [0] * (n + 1), [0] * (n + 1) 
def f(i, s):
    global p, q, a, b, k
    q.append(s)
    while i < k:
        h, w = p[i][1], p[i][2]
        if a[h] == b[w] == 0:
            a[h], b[w] = 1, 1
            f(i + 1, s + p[i][0])
            a[h], b[w] = 0, 0
        i += 1    
f(0, 0)
q.sort()
print(q[t - 1])