#include <bits/stdc++.h>
using namespace std;
int n, k, t;
int marrige[22][22];
bool visw[22], vish[22];
bool vis[22][22];
vector<int> F;
void gao(vector<int> K, int u, int sum, int cnt) {
  if (cnt != 0) {
    F.push_back(sum);
  }
  for (int i = u; i < K.size(); i++) {
    int tmp = K[i];
    gao(K, i + 1, sum + tmp, cnt + 1);
  }
}
int main() {
  while (cin >> n >> k >> t) {
    F.clear();
    memset(marrige, 0, sizeof(marrige));
    int w, h, r;
    for (int i = 0; i < k; i++) {
      scanf("%d %d %d", &w, &h, &r);
      marrige[w][h] = r;
    }
    int idx[22];
    for (int i = 1; i <= 6; i++) idx[i] = i;
    F.push_back(0);
    do {
      vector<int> K;
      K.clear();
      for (int i = 1; i <= n; i++) {
        int tmp = marrige[i][idx[i]];
        if (tmp != 0) K.push_back(tmp);
      }
      gao(K, 0, 0, 0);
    } while (next_permutation(idx + 1, idx + n + 1));
    sort(F.begin(), F.end());
    cout << F[t - 1] << endl;
  }
  return 0;
}
