#include <bits/stdc++.h>
using namespace std;
const int MAXN = 65;
const int MAXM = 210;
int n, m, k;
struct edge {
  int w;
  long long s;
  bool operator<(const edge &o) const { return w < o.w; }
} e[MAXM];
int cnt = 0;
void dfs(int now, int sum, long long state, const int lim) {
  if (now > m || sum + e[now].w > lim || cnt >= k) return;
  dfs(now + 1, sum, state, lim);
  if (!(state & e[now].s)) {
    ++cnt;
    dfs(now + 1, sum + e[now].w, state | e[now].s, lim);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  int l = 0, r = 0, mid, ans = -1;
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d%d", &a, &b, &e[i].w);
    e[i].s = (1ll << a + n) | (1ll << b);
    r += e[i].w;
  }
  sort(e + 1, e + m + 1);
  while (l <= r) {
    mid = l + r >> 1;
    cnt = 1;
    dfs(1, 0, 0ll, mid);
    if (cnt >= k)
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
