import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

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

    Scanner in;
    PrintWriter out;

    void run() {
        in = new Scanner(System.in);
        out = new PrintWriter(System.out);
        try {
            solve();
        } finally {
            out.close();
        }
    }

    class Point {
        int x;
        int y;

        Point(int X, int Y) {
            x = X;
            y = Y;
        }

        @Override
        public boolean equals(Object o) {
            Point p = (Point) o;
            return p.x == x && p.y == y;
        }

        @Override
        public String toString() {
            return "( " + x + ", " + y + " )";
        }

        @Override
        public int hashCode() {
            return x * 31 + y;
        }
    }

    class Pair {
        int f;
        int s;
        int val;

        Pair(int f, int s, int val) {
            this.f = f;
            this.s = s;
            this.val = val;
        }

        @Override
        public int hashCode() {
            return 31 * 31 * f + 31 * s + val;
        }

        @Override
        public boolean equals(Object o) {
            Pair p = (Pair) o;
            return f == p.f && s == p.s && val == p.val;
        }
    }

    int n;

    class Sets {
        int ans;
        boolean usedM[];
        boolean usedF[];

        Sets() {
            usedM = new boolean[n];
            usedF = new boolean[n];
            ans = 0;
        }

        boolean contains(Pair p) {
            return usedM[p.s] || usedF[p.f];
        }

        boolean add(Pair p) {
            if (contains(p)) {
                throw new Error();
            }
            usedF[p.f] = true;
            usedM[p.s] = true;
            ans += p.val;
            return true;
        }

        void remove(Pair p) {
            usedF[p.f] = false;
            usedM[p.s] = false;
            ans -= p.val;
        }

        int getRecord() {
            return ans;
        }
    }

    Pair a[];
    int k;
    Sets set;
    ArrayList<Integer> records;

    void go(int prev, int cnt) {
        records.add(set.getRecord());
        for (int i = prev + 1; i < k; i++) {
            if (!set.contains(a[i])) {
                set.add(a[i]);
                go(i, cnt + 1);
                set.remove(a[i]);
            }
        }
    }

    void solve() {
        n = in.nextInt();
        k = in.nextInt();
        int t = in.nextInt();
        a = new Pair[k];
        for (int i = 0; i < k; i++) {
            a[i] = new Pair(in.nextInt() - 1, in.nextInt() - 1, in.nextInt());
        }
        set = new Sets();
        records = new ArrayList<Integer>();
        go(-1, 0);
        Collections.sort(records);
        out.println(records.get(t - 1));

    }
}