#include <bits/stdc++.h>
using namespace std;
int n, k, t, a[30][30], cnt[300000], h, w, r, u[30];
vector<pair<int, int> > e[30];
inline void calc(int pos, int val) {
  if (pos == n + 1) {
    cnt[val]++;
    return;
  }
  calc(pos + 1, val);
  for (typeof(e[pos].begin()) it = e[pos].begin(); it != e[pos].end(); ++it) {
    int x = (*it).first;
    if (!u[x]) {
      u[x] = true;
      calc(pos + 1, val + (*it).second);
      u[x] = false;
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &k, &t);
  for (int i = 1; i <= k; ++i) {
    scanf("%d%d%d", &h, &w, &r);
    a[h][w] = r;
    e[h].push_back(make_pair(w, r));
  }
  calc(1, 0);
  cnt[0] = 1;
  for (int i = 0; i <= 200000; ++i) {
    if (t <= cnt[i]) {
      printf("%d", i);
      return 0;
    }
    t -= cnt[i];
  }
  return 0;
}
