#include <bits/stdc++.h>
using namespace std;
int n, m, a[101][4], T, c[20001], tot, value[6][6], v[6];
bool b[6];
inline void soso(int now) {
  if (now == n + 1) {
    bool ok = true;
    for (int i = 1; i <= n; i++)
      if (v[i] && !value[i][v[i]]) {
        ok = false;
        break;
      }
    if (ok) {
      int cnt = 0;
      for (int i = 1; i <= n; i++)
        if (v[i]) cnt += value[i][v[i]];
      c[++tot] = cnt;
    }
    return;
  }
  v[now] = 0;
  soso(now + 1);
  for (int i = 1; i <= n; i++)
    if (!b[i]) b[i] = true, v[now] = i, soso(now + 1), b[i] = false;
}
inline void kspx(int s, int t) {
  if (s < t) {
    int i = s, j = t, k = (i + j) >> 1;
    int l = c[i];
    c[i] = c[k];
    c[k] = l;
    k = c[i];
    while (i != j) {
      while (i < j && c[j] > k) --j;
      if (i < j) c[i++] = c[j];
      while (i < j && c[i] < k) ++i;
      if (i < j) c[j--] = c[i];
    }
    c[i] = k;
    kspx(s, i - 1);
    kspx(i + 1, t);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &T);
  memset(value, 0, sizeof(value));
  for (int i = 1; i <= m; i++)
    scanf("%d%d%d", &a[i][1], &a[i][2], &a[i][3]),
        value[a[i][1]][a[i][2]] = a[i][3];
  memset(b, false, sizeof(b));
  tot = 0;
  soso(1);
  kspx(1, tot);
  printf("%d\n", c[T]);
}
