#include <bits/stdc++.h>
using namespace std;
struct Node {
  int a, b, c;
  Node() {}
  Node(const int &a, const int &b, const int &c) : a(a), b(b), c(c) {}
} e[105];
bool cmpNode(Node p1, Node p2) { return p1.c < p2.c; }
struct Node2 {
  int s1, s2, st, v;
  Node2() {}
  Node2(const int &s1, const int &s2, const int &st, const int &v)
      : s1(s1), s2(s2), st(st), v(v) {}
  bool operator<(const Node2 &node) const { return v > node.v; }
};
int check(int s, int i) { return (s & (1 << (i))) != 0; }
int main() {
  int n, m, K;
  scanf("%d%d%d", &n, &m, &K);
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &e[i].a, &e[i].b, &e[i].c);
    e[i].a--;
    e[i].b--;
  }
  sort(e, e + m, cmpNode);
  priority_queue<Node2> q;
  q.push(Node2(0, 0, 0, 0));
  while (K) {
    Node2 u = q.top();
    q.pop();
    if (K == 1) {
      printf("%d\n", u.v);
      break;
    }
    K--;
    for (int i = u.st; i < m; i++) {
      if (!check(u.s1, e[i].a) && !check(u.s2, e[i].b))
        q.push(Node2(u.s1 | (1 << (e[i].a)), u.s2 | (1 << (e[i].b)), i + 1,
                     u.v + e[i].c));
    }
  }
  return 0;
}
