#include <bits/stdc++.h>
using namespace std;
struct node {
  long long int v, u, w;
};
node a[600];
priority_queue<long long int, vector<long long int>, greater<long long int>> q;
long long int n, m, k;
long long int kmax = -1;
long long cmp(const node& a, const node& b) { return a.w < b.w; }
void dfs(long long int id, long long int ans, long long int* f1,
         long long int* f2) {
  if (f1[a[id].v] == 1 || f2[a[id].u] == 1 || id > m) {
    return;
  } else {
    f1[a[id].v] = 1;
    f2[a[id].u] = 1;
    ans += a[id].w;
    if (q.size() <= k) {
      kmax = ans > kmax ? ans : kmax;
    } else {
      if (ans > kmax) return;
    }
    q.push(ans);
    for (long long int i = id + 1; i <= m; i++) {
      dfs(i, ans, f1, f2);
    }
    f1[a[id].v] = 0;
    f2[a[id].u] = 0;
  }
}
int main() {
  long long int f1[600], f2[600];
  scanf("%lld %lld %lld", &n, &m, &k);
  for (long long int i = 1; i <= m; i++) {
    scanf("%lld %lld %lld", &a[i].v, &a[i].u, &a[i].w);
  }
  sort(a, a + n, cmp);
  long long int ans = 0;
  q.push(0);
  memset(f1, 0, sizeof(f1));
  memset(f2, 0, sizeof(f2));
  for (long long int i = 1; i <= m; i++) {
    dfs(i, ans, f1, f2);
  }
  for (long long int i = 0; i < k - 1; i++) {
    q.pop();
  }
  printf("%lld", q.top());
  return 0;
}
