#include <bits/stdc++.h>
using namespace std;
pair<int, long long> es[200];
long long mid;
int N, K, T;
int cnt = 0;
void dfs(int x, int v, long long mask) {
  if (x == K) return;
  if (cnt >= T) return;
  if (v + es[x].first > mid) return;
  if (!(mask & es[x].second)) {
    cnt++;
    dfs(x + 1, v + es[x].first, mask | es[x].second);
  }
  dfs(x + 1, v, mask);
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> N >> K >> T;
  for (int i = 0; i < K; i++) {
    int u, v;
    cin >> u >> v >> es[i].first;
    es[i].second = (1LL << u) | (1LL << (v + N));
  }
  sort(es, es + K);
  long long l = 0;
  long long r = 1000 * N;
  while (l < r) {
    mid = (l + r) >> 1;
    cnt = 1;
    dfs(0, 0, 0);
    if (cnt >= T)
      r = mid;
    else
      l = mid + 1;
  }
  printf("%lld\n", l);
  return 0;
}
