#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
int n, k, t, cur;
int16_t h[100], w[100], r[100];
bool v[2][21];
vector<int16_t> rr;
void run(int i) {
  if (i == k) {
    rr.push_back(cur);
  } else {
    run(i + 1);
    if (!v[0][h[i]] && !v[1][w[i]]) {
      v[0][h[i]] = v[1][w[i]] = true;
      cur += r[i];
      run(i + 1);
      cur -= r[i];
      v[0][h[i]] = v[1][w[i]] = false;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  cin >> n >> k >> t;
  for (int i = 0; i < k; i++) cin >> h[i] >> w[i] >> r[i];
  run(0);
  sort(rr.begin(), rr.end());
  cout << rr[t - 1] << endl;
  return 0;
}
