#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:65777216")
using namespace std;
const int N = 22;
const int INF = 111111111;
const double eps = 1e-9;
const double pi = 3.14159265358979;
int n, k, ne, g[N][N], a[N], c;
pair<string, int> t[111111];
inline bool cmp(pair<string, int> a, pair<string, int> b) {
  return a.second < b.second || a.second == b.second && a.first < b.first;
}
inline void check() {
  for (int msk = 0; msk < (1 << n); msk++) {
    for (int i = 1; i <= (n); i++)
      if ((msk & (1 << (i - 1))) && !g[i][a[i]]) break;
    string f;
    int cur = 0;
    for (int i = 1; i <= (n); i++)
      if (msk & (1 << (i - 1))) {
        f += (char)('0' + i);
        f += (char)('0' + a[i]);
        cur += g[i][a[i]];
      }
    t[++c].first = f;
    t[c].second = cur;
  }
}
int main() {
  cin >> n >> k >> ne;
  for (int i = 1; i <= (k); i++) {
    int a, b, c;
    cin >> a >> b >> c;
    g[a][b] = c;
  }
  for (int i = 1; i <= (n); i++) a[i] = i;
  do {
    check();
  } while (next_permutation(a + 1, a + n + 1));
  sort(t + 1, t + c + 1, cmp);
  int cur = t[1].first == "";
  for (int i = 1; i <= (c); i++) {
    if (t[i].first != t[i - 1].first) ++cur;
    if (cur == ne) {
      cout << t[i].second << endl;
      return 0;
    }
  }
  return 0;
}
