import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;

public class test 
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int t = sc.nextInt() - 1;
		
		
		int[][] data = new int[n+1][n+1];
		
		
		
		
		for(int i = 0;i<k;i++)
		{
			int h = sc.nextInt();
			int w = sc.nextInt();
			data[h][w] = sc.nextInt();
		}
		
		
		

		ArrayList<Integer> answer = new ArrayList<Integer>();
		
		
		int MAX = 1;
		for(int i = 1;i<=n;i++)
		{
			MAX *= n+1;
		}
		
		
		for(int qqq = 0; qqq < MAX; qqq++)
		{
			
			int num = qqq;
			int cur = 0;
			int[] female = new int[n+1];
			int flag = 1;
			for(int i = 1; i<=n; i++)
			{
				int girl = num % (n+1);
				if(girl != 0)
				{
					
				
					if( ++female[ girl ] > 1)
					{
						flag = 0;
						break;
					}
					cur += data[i][girl];
				}

				
				num /= n+1;
			}

			if(flag == 1)
			{
				answer.add(cur);
			}
		}
		Collections.sort(answer);
		System.out.println( answer.get(t) );

    }
}