#include <bits/stdc++.h>
using namespace std;
const int N = 25;
int n, k, t, a[N], b[N], c[N];
bool da[5], db[5];
int joy = 0;
vector<int> v;
void rec(int i) {
  if (i == k) {
    v.push_back(joy);
    return;
  }
  if (!da[a[i]] && !db[b[i]]) {
    da[a[i]] = db[b[i]] = true;
    joy += c[i];
    rec(i + 1);
    joy -= c[i];
    da[a[i]] = db[b[i]] = false;
  }
  rec(i + 1);
}
int main() {
  cin >> n >> k >> t;
  for (int i = 0; i < k; i++) {
    cin >> a[i] >> b[i] >> c[i];
    --a[i], --b[i];
  }
  rec(0);
  sort(v.begin(), v.end());
  cout << v[t - 1] << endl;
}
