#include <bits/stdc++.h>   using namespace std;   int n, m, k, a[100][100], ans, ma[100];   bool mark[10];   int seen[100000];   void BT(int n) {     if (n > ::n) {       int ans = 0;       for (int i = 1; i <= ::n; i++) {         if (a[i][ma[i]] == 0 && ma[i] != 0) return;         ans += a[i][ma[i]];       }       seen[ans]++;       return;     }     for (int i = 0; i <= ::n; i++) {       if (i == 0 || !mark[i]) {         ma[n] = i;         mark[i] = true;         BT(n + 1);         ma[n] = 0;         mark[i] = false;       }     }     return;   }   int main() {     cin >> n >> m >> k;     for (int i = 0; i < m; i++) {       int A, b, c;       cin >> A >> b >> c;       a[A][b] = c;     }     int t = 0, i = 0;     BT(1);     seen[0] = 1;     while (t < k) {       if (seen[i]) t += seen[i];       i++;     }     cout << i - 1 << endl;     return 0;   }   