#include <bits/stdc++.h>
using namespace std;
const int N = 131072;
int sz, n, k, i, t, x, y, z, hp[N];
pair<int, pair<int, int> > w[N];
void up(int x) {
  while (x > 1 && hp[x] > hp[x / 2]) {
    swap(hp[x], hp[x / 2]);
    x /= 2;
  }
}
void dw(int x) {
  int j;
  while (x + x <= sz) {
    j = x;
    if (hp[x + x] > hp[x]) j = x + x;
    if (x + x + 1 <= sz && hp[x + x + 1] > hp[j]) j = x + x + 1;
    if (x == j) return;
    swap(hp[x], hp[j]);
    x = j;
  }
}
void th(int x) {
  hp[++sz] = x;
  up(sz);
}
void dfs(int x, int mask1, int mask2, int q) {
  if (sz == t && hp[1] <= q) return;
  if (x > k) {
    if (sz < t)
      th(q);
    else {
      hp[1] = q;
      dw(1);
    }
    return;
  }
  int pe1 = w[x].second.first, pe2 = w[x].second.second;
  if ((!(mask1 & (1 << pe1)) && (!(mask2 & (1 << pe2)))))
    dfs(x + 1, mask1 | (1 << pe1), mask2 | (1 << pe2), q + w[x].first);
  dfs(x + 1, mask1, mask2, q);
}
int main() {
  scanf("%d%d%d", &n, &k, &t);
  sz = 0;
  for (i = 1; i <= k; ++i) {
    scanf("%d%d%d", &x, &y, &z);
    w[i] = make_pair(z, make_pair(x, y));
  }
  sort(w + 1, w + k + 1);
  reverse(w + 1, w + k + 1);
  dfs(1, 0, 0, 0);
  printf("%d\n", hp[1]);
  return 0;
}
