import java.util.*; import java.text.*; import java.io.BufferedReader;import java.math.*; import java.util.regex.*; import java.awt.geom.*; import static java.lang.Math.*; import static java.lang.Character.*; import static java.lang.Integer.*; import static java.lang.Double.*; import static java.lang.Long.*; import static java.lang.System.*; import static java.util.Arrays.*;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;

public class E {
    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static PrintStream out = System.out;

    static int n,k,t;
    static int[][] w;
    static int[][] e;
	static void readInput() throws IOException {
		int[] a = parseArrInt(in.readLine());
		n = a[0];
		k = a[1];
		t = a[2];
		w = new int[n][n];
		e = new int[k][3];
		for (int i = 0; i < k; i++) {
			a = parseArrInt(in.readLine());
			w[a[0]-1][a[1]-1] = max (w[a[0]-1][a[1]-1], a[2]);
			e[i][0] = a[0]-1;
			e[i][1] = a[1]-1;
			e[i][2] = a[2];
		}
	}

	static int SET(int mask, int u) {
		int one = 1;
		return mask | (one << u);
	}

	static boolean CHECK(int mask, int u) {
		int one = 1;
		return (mask & (one << u)) != 0;
	}

	static int FLIP(int mask, int u) {
		int one = 1;
		return mask ^ (one << u);
	}

	static int CLEAR(int mask, int u) {
		if (CHECK(mask, u))
			return FLIP(mask, u);
		else
			return mask;
	}
	
	static void process() {
		ArrayList<Integer> list = new ArrayList<Integer>();
		for (int mask = 0; mask < (1<<k); mask++) {
			int x = bitCount(mask);
			if (x>n) continue;
			int[] p = new int[n]; fill(p,-1);
			int[] q = new int[n]; fill(q,-1);
			boolean ok = true;
			int temp = 0;
			for (int i = 0; i < k; i++) if (CHECK(mask,i)){
				int u = e[i][0];
				int v = e[i][1];
				if (p[u]!=-1) ok = false;
				if (q[v]!=-1) ok = false;
				p[u] = v;
				q[v] = u;
				temp += e[i][2];
			}
			if (ok) list.add(temp);
		}
		Collections.sort(list);
		System.out.println(list.get(t-1));
	}

    public static void main(String[] args) throws IOException {
		readInput();
		process();
	}

	public static void debug(Object...os) { 
		System.err.println(Arrays.deepToString(os));
	} 
	static int[] parseArrInt(String s) {
		StringTokenizer st = new StringTokenizer(s);
		ArrayList<Integer> list = new ArrayList<Integer>();
		while (st.hasMoreTokens()) {
			list.add(Integer.parseInt(st.nextToken()));
		}
		Integer[] temp = list.toArray(new Integer[]{});
		int[] res = new int[temp.length];
		for (int i = 0; i < temp.length; i++) {
			res[i] = temp[i];
		}
		return (res);
	}

}
