#include <bits/stdc++.h>
using namespace std;
int a, b, c, x[100], y[100], z[100], sum;
bool usx[20], usy[20];
multiset<int> S;
void f1(long long arc) {
  sum = 0;
  for (int i = 0; i < b; i++) {
    if (arc & 1) {
      if (usx[x[i]] || usy[y[i]]) {
        for (int j = 0; j < a; j++) {
          usx[j] = usy[j] = 0;
        }
        return;
      } else {
        usx[x[i]] = 1;
        usy[y[i]] = 1;
        sum += z[i];
      }
    }
    arc >>= 1;
  }
  for (int j = 0; j < a; j++) {
    usx[j] = usy[j] = 0;
  }
  S.insert(sum);
}
int main() {
  cin >> a >> b >> c;
  for (int i = 0; i < b; i++) {
    cin >> x[i] >> y[i] >> z[i];
    x[i]--;
    y[i]--;
  }
  for (long long i = 0; i < (1 << b); i++) {
    f1(i);
  }
  int i = 0;
  for (auto ar : S) {
    i++;
    if (i == c) {
      cout << ar;
      return 0;
    }
  }
}
