#include <bits/stdc++.h>
using namespace std;
int n, k, t, res, h[111], w[111], r[111], s, cnt, val[2111111];
bool ddh[111], ddw[111];
void calc(int i) {
  if (i > k) {
    cnt++;
    val[cnt] = s;
    return;
  }
  calc(i + 1);
  if ((!ddh[h[i]]) && (!ddw[w[i]])) {
    s += r[i];
    ddh[h[i]] = true;
    ddw[w[i]] = true;
    calc(i + 1);
    s -= r[i];
    ddh[h[i]] = false;
    ddw[w[i]] = false;
  }
}
void swap(int& u, int& v) {
  int temp = u;
  u = v;
  v = temp;
}
void sort(int lo, int hi) {
  if (lo >= hi) return;
  int i = lo, j = hi, k = val[(lo + hi) / 2];
  while (i <= j) {
    while (val[i] < k) i++;
    while (val[j] > k) j--;
    if (i <= j) {
      swap(val[i], val[j]);
      i++;
      j--;
    }
  }
  sort(i, hi);
  sort(lo, j);
}
int main() {
  scanf("%d%d%d", &n, &k, &t);
  for (int i = 1; i <= k; i++) scanf("%d%d%d", &h[i], &w[i], &r[i]);
  cnt = 0;
  s = 0;
  for (int i = 1; i <= n; i++) {
    ddh[i] = false;
    ddw[i] = false;
  }
  calc(1);
  sort(1, cnt);
  res = val[t];
  printf("%d\n", res);
  return 0;
}
