def g(t, d):
    j = len(d) - 1
    i = len(t) - 1
    while j >= 0:
        while i >= 0 and t[i] > d[j]: i -= 1
        t.insert(i + 1, d[j])
        j -= 1
        
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], [0] * (n + 1), [0] * (n + 1) 
def f(i, s):
    global p, q, a, b, k, t
    r = [(p[j][1], p[j][2], s + p[j][0], j + 1) for j in range(i, k) if a[p[j][1]] == b[p[j][2]] == 0]
    g(q, [s[2] for s in r])
    if len(q) > t: q = q[:t]
    for h, w, s, j in r:
        if len(q) == t and s >= q[t - 1]: break
        a[h], b[w] = 1, 1
        f(j, s)
        a[h], b[w] = 0, 0
f(0, 0)
print(q[t - 1])