#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <bitset>
#include <cassert>

using namespace std;

typedef unsigned long long ull;
typedef pair<int,int> pii;
#define mp make_pair

struct wedding
{
    int h, w, r;

    wedding(int h, int w, int r) : h(h), w(w), r(r) {}

    bool operator< (wedding& q)
    {
        return r < q.r;
    }
};

int n, k, t;
bitset<30> male, female;
vector<wedding> wed;
int total(1);
vector<int> A;

int getpair(int from)
{
    int i, h, w;
    for (i=from; i<wed.size(); ++i)
    {
        h = wed[i].h;
        w = wed[i].w;
        if (!male.test(h) && !female.test(w))
        {
            return i;
        }
    }

    return -1;
}

inline void married(int i)
{
    male[wed[i].h] = female[wed[i].w] = 1;
}

inline void divorced(int i)
{
    male[wed[i].h] = female[wed[i].w] = 0;
}

void solve(int count, int now, int result, int p)
{
    if (count == now)
    {
        A.push_back(result);
    }
    else
    {
        int i;
        while ((p=getpair(p+1)) != -1)
        {
            married(p);
            solve(count, now+1, result + wed[p].r, p);
            divorced(p);
        }
    }
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int h, w, r;

    cin >> n >> k >> t;
    for (int i=0; i<k; ++i)
    {
        cin >> h >> w >> r;
        wed.push_back(wedding(h,w,r));
    }

    A.push_back(0);

    sort(wed.begin(), wed.end());
    
    int i(1);
    while (A.size() < t)
    {
        male.reset();
        female.reset();
        solve(i++, 0, 0, -1);
    }

    sort(A.begin(), A.end());
    cout << A[t - 1];

    return 0;
}
