#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, t;
  cin >> n >> k >> t;
  vector<pair<int, pair<int, int> > > weight;
  while (k--) {
    int h, w, r;
    cin >> h >> w >> r;
    weight.push_back(make_pair(r, make_pair(h, w)));
  }
  vector<int> ans;
  for (int marraiges = 0; marraiges <= min(n, (int)weight.size());
       marraiges++) {
    vector<int> v(weight.size(), 0);
    for (int i = 0; i < marraiges; i++) v[i] = 1;
    sort((v).begin(), (v).end());
    do {
      int success = true;
      vector<bool> husband(n + 1, false);
      vector<bool> wife(n + 1, false);
      int count = 0;
      for (int i = 0; i < v.size() && success; i++) {
        if (v[i] == 1) {
          if (husband[weight[i].second.first] || wife[weight[i].second.second])
            success = false;
          husband[weight[i].second.first] = true;
          wife[weight[i].second.second] = true;
          count += weight[i].first;
        }
      }
      if (success) ans.push_back(count);
    } while (next_permutation((v).begin(), (v).end()));
  }
  sort((ans).begin(), (ans).end());
  cout << ans[t - 1] << endl;
}
