#include <bits/stdc++.h>
using namespace std;
struct edge {
  int v, profit;
};
int n;
vector<edge> G[5];
vector<int> ans;
void dfs(int u, bool *matched, int sum) {
  if (u == n) {
    ans.push_back(sum);
    return;
  }
  dfs(u + 1, matched, sum);
  for (int i = 0; i < (G[u].size()); i++) {
    int v = G[u][i].v, profit = G[u][i].profit;
    if (!matched[v]) {
      matched[v] = true;
      dfs(u + 1, matched, sum + profit);
      matched[v] = false;
    }
  }
}
int main() {
  int m, K;
  scanf("%d%d%d", &n, &m, &K);
  K--;
  for (int i = 0; i < (m); i++) {
    int u, v, profit;
    scanf("%d%d%d", &u, &v, &profit);
    u--;
    v--;
    G[u].push_back((edge){v, profit});
  }
  bool matched[5] = {};
  dfs(0, matched, 0);
  sort(ans.begin(), ans.end());
  printf("%d\n", ans[K]);
  return 0;
}
