#include <bits/stdc++.h>
using namespace std;
inline int ni() {
  int a;
  scanf("%d", &a);
  return a;
}
pair<pair<int, int>, int> wds[100];
vector<int> reses;
bool mu[20], wu[20];
void rec(int step, int limit, int price) {
  if (step == limit) {
    reses.push_back(price);
    return;
  }
  for (int i = step; i < limit; i++) {
    int m = wds[i].first.first, w = wds[i].first.second;
    int np = wds[i].second;
    if (!mu[m] && !wu[w]) {
      mu[m] = wu[w] = true;
      rec(i + 1, limit, price + np);
      mu[m] = wu[w] = false;
    }
  }
  rec(limit, limit, price);
}
int main() {
  int n = ni(), k = ni(), t = ni();
  for (int i = 0; i < int(k); i++) {
    wds[i].first.first = ni() - 1, wds[i].first.second = ni() - 1;
    wds[i].second = ni();
  }
  rec(0, k, 0);
  sort(reses.begin(), reses.end());
  cout << reses[t - 1] << endl;
  return 0;
}
