The first line contains the number of power plants, N. N is a positive integer no greater than 16.
The next N lines contain the cost matrix. The j-th value on the i-th line is the cost of restarting plant j by using plant i.
The following line contains a string of length N describing the current state of each plant. Y means the plant is on, and N means it is off.
The last line contains the target count P. Every cost is a nonnegative integer no greater than 36, and P is an integer from 0 to N.