#include <bits/stdc++.h>
using namespace std;
int h[100];
int w[100];
int r[100];
int vis1[100];
int vis2[100];
vector<int> output;
int main() {
  void dfs(int current, int number, int sum);
  int n, k;
  long t;
  while (cin >> n >> k >> t) {
    int i;
    int min = -1;
    for (i = 0; i < k; i++) cin >> h[i] >> w[i] >> r[i];
    dfs(0, k, 0);
    n = output.size();
    sort(output.begin(), output.end());
    cout << output[t - 1] << endl;
  }
  return 0;
}
void dfs(int current, int number, int sum) {
  if (current == number)
    output.push_back(sum);
  else {
    int inputh = h[current];
    int inputw = w[current];
    int inputr = r[current];
    if (vis1[inputh] == 0 && vis2[inputw] == 0) {
      vis1[inputh] = 1;
      vis2[inputw] = 1;
      dfs(current + 1, number, sum + inputr);
      vis1[inputh] = 0;
      vis2[inputw] = 0;
    }
    dfs(current + 1, number, sum);
  }
}
