#include <bits/stdc++.h>
using namespace std;
const int MAX_K = 100;
int n, k, t;
int mid, cnt;
std::pair<int, long long> e[MAX_K];
void dfs(int id, int v, long long mask) {
  if (id == k) return;
  if (cnt >= t) return;
  if (v + e[id].first > mid) return;
  if (!(mask & e[id].second)) {
    cnt++;
    dfs(id + 1, v + e[id].first, mask | e[id].second);
  }
  dfs(id + 1, v, mask);
}
int main() {
  scanf("%d%d%d", &n, &k, &t);
  for (int i = 0; i < k; i++) {
    int h, w;
    scanf("%d%d%d", &h, &w, &e[i].first);
    e[i].second = (1LL << (h + n)) | (1LL << w);
  }
  sort(e, e + k);
  int low = 0, high = n * 1000;
  while (low < high) {
    mid = (low + high) / 2;
    cnt = 1;
    dfs(0, 0, 0);
    if (cnt >= t)
      high = mid;
    else
      low = mid + 1;
  }
  printf("%d\n", low);
  return 0;
}
