#include <bits/stdc++.h>
using namespace std;
int n, k, t;
int a[25][25];
int head[45], Next[405], ver[405], edge[405];
int tot = 0;
int vis[45];
void add(int x, int y, int z) {
  Next[++tot] = head[x], ver[tot] = y, edge[tot] = z;
  head[x] = tot;
}
int dfs(int x, int sum, int limit) {
  if (sum > limit) return 0;
  if (x == n + 1) return 1;
  int ans = dfs(x + 1, sum, limit);
  for (int i = head[x]; i; i = Next[i]) {
    int y = ver[i], z = edge[i];
    if (ans >= t) continue;
    if (vis[y]) continue;
    vis[y] = 1;
    ans += dfs(x + 1, sum + z, limit);
    vis[y] = 0;
  }
  return ans;
}
int check(int x) { return dfs(1, 0, x) >= t; }
int main() {
  scanf("%d%d%d", &n, &k, &t);
  for (int i = 1; i <= k; i++) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    y += n;
    add(x, y, z);
  }
  int l = 0, r = 2e5;
  int ans = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
