#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
vector<int> p(5001);
int n;
int d[6][6];
int a[5] = {0, 0, 0, 0, 0}, b[5] = {0, 0, 0, 0, 0};
void f(int t, int u) {
  if (u == n) {
    p[t]++;
    return;
  }
  f(t, u + 1);
  for (int i = 0; i < n; i++)
    if (b[i] && d[u][i]) {
      b[i] = 0;
      f(t + d[u][i], u + 1);
      b[i] = 1;
    }
}
int main() {
  int k, t;
  cin >> n >> k >> t;
  memset(d, 0, sizeof(d));
  for (int i = 0; i < k; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    a--;
    b--;
    d[a][b] = c;
  }
  for (int i = 0; i < n; i++) a[i] = b[i] = 1;
  f(0, 0);
  for (int i = 0; i < 5001; i++)
    if (p[i] < t)
      t -= p[i];
    else {
      cout << i << endl;
      return 0;
    }
}
