#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int h[N * 100], v[N * 100], a[N][N], c[N];
bool b[N * 100], u[N];
int len, n, m, k, x, y, z;
void swap(int x, int y) {
  int t = h[x];
  h[x] = h[y];
  h[y] = t;
}
void up(int i) {
  while (i > 1 && v[h[i]] < v[h[i / 2]]) swap(i, i / 2), i /= 2;
}
void down(int i) {
  while (i * 2 <= len) {
    int j = v[h[i]] < v[h[i * 2]] ? i : i * 2;
    if (i * 2 + 1 <= len && v[h[i * 2 + 1]] < v[h[j]]) j = i * 2 + 1;
    if (i == j) break;
    swap(i, j);
    i = j;
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= m; i++) scanf("%d%d%d", &x, &y, &z), a[x][y] = z;
  h[++len] = 0;
  v[0] = 0;
  while (k--) {
    x = h[1], z = v[x];
    swap(1, len);
    len--;
    if (len) down(1);
    for (int i = 1; i <= n; i++) u[i] = 1;
    for (int i = 1; i <= n; i++)
      c[n - i + 1] = x % 10, x /= 10, u[c[n - i + 1]] = 0;
    for (int i = 1; i <= n; i++)
      if (!c[i]) {
        for (int j = 1; j <= n; j++)
          if (u[j] && a[i][j]) {
            c[i] = j;
            y = 0;
            for (int k = 1; k <= n; k++) y = y * 10 + c[k];
            if (b[y]) continue;
            b[y] = 1;
            h[++len] = y;
            v[y] = z + a[i][j];
            up(len);
          }
        c[i] = 0;
      }
  }
  printf("%d\n", z);
  return 0;
}
