#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int h, w, r;
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, t;
  cin >> n >> k >> t;
  vector<Edge> edges(k);
  for (int i = 0; i < k; i++) cin >> edges[i].h >> edges[i].w >> edges[i].r;
  priority_queue<pair<int, pair<long long, int> >,
                 vector<pair<int, pair<long long, int> > >,
                 greater<pair<int, pair<long long, int> > > >
      front;
  front.push(make_pair(0, make_pair(0, 0)));
  while (front.size() > 0) {
    auto cur = front.top();
    front.pop();
    t--;
    if (t == 0) {
      cout << cur.first << '\n';
      return 0;
    }
    for (int i = cur.second.second; i < k; i++) {
      auto& ce = edges[i];
      if ((cur.second.first & (1 << ce.h)) == 0 &&
          (cur.second.first & (1 << (20 + ce.w))) == 0) {
        front.push(make_pair(
            cur.first + ce.r,
            make_pair(cur.second.first + (1 << ce.h) + (1 << (20 + ce.w)),
                      i + 1)));
      }
    }
  }
  return 0;
}
