import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeSet;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskF1 solver = new TaskF1();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskF1 {
        TreeSet<set> sets;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            int t = in.nextInt();
            edge[] edges = new edge[k];
            for (int i = 0; i < k; i++) {
                edges[i] = new edge();
                edges[i].h = in.nextInt();
                edges[i].w = in.nextInt();
                edges[i].r = in.nextInt();
            }
            sets = new TreeSet<>();
            sets.add(new set(edges, n));
            for (int i = 0; i < n && sets.size() < t; i++) {
                TreeSet<set> nextSets = new TreeSet<>();
                for (set curSet : sets) {
                    nextSets.add(curSet);
                    for (int j1 = 1; j1 <= n; j1++) {
                        for (int j2 = 1; j2 <= n; j2++) {
                            if (!curSet.usedMen[j1 - 1] && !curSet.usedWomen[j2 - 1] && curSet.hasEdge(j1, j2)) {
                                set next = curSet.copy();
                                next.setEdge(j1, j2);
                                nextSets.add(next);
                            }
                        }
                    }
                }
                sets = nextSets;
            }
            ArrayList<set> setsArr = new ArrayList<>();
            for (set curSet : sets) {
                curSet.calcCost();
                setsArr.add(curSet);
            }
            setsArr.sort((set f, set s) -> f.cost - s.cost);
            out.println(setsArr.get(t - 1).cost);
        }

    }

    static class set implements Comparable {
        boolean[] usedEdges;
        boolean[] costUsedEdges;
        boolean[] usedMen;
        boolean[] usedWomen;
        int cost;
        edge[] edges;

        set(edge[] edges1, int n) {
            edges = edges1;
            usedEdges = new boolean[edges.length];
            costUsedEdges = new boolean[edges.length];
            usedMen = new boolean[n];
            usedWomen = new boolean[n];
            cost = 0;
        }

        public void calcCost() {
            for (int i = 0; i < edges.length; i++) {
                if (costUsedEdges[i]) cost += edges[i].r;
            }
        }

        public boolean hasEdge(int u, int v) {
            for (int i = 0; i < edges.length; i++) {
                if (edges[i].h == u && edges[i].w == v) {
                    if (usedEdges[i]) return false;
                    return true;
                }
            }
            return false;
        }

        public void setEdge(int u, int v) {
            int edgeId = 0;
            for (int i = 0; i < edges.length; i++) {
                if (edges[i].h == u && edges[i].w == v) {
                    edgeId = i;
                    break;
                }
            }
            costUsedEdges[edgeId] = true;
            usedMen[edges[edgeId].h - 1] = true;
            usedMen[edges[edgeId].w - 1] = true;
            for (int i = 0; i < edges.length; i++) {
                if (edges[i].h == edges[edgeId].h && edges[i].w == edges[edgeId].w) {
                    usedEdges[i] = true;
                }
            }
        }

        public set copy() {
            set res = new set(edges, usedMen.length);
            for (int i = 0; i < edges.length; i++) {
                res.usedEdges[i] = usedEdges[i];
                res.costUsedEdges[i] = costUsedEdges[i];
            }
            for (int i = 0; i < usedMen.length; i++) {
                res.usedMen[i] = usedMen[i];
                res.usedWomen[i] = usedWomen[i];
            }
            return res;
        }

        public int compareTo(Object o) {
            for (int i = 0; i < edges.length; i++) {
                if (usedEdges[i] ^ ((set) o).usedEdges[i]) {
                    if (usedEdges[i]) return 1;
                    return -1;
                }
            }
            return 0;
        }

    }

    static class edge {
        int h;
        int w;
        int r;

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public String next() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

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

    }
}

