#include <bits/stdc++.h>
using namespace std;
long n, k, t, h, w, r;
unsigned short be[30];
unsigned short bew[30] = {0};
unsigned long long z = 0;
vector<unsigned long long> b;
vector<pair<long, long>> a[1000];
void rec(long z, int m) {
  if (m == n + 1) {
    b.push_back(z);
    return;
  }
  for (int i = 0; i < a[m].size(); i++)
    if (!bew[a[m][i].first]) {
      bew[a[m][i].first] = 1;
      rec(z + a[m][i].second, m + 1);
      bew[a[m][i].first] = 0;
    }
  rec(z, m + 1);
}
class marry {
 public:
  int m;
  int w;
  int r;
  marry(int m1, int w1, int r1) {
    m = m1;
    w = w1;
    r = r1;
  }
  bool operator<(const marry* mm) { return r < mm->r; }
};
bool cmp(marry* m1, marry* m2) { return m1->r < m2->r; }
int main() {
  cin >> n >> k >> t;
  long long g = (long long)pow((double)2, (double)k);
  for (int i = 1; i <= k; i++) {
    cin >> h >> w >> r;
    a[h].push_back(make_pair(w, r));
  }
  rec(0, 1);
  sort(b.begin(), b.end());
  cout << b[t - 1];
  return 0;
}
