#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int N = 1e5 + 5;
const int mod = 998244353;
int n, k, t, mid, cnt;
pair<int, long long> edge[N];
void dfs(int id, long long d, int ans) {
  if (id >= k) return;
  if (ans >= mid) return;
  if (cnt >= t) return;
  id++;
  if (!(d & edge[id].second) && ans + edge[id].first <= mid) {
    cnt++;
    dfs(id, d | edge[id].second, ans + edge[id].first);
  }
  dfs(id, d, ans);
}
int main() {
  cin >> n >> k >> t;
  for (int i = 1; i <= k; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &edge[i].first);
    edge[i].second = (1LL << (u + n)) | (1LL << v);
  }
  int l = 0, r = n * 1000;
  while (l < r) {
    mid = (l + r) >> 1;
    cnt = 1;
    dfs(0, 0, 0);
    if (cnt >= t)
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", r);
}
