#include <bits/stdc++.h>
using namespace std;
long long labs(long long a) { return a < 0 ? (-a) : a; }
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
const int MAXN = 6;
const int MAXK = 26;
const int MAXRES = 5 * 1001;
struct Var {
  int a, b;
  int c;
};
Var v[MAXK];
int res[MAXRES];
int n, k, t;
bool was1[MAXN];
bool was2[MAXN];
void Solve(int mask) {
  memset((was1), 0, sizeof(was1));
  memset((was2), 0, sizeof(was2));
  int sum = 0;
  for (int(i) = 0; (i) < (k); (i)++) {
    if (mask & 1) {
      if (was1[v[i].a] || was2[v[i].b]) {
        return;
      }
      was1[v[i].a] = 1;
      was2[v[i].b] = 1;
      sum += v[i].c;
    }
    mask >>= 1;
  }
  res[sum]++;
}
int main() {
  cin >> n >> k >> t;
  if (t == 1) {
    cout << 0 << endl;
    return 0;
  }
  memset((res), 0, sizeof(res));
  for (int(i) = 0; (i) < (k); (i)++) {
    cin >> v[i].a >> v[i].b >> v[i].c;
    v[i].a--;
    v[i].b--;
  }
  for (int mask = 0; mask < (1 << k); mask++) {
    Solve(mask);
  }
  int cur = 0;
  for (int(i) = 0; (i) < (MAXRES); (i)++) {
    cur += res[i];
    if (cur >= t) {
      cout << i << endl;
      return 0;
    }
  }
  return 0;
}
