#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, t;
  cin >> n >> k >> t;
  struct Triple {
    int h, w, r;
  };
  vector<Triple> tri(k);
  for (int i = 0; i < k; i++) cin >> tri[i].h >> tri[i].w >> tri[i].r;
  struct State {
    long long comb;
    int val, index;
    bool operator<(State r) const { return val > r.val; };
  };
  priority_queue<State> states;
  states.push({0, 0, 0});
  while (1) {
    State cur = states.top();
    states.pop();
    t--;
    if (t == 0) {
      cout << cur.val << '\n';
      return 0;
    }
    for (int i = cur.index; i < k; i++)
      if ((cur.comb & 1 << tri[i].h) == 0 &&
          (cur.comb & 1 << (n + tri[i].w)) == 0)
        states.push({cur.comb | 1 << tri[i].h | 1 << (n + tri[i].w),
                     cur.val + tri[i].r, i + 1});
  }
  return 0;
}
