#include <bits/stdc++.h>
using namespace std;
long long int v[600], u[600], w[600];
priority_queue<long long int, vector<long long int>, greater<long long int>> q;
long long int n, m, k;
void dfs(long long int id, long long int ans, long long int* f1,
         long long int* f2) {
  if (f1[v[id]] == 1 || f2[u[id]] == 1) {
    return;
  } else {
    f1[v[id]] = 1;
    f2[u[id]] = 1;
    ans += w[id];
    q.push(ans);
    for (long long int i = id + 1; i < m; i++) {
      dfs(i, ans, f1, f2);
    }
    f1[v[id]] = 0;
    f2[u[id]] = 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", &v[i], &u[i], &w[i]);
  }
  long long int ans = 0;
  q.push(0);
  memset(f1, 0, sizeof(f1));
  memset(f2, 0, sizeof(f2));
  for (long long int i = 0; 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;
}
