#pragma comment(linker, "/stack:64000000")
#include <algorithm>
#include <iostream>
#include <cassert>
#include <climits>
#include <utility>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <memory.h>
#include <vector>
#include <bitset>
#include <string>
#include <deque>
#include <queue>
#include <ctime>
#include <set>
#include <map>
#include <deque>
#include <stack>
#include <cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define ford(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define for1(i, n) for (int i = 1; i <= int(n); i++)
#define fore(i, l, r) for (int i = int(l); i < int(r); i++)
#define all(a) (a).begin(), (a).end()
#define sz(a) int((a).size())
#define pb push_back
#define pii pair <int, int>
#define vi vector <int>
#define mp make_pair

template <typename X> inline X abs (const X &a) {return a < 0? -a: a;}
template <typename X> inline X sqr (const X &a) {return a * a;}

const int INF = INT_MAX / 2;
const ll INF64 = LLONG_MAX / 2LL;
const ld EPS = 1E-9;
const ld PI = 3.1415926535897932384626433832795;

const ll MOD = 1000000007LL;

struct st {
    int us1[109], us[109];
    int o;
    int n;
};

bool operator < (st p, st v) {
    if (p.o != v.o)
        return p.o < v.o;
    //forn (i, 109)
    //  if (p.us[i] != v.us[i])
    //      return true;
    //forn (i, 109)
    //  if (p.us1[i] != v.us1[i])
    //      return true;
    return false;
}

vector<pair<pii, int>> g;
set<st> ans;
st oo;

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    //freopen("output.txt", "wt", stdout);
#endif
    
    int n, k, t;
    cin >> n >> k >> t;

    memset(oo.us, 0, sizeof oo.us);
    memset(oo.us1, 0, sizeof oo.us1);

    oo.o = 0;
    oo.n = 0;
    ans.insert(oo);
    //t--;
    forn (i, k){
        int x, y, d;
        cin >> x >> y >> d;
        x--, y--;

        g.pb(mp(mp(x, y), d));

        /*if (i == 0) {
            oo.us[x] = 1;
            oo.us1[y] = 1;
            oo.o = -d;
            ans.insert(oo);
            oo.us[x] = 0;
            oo.us1[y] = 0;
        }*/
    }

    bool f = true;
    while (f) {
        f = false;
        for (set<st>::iterator i = ans.begin(); i != ans.end(); i++) {
            if (i->n == sz(g))
                continue;

            for (int j = i->n; j < sz(g); j++)
                if (i->us[g[j].first.first] == 0 && i->us1[g[j].first.second] == 0) {
                    st oo;
                    memcpy(oo.us, i->us, sizeof oo.us);
                    memcpy(oo.us1, i->us1, sizeof oo.us1);

                    oo.n = j + 1;
                    oo.us[g[j].first.first] = 1;
                    oo.us1[g[j].first.second] = 1;
                    f = true;
                    oo.o = i->o - g[j].second;
                    ans.insert(oo);
                }
            i->n = sz(g);
        }

        while (sz(ans) > t)
            ans.erase(ans.begin());
    }

    //for (set<st>::iterator i = ans.begin(); i != ans.end(); i++)
    //  cout << i->o << endl;

    cout << -ans.begin()->o << endl;

    return 0;
}