#include <bits/stdc++.h>
#pragma comment(linker, "/stack:64000000")
using namespace std;
template <typename X>
inline X abs(const X &a) {
  return a < 0 ? -a : a;
}
template <typename X>
inline X sqr(const X &a) {
  return a * a;
}
const int INF = INT_MAX / 2;
const long long INF64 = LLONG_MAX / 2LL;
const long double EPS = 1E-9;
const long double PI = 3.1415926535897932384626433832795;
const int BITS = 25;
const int N = 100 + 3;
struct pr {
  int he, she, r;
};
char good[1 << BITS];
map<int, pair<int, int> > p;
map<int, int> sum;
int sz = 0;
int v[1 * 1000 * 1000 + 13];
int main() {
  int n, k, t;
  pr a[N];
  cin >> n >> k >> t;
  for (int i = 0; i < int(k); i++) {
    cin >> a[i].he >> a[i].she >> a[i].r;
    a[i].he--;
    a[i].she--;
  }
  good[0] = true;
  v[sz++] = 0;
  for (int mask = 1; mask < (1 << k); mask++) {
    int prev = mask & (mask - 1);
    if (!good[prev]) continue;
    int idx = 0;
    int cur = mask;
    while (!(cur & 1)) {
      idx++;
      cur >>= 1;
    }
    int he = p[prev].first;
    int she = p[prev].second;
    if (((he & (1 << a[idx].he)) != 0) || ((she & (1 << a[idx].she)) != 0)) {
      good[mask] = false;
      continue;
    }
    good[mask] = true;
    p[mask] = make_pair(he | (1 << a[idx].he), she | (1 << a[idx].she));
    v[sz++] = sum[mask] = sum[prev] + a[idx].r;
  }
  sort(v, v + sz);
  t--;
  assert(t < sz);
  cout << v[t] << endl;
  return 0;
}
