#include <bits/stdc++.h>
using namespace std;
long long int n, m, k;
long long int mid, cnt;
struct node {
  long long int v, u, w;
};
long long int cmp(const node& a, const node& b) { return a.w < b.w; }
node a[600];
void dfs(long long int id, long long int ans, long long int* f1,
         long long int* f2) {
  if (id >= m) return;
  if (cnt >= k) return;
  if (ans + a[id].w > mid) return;
  if (!(f1[a[id].v] == 1 || f2[a[id].u] == 1)) {
    cnt++;
    f1[a[id].v] = 1;
    f2[a[id].u] = 1;
    dfs(id + 1, ans + a[id].w, f1, f2);
    f1[a[id].v] = 0;
    f2[a[id].u] = 0;
  }
  dfs(id + 1, ans, f1, f2);
}
int main() {
  scanf("%lld %lld %lld", &n, &m, &k);
  for (long long int i = 0; i < m; i++) {
    scanf("%lld %lld %lld", &a[i].v, &a[i].u, &a[i].w);
  }
  long long int f1[600], f2[600];
  memset(f1, 0, sizeof(f1));
  memset(f2, 0, sizeof(f2));
  sort(a, a + m, cmp);
  long long int low = 0, high = n * 1000;
  while (low < high) {
    mid = (low + high) / 2;
    cnt = 1;
    dfs(0, 0, f1, f2);
    if (cnt >= k)
      high = mid;
    else
      low = mid + 1;
  }
  printf("%lld\n", low);
  return 0;
}
