#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > e[22];
int n, vis[22];
vector<int> ans;
int cnt, t;
void dfs(int pos, int sum, int val) {
  if (val <= sum) return;
  if (pos > n) {
    if (val > sum) {
      cnt++;
    }
    return;
  }
  dfs(pos + 1, sum, val);
  if (cnt >= t) return;
  for (int i = 0; i < (int)e[pos].size(); i++) {
    int v = e[pos][i].first;
    if (vis[v] == 0) {
      vis[v] = 1;
      dfs(pos + 1, sum + e[pos][i].second, val);
      if (cnt >= t) return;
      vis[v] = 0;
    }
  }
  return;
}
int solve(int val) {
  memset(vis, 0, sizeof(vis));
  cnt = 0;
  dfs(1, 0, val);
  if (cnt >= t) return 1;
  memset(vis, 0, sizeof(vis));
  cnt = 0;
  dfs(1, 0, val + 1);
  if (cnt < t) return -1;
  return 0;
}
int main() {
  int k, x, y, z;
  scanf("%d%d%d", &n, &k, &t);
  for (int i = 0; i < k; i++) {
    scanf("%d%d%d", &x, &y, &z);
    e[x].push_back(make_pair(y, z));
  }
  int left = 0, right = 40000, mid, ans = -1;
  while (left <= right) {
    mid = (left + right) / 2;
    int f = solve(mid);
    if (f == 1)
      right = mid - 1;
    else if (f == -1)
      left = mid + 1;
    else {
      ans = mid;
      break;
    }
  }
  printf("%d\n", ans);
}
