#include <bits/stdc++.h>
using namespace std;
const int N = 8;
const int M = 100010;
const int K = 510;
const int LIT = 2500;
const int INF = 1 << 30;
int n, k, t;
struct node {
  int a, b, c;
} kk[N * N];
void init() {
  for (int i = 0; i < k; i++) {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    kk[i].a = a;
    kk[i].b = b;
    kk[i].c = c;
  }
}
void solve() {
  vector<long long> v(n);
  for (int i = 0; i < n; i++) v.push_back(i);
  vector<long long> res;
  for (int i = 0; i < (1 << k); i++) {
    int tmp = 0, fg = 1;
    bool vis1[N] = {0};
    bool vis2[N] = {0};
    for (int j = 0; j < k; j++) {
      if (i & (1 << j)) {
        if (vis1[kk[j].a] || vis2[kk[j].b]) {
          fg = 0;
          break;
        } else
          tmp += kk[j].c;
        vis1[kk[j].a] = 1;
        vis2[kk[j].b] = 1;
      }
    }
    if (fg) res.push_back(tmp);
  }
  sort(res.begin(), res.end());
  t--;
  cout << res[t] << endl;
}
int main() {
  while (cin >> n >> k >> t) {
    init();
    solve();
  }
}
