#include <bits/stdc++.h>
using namespace std;
int n, k, t, a[30][30], cnt[300000], h, w, r, u[30], sz[30], Max, Mask[30],
    P[1 << 21];
pair<int, int> e[300][300];
double T;
inline void calc(int pos, int val, int mask) {
  if (clock() - T > 1.95 * CLOCKS_PER_SEC) return;
  if (pos == n) {
    cnt[val]++;
    return;
  }
  int M = (mask & Mask[pos]);
  calc(pos + 1, val, mask);
  while (M > 0) {
    int l = P[M];
    M ^= (1 << l);
    calc(pos + 1, val + a[pos][l], mask ^ (1 << l));
  }
}
int main() {
  T = clock();
  scanf("%d%d%d", &n, &k, &t);
  for (int i = 1; i <= k; ++i) {
    scanf("%d%d%d", &h, &w, &r);
    --h, --w;
    a[h][w] = r;
    Mask[h] |= (1 << w);
  }
  for (int i = 1; i < (1 << n); ++i) P[i] = 31 - __builtin_clz(i);
  calc(0, 0, (1 << n) - 1);
  for (int i = 0; i <= 20000; ++i) {
    if (t <= cnt[i]) {
      printf("%d", i);
      return 0;
    }
    t -= cnt[i];
  }
  return 0;
}
