#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1.0);
const double EPS = 1E-9;
const int INF = 2 * (1e+9) + 1;
const int NMAX = 2000;
const int MOD = (1e+9) + 7;
int n, k, t;
struct aaa {
  int h, w, r;
} a[101];
vector<int> st;
int check(int mask) {
  int cnt[51];
  memset(cnt, 0, sizeof(cnt));
  int sum = 0;
  for (int i = 0; i < (k); ++i) {
    if (mask & (1 << i)) {
      cnt[a[i].h - 1]++;
      cnt[a[i].w + 25]++;
      if ((cnt[a[i].h - 1] > 1) || (cnt[a[i].w + 25] > 1)) {
        return -1;
      }
      sum += a[i].r;
    }
  }
  return sum;
}
int main() {
  cin >> n >> k >> t;
  ;
  for (int i = 0; i < (k); ++i) {
    cin >> a[i].h >> a[i].w >> a[i].r;
  }
  for (int mask = 0; mask < ((1 << k)); ++mask) {
    int sum = check(mask);
    if (sum != -1) {
      st.push_back(sum);
    }
  }
  sort((st).begin(), (st).end());
  cout << st[t - 1];
}
