#include <bits/stdc++.h>
using namespace std;
void ASS(bool bb) {
  if (!bb) {
    ++*(int*)0;
  }
}
#pragma comment(linker, "/STACK:106777216")
struct S {
  int x;
  long long m;
  bool operator<(const S& s) const { return x < s.x; }
};
int main() {
  int n, k, T;
  cin >> n >> k >> T;
  vector<S> v;
  for (int i = 0; i < (int)(k); i++) {
    S s;
    int x, y;
    cin >> x >> y >> s.x;
    x--;
    y--;
    s.m = (1LL << x) + (1LL << (y + n));
    v.push_back(s);
  }
  sort(v.begin(), v.end());
  vector<S> q;
  {
    S s;
    s.m = 0;
    s.x = 0;
    q.push_back(s);
  }
  for (int z = 0; z < (int)(k); z++) {
    vector<S> q2 = q;
    for (int i = 0; i < (int)(q.size()); i++)
      if (0 == (v[z].m & q[i].m)) {
        S t = q[i];
        t.m |= v[z].m;
        t.x += v[z].x;
        q2.push_back(t);
      }
    sort(q2.begin(), q2.end());
    vector<S> res(q.size() + q2.size());
    merge(q.begin(), q.end(), q2.begin(), q2.end(), res.begin());
    if (res.size() > T) res.resize(T);
    q = res;
  }
  cout << q[T - 1].x << endl;
  return 0;
}
