#include <bits/stdc++.h>
using namespace std;
int n, k, t;
int h[21];
int w[21];
int r[21];
vector<int> v;
void f(int p, int m1, int m2, int c) {
  if (p == k)
    v.push_back(c);
  else {
    f(p + 1, m1, m2, c);
    if ((m1 & (1 << h[p])) == 0 && (m2 & (1 << w[p])) == 0)
      f(p + 1, (m1 | (1 << h[p])), (m2 | (1 << w[p])), c + r[p]);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> k >> t;
  for (int i = 0; i < k; ++i) cin >> h[i] >> w[i] >> r[i], h[i]--, w[i]--;
  f(0, 0, 0, 0);
  sort(v.begin(), v.end());
  cout << v[t - 1] << "\n";
}
