import java.io.*;
import java.util.*;

public class F {

	BufferedReader in;
	StringTokenizer st;
	PrintWriter out;

	String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}

	int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	long nextLong() throws Exception {
		return Long.parseLong(next());
	}

	double nextDouble() throws Exception {
		return Double.parseDouble(next());
	}

	void solve() throws Exception {
		int n = nextInt(), k = nextInt(), req = nextInt();
		int upd[] = new int[k];
		int cost[] = new int[k];

		int cnt = 0;
		for (int i = 0; i < k; i++) {
			int q = nextInt() - 1, w = nextInt() - 1 + n;
			upd[i] = (1 << q) + (1 << w);
			cost[i] = nextInt();
		}

		ArrayList<Integer> all = new ArrayList<Integer>();
		for (int i = 0; i < (1 << k); i++) {
			boolean sat = true;
			if (Integer.bitCount(i) * 2 > k)
				continue;
			int ti = i;
			int mask = 0;
			int ans = 0;
			for (int j = 0; j < k && sat; j++) {
				if ((i & 1) == 1) {
					sat &= ((mask & upd[j]) == 0);
					mask += upd[j];
					ans += cost[j];
				}
				i >>= 1;
			}

			i = ti;
			if (sat) {
				all.add(ans);

			}
		}

		int q = all.size();
		int a[] = new int[q];
		for (int i = 0; i < q; i++)
			a[i] = all.get(i);
		Arrays.sort(a);
		out.println(a[req - 1]);
	}

	void run() {
		try {
			Locale.setDefault(Locale.US);
			boolean oj = System.getProperty("ONLINE_JUDGE") != null;
			Reader reader = oj ? new InputStreamReader(System.in) : new FileReader("input.txt");
			Writer writer = oj ? new OutputStreamWriter(System.out) : new FileWriter("output.txt");
			in = new BufferedReader(reader);
			out = new PrintWriter(writer);
			solve();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public static void main(String[] args) {
		new F().run();

	}

}
