#include <bits/stdc++.h>
using namespace std;
int n, k, t;
bool mf[5], ff[5];
int h[100], w[100], r[100];
vector<int> val;
void rec(int ind, int sum) {
  if (ind == k - 1) {
    val.push_back(sum);
    if (mf[h[ind] - 1] & ff[w[ind] - 1]) val.push_back(sum + r[ind]);
    return;
  }
  rec(ind + 1, sum);
  if (mf[h[ind] - 1] & ff[w[ind] - 1]) {
    mf[h[ind] - 1] = false;
    ff[w[ind] - 1] = false;
    rec(ind + 1, sum + r[ind]);
    mf[h[ind] - 1] = true;
    ff[w[ind] - 1] = true;
  }
}
int main() {
  cin >> n >> k >> t;
  for (int i = 0; i < n; i++) mf[i] = ff[i] = true;
  for (int i = 0; i < k; i++) {
    cin >> h[i] >> w[i] >> r[i];
  }
  rec(0, 0);
  sort(val.begin(), val.end());
  cout << val[t - 1];
  return 0;
}
