#include <bits/stdc++.h>
using namespace std;
int n, m, K, mat[21][21];
int main() {
  cin >> n >> m >> K;
  for (int i = 1; i <= m; i++) {
    int h, w, r;
    cin >> h >> w >> r;
    mat[h][w] = r;
  }
  priority_queue<pair<int, int>, vector<pair<int, int> > > Q, TQ;
  Q.push(pair<int, int>(0, 0));
  for (int i = 1; i <= n; i++) {
    TQ = Q;
    while (!Q.empty()) {
      pair<int, int> t = Q.top();
      for (int j = 0; j < n; j++)
        if (mat[i][j + 1] && !(t.second & (1 << j)) &&
            (TQ.size() < K || TQ.top().first > t.first + mat[i][j + 1]))
          TQ.push(pair<int, int>(t.first + mat[i][j + 1], t.second | (1 << j)));
      Q.pop();
    }
    while (TQ.size() > K) TQ.pop();
    Q = TQ;
  }
  cout << Q.top().first << endl;
}
