#include <bits/stdc++.h>
using namespace std;
int x, y, z, n, m, k, med, cnt;
pair<int, long long> a[100];
void dfs(int id, int v, long long mask) {
  if (id == m) return;
  if (cnt >= k) return;
  if (v + a[id].first > med) return;
  if (!(mask & a[id].second)) {
    cnt++;
    dfs(id + 1, v + a[id].first, mask | a[id].second);
  }
  dfs(id + 1, v, mask);
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  if (k == 1) return puts("0"), 0;
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &x, &y, &z);
    a[i] = make_pair(z, (1LL << (x + n)) | (1LL << y));
  }
  sort(a, a + m);
  int ans = 0, t;
  for (t = 1;; t <<= 1) {
    med = t;
    cnt = 1;
    dfs(0, 0, 0);
    if (cnt >= k) {
      ans = t >> 1;
      break;
    }
  }
  for (t = ans >> 1; t; t >>= 1) {
    med = ans + t;
    cnt = 1;
    dfs(0, 0, 0);
    if (cnt < k) ans += t;
  }
  cout << ans + 1 << endl;
}
