import string

n = 0
k = 0
t = 0
M = []  

def slow(M):
    marriedA = set()
    marriedB = set()
    comb = list()
    slowrec(M, comb, marriedA, marriedB, [])
    result = sorted(comb, key=lambda x: sum(myf(x)))
    result.insert(0, [(-1, -1, 0)])
    return sum(myf(result[t]))


def slowrec(M, comb, marriedA, marriedB, currmarried, minindex=0): 
    for i in range(minindex, len(M)):
        m1, m2, r = m = M[i]
        if m1 in marriedA or m2 in marriedB:
            continue
        marriedA.add(m1)
        marriedB.add(m2)
        cm = currmarried[:]
        cm.append(m)
        comb.append(cm)
        slowrec(M, comb, marriedA, marriedB, cm, i+1)
        marriedA.remove(m1)
        marriedB.remove(m2)
        

def solve():
    global n, k, t, M
    rin = reader()
    n, k, t = list(map(int, next(rin).split()))
    for i in range(k):
        m1, m2, r = list(map(int, next(rin).split()))
        M.append((m1-1, m2-1, r))
    t -= 1
    
    result = slow(M)
    print(result)

def myf(a):
    for i in a:
        yield i[2]

def reader():
    try: input = raw_input
    except: pass
    USE_FILE = False
    if __name__ == '__main__' and USE_FILE:
        rin = open("F.in", "r")
        while True:
            yield next(rin)
    else:
        while True:
            yield input()
            
      
solve()
