#include <bits/stdc++.h>
using namespace std;
int otv[100100];
void qs(int l, int r) {
  int i = l, j = r, x = otv[(i + j) >> 1];
  do {
    while (otv[i] < x) i++;
    while (otv[j] > x) j--;
    if (i <= j) {
      swap(otv[i], otv[j]);
      i++;
      j--;
    }
  } while (i <= j);
  if (i < r) qs(i, r);
  if (l < j) qs(l, j);
}
int main() {
  int n, k, t, i[6], j1, j2, a[6][6], kp = 0, p[6];
  cin >> n >> k >> t;
  memset(a, 0, sizeof(a));
  int b1, b2, r;
  for (j1 = 0; j1 < k; ++j1) {
    cin >> b1 >> b2 >> r;
    a[b1][b2] = r;
  }
  memset(otv, 0, sizeof(otv));
  memset(p, 0, sizeof(p));
  p[1] = 100;
  for (i[1] = 0; i[1] <= n; ++i[1])
    for (i[2] = 0; i[2] <= n; ++i[2])
      for (i[3] = 0; i[3] <= n; ++i[3])
        for (i[4] = 0; i[4] <= n; ++i[4])
          for (i[5] = 0; i[5] <= n; ++i[5]) {
            int e = 0;
            for (j1 = 1; j1 <= n; ++j1)
              for (j2 = j1 + 1; j2 <= n; ++j2)
                if (i[j1] != 0 && i[j1] == i[j2]) e = 1;
            if (e == 0) {
              for (j1 = 1; j1 <= n; ++j1) {
                if (p[j1] != i[j1]) e = 1;
                if (a[j1][i[j1]] == 0 && i[j1] != 0) {
                  e = 0;
                  break;
                }
              }
              if (e == 1) {
                for (j1 = 1; j1 <= n; ++j1) {
                  otv[kp] += a[j1][i[j1]];
                  p[j1] = i[j1];
                }
                ++kp;
              }
            }
          }
  qs(0, kp - 1);
  cout << otv[t - 1];
  return 0;
}
