#include <bits/stdc++.h>
using namespace std;
vector<int> vv;
int v[26], u[26], w[26], n, k, t;
int main() {
  double now = clock();
  cin >> n >> k >> t;
  for (int i = 0; i < k; i++) cin >> v[i] >> u[i] >> w[i];
  for (int i = 0; i < (1 << k); i++) {
    int a = 0, b = 0, tmp = 0;
    bool flag = true;
    for (int j = 0; j < k; j++)
      if (i >> j & 1)
        tmp += w[j], flag &= !((a >> v[j] & 1) | (b >> u[j] & 1)),
            a |= (1 << v[j]), b |= (1 << u[j]);
    if (flag) vv.push_back(tmp);
    if (clock() - now >= 1.0 * CLOCKS_PER_SEC) break;
  }
  vv.push_back(0);
  sort(vv.begin(), vv.end());
  cout << vv[t];
}
