#include <bits/stdc++.h>
using namespace std;
int n, k, t, a[400], b[400], h[400];
bool usedm[20], usedw[20];
vector<int> r;
int main() {
  cin >> n >> k >> t;
  for (int i = 0; i < k; i++) {
    cin >> a[i] >> b[i] >> h[i];
    a[i]--;
    b[i]--;
  }
  for (int mask = 0; mask < (1 << min(k, 20)); mask++) {
    memset(usedm, 0, sizeof usedm);
    memset(usedw, 0, sizeof usedw);
    int rez = 0;
    bool flag = 1;
    for (int i = 0; i < k && flag; i++) {
      if (mask & (1 << i)) {
        if ((!usedm[a[i]]) && (!usedw[b[i]])) {
          usedm[a[i]] = 1;
          usedw[b[i]] = 1;
          rez += h[i];
        } else {
          flag = 0;
        }
      }
    }
    if (flag) {
      r.push_back(rez);
    }
  }
  sort(r.begin(), r.end());
  cout << r[t - 1] << endl;
}
