#include <bits/stdc++.h>
using namespace std;
int n, k, t;
vector<pair<int, int> > p;
vector<int> a;
bool m[100], w[100];
vector<int> h;
void solve(int j, int res) {
  if (j == k) {
    h.push_back(res);
    return;
  }
  solve(j + 1, res);
  if (!m[p[j].first] && !w[p[j].second]) {
    m[p[j].first] = w[p[j].second] = true;
    solve(j + 1, res + a[j]);
    m[p[j].first] = w[p[j].second] = false;
  }
}
int main() {
  cin >> n >> k >> t;
  for (int i = 0; i < k; i++) {
    int m, w, r;
    cin >> m >> w >> r;
    p.push_back(make_pair(m, w));
    a.push_back(r);
  }
  h.push_back(-1);
  solve(0, 0);
  sort(h.begin(), h.end());
  cout << h[t];
  return 0;
}
