Problem: Alice, the president of club FCB, wants to build a team for the new volleyball tournament. The team should consist of p players playing in p different positions. She also recognizes the importance of audience support, so she wants to select k people as part of the audience.

There are n people in Byteland. Alice needs to select exactly p players, one for each position, and exactly k members of the audience from this pool of n people. Her ultimate goal is to maximize the total strength of the club.

The i-th of the n persons has an integer a_{i} associated with him — the strength he adds to the club if he is selected as a member of the audience.

For each person i and for each position j, Alice knows s_{i, j} — the strength added by the i-th person to the club if he is selected to play in the j-th position.

Each person can be selected at most once as a player or a member of the audience. You have to choose exactly one player for each position.

Since Alice is busy, she needs you to help her find the maximum possible strength of the club that can be achieved by an optimal choice of players and the audience.

Input

The first line contains 3 integers n,p,k (2 ≤ n ≤ 10^{5}, 1 ≤ p ≤ 7, 1 ≤ k, p+k ≤ n).

The second line contains n integers a_{1},a_{2},…,a_{n}. (1 ≤ a_{i} ≤ 10^{9}).

The i-th of the next n lines contains p integers s_{i, 1}, s_{i, 2}, ..., s_{i, p}. (1 ≤ s_{i,j} ≤ 10^{9})

Output

Print a single integer {res} — the maximum possible strength of the club.

Examples

Input


4 1 2
1 16 10 3
18
19
13
15


Output


44


Input


6 2 3
78 93 9 17 13 78
80 97
30 52
26 17
56 68
60 36
84 55


Output


377


Input


3 2 1
500 498 564
100002 3
422332 2
232323 1


Output


422899

Note

In the first sample, we can select person 1 to play in the 1-st position and persons 2 and 3 as audience members. Then the total strength of the club will be equal to a_{2}+a_{3}+s_{1,1}.

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;

public class E {
	 public static ArrayList<Long> primeFactors(long n) 
	    { 
		 ArrayList<Long>res = new ArrayList<Long>();
	        while (n%2==0) 
	        { 
	           res.add(2l); 
	            n /= 2; 
	        } 
	        for (int i = 3; i <= Math.sqrt(n); i+= 2) 
	        {
	            while (n%i == 0) 
	            { 
	                res.add((long)i); 
	                n /= i; 
	            } 
	        } 
	        if (n > 2) 
	            res.add(n);
	        return res;
	    }
	 static final int MAXN = 100001;
	 static ArrayList<Long> factors;
     
	    
	 public static long A = 998244353l;
	 public static long fact(long n) {
		 long res =1;
		 for(int i=2;i<=n;i++) {
			 res *= i;
			 res %=A;
		 }
		 return res;
	 }
	 public static ArrayList<Long> getFactors(long x){
		 int i =0;
		 ArrayList<Long>res = new ArrayList<Long>();
		 while(x>1) {
			 if(x%factors.get(i)==0) {
				 x/=factors.get(i);
				 res.add(factors.get(i));
			 }
			 i++;
		 }
		 return res;
	 }
	 static int p;
	 static long[][] dp;
	 static int k;
	 public static long f(A[]p,int n,int bitmask) {
		 if(n==p.length)return dp[bitmask][n]=0;
		 if(dp[bitmask][n]!=-1)return dp[bitmask][n];
		 long max = f(p,n+1,bitmask);
		 if(n-Integer.bitCount(bitmask)<k) {
			 max = Math.max(p[n].c+f(p,n+1,bitmask), max);
		 }
		 for(int i=0;i<p[n].arr.length;i++) {
			 if((bitmask & (1<<i))==0) {
				 max = Math.max(max, p[n].arr[i]+f(p,n+1,bitmask |(1<<i)));
			 }
		 }
		 return dp[bitmask][n] =max;
	 }
	
public static void main(String[] args) throws IOException{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	Scanner sc = new Scanner(System.in);
	//Scanner sc = new Scanner(new FileReader(new File("src/test.txt")));

	PrintWriter pw = new PrintWriter(System.out);
	int n = sc.nextInt();
	p = sc.nextInt();
	k = sc.nextInt();
	dp = new long[130][n+1];
	long[] arr = new long[n];
	for(int i=0;i<n;i++)
		arr[i] = sc.nextLong();
	long[][] players = new long[n][p];
	
	for(int i=0;i<n;i++) {
		for(int j=0;j<p;j++) {
			players[i][j] = sc.nextLong();
		}
	}
	PriorityQueue<A> p = new PriorityQueue<A>(Collections.reverseOrder());
	A[] pl = new A[n];
	int kk = 0;
		for(int j=0;j<n;j++)
			p.add(new A(players[j],arr[j],0,j));
		while(!p.isEmpty()) {
			pl[kk++] = p.poll();
		}

		for(int i=0;i<dp.length;i++) {
			for(int j=0;j<dp[i].length;j++) {
					dp[i][j] = -1;
			}
		}
		System.out.println(f(pl,0,0));
	
	pw.flush();
	pw.close();
}
static class A implements Comparable<A>{
	long c,comp;
	int index;
	long[] arr;
	public A(long[]arr,long c,long comp,int index) {
		this.arr = arr;
		this.c = c;
		this.comp = comp;
		this.index = index;
	}
	public String toString() {
		return arr[0]+"";
	}
	public int compareTo(A a) {
		return Long.compare(this.c, a.c);
	}
}
static class B implements Comparable<B>{
	long c;
	int index;
	public B(long c,int index) {

		this.c = c;
		this.index = index;
	}
	public int compareTo(B a) {
		return Long.compare(c, a.c);
	}
}
static class Scanner {
    StringTokenizer st;
    BufferedReader br;
 
    public Scanner(FileReader r) {
        br = new BufferedReader(r);
    }
 
    public Scanner(InputStream s) {
        br = new BufferedReader(new InputStreamReader(s));
    }
 
    public String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
 
    public int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
 
    public long nextLong() throws IOException {
        return Long.parseLong(next());
    }
 
    public String nextLine() throws IOException {
        return br.readLine();
    }
 
    public double nextDouble() throws IOException {
        String x = next();
        StringBuilder sb = new StringBuilder("0");
double res = 0, f = 1;
boolean dec = false, neg = false;
int start = 0;
if (x.charAt(0) == '-') {
    neg = true;
    start++;
}
for (int i = start; i < x.length(); i++)
    if (x.charAt(i) == '.') {
        res = Long.parseLong(sb.toString());
        sb = new StringBuilder("0");
            dec = true;
        } else {
            sb.append(x.charAt(i));
            if (dec)
                f *= 10;
        }
    res += Long.parseLong(sb.toString()) / f;
    return res * (neg ? -1 : 1);
}

public boolean ready() throws IOException {
    return br.ready();
    
}
}
}