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