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

public class Main {
  BufferedReader br;
  int n, k, t;
  ArrayList<Integer> arr;
  Marriage[] ms;
  boolean[] bu, gu;
  
  public class Marriage implements Comparable<Marriage> {
    int h, w, r;
    public Marriage(int h, int w, int r) {
      this.h = h;
      this.w = w;
      this.r = r;
    }
    public int compareTo(Marriage m) {
      return r - m.r;
    }
  }
  
  public void solve(int id, int sum) {
    if (id == k) {
      arr.add(sum);
      return;
    }
    solve(id + 1, sum);
    if (!bu[ms[id].h] && !gu[ms[id].w]) {
      bu[ms[id].h] = true;
      gu[ms[id].w] = true;
      solve(id + 1, sum + ms[id].r);
      bu[ms[id].h] = false;
      gu[ms[id].w] = false;
    }
  }
  
  public void go() throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] ss = br.readLine().split(" ");
    n = Integer.parseInt(ss[0]);
    k = Integer.parseInt(ss[1]);
    t = Integer.parseInt(ss[2]);
    
    bu = new boolean[n+1];
    gu = new boolean[n+1];
    Arrays.fill(bu, false);
    Arrays.fill(gu, false);
    
    ms = new Marriage[k];
    for (int i = 0; i < k; i++) {
      ss = br.readLine().split(" ");
      ms[i] = new Marriage(Integer.parseInt(ss[0]), Integer.parseInt(ss[1]), Integer.parseInt(ss[2]));
    }
    
    arr = new ArrayList<Integer>();
    solve(0, 0);
    Collections.sort(arr);
    
    System.out.println(arr.get(t - 1));
  }
  
  public static void main(String[] args) throws Exception {
    new Main().go();
  }
}
