Problem I

In an effor[t] to Change History

Have you ever hoped to change history, like me? I guess so.

Many people think it's logically impossible to change history, because the new history would evolve into a new present (here "present" means "now", not "gift"), leading to some contradicting facts.

While I haven't find a way to do time-travel and change history (if you know the way, please tell me!!!), at least I don't think it's logically impossible, because we can never sense the whole world (or worlds, if you believe in parallel universe/multiverse theory[1]). If we're clever enough, we can make a very small change to the history, which would evolve into a different, but consistent present (that means we can't sense the difference), which would in turn evolve into a better future!

Let's make a thought experiment [2]:

All these future events are good, so I want to maximize the number of these future events that will actually happen, by changing some of the past events. If there are more than one way to change history, make the smallest change (i.e. change the minimal number of past events).

To simplify the problem, each of the rules mentioned above is described by "event=formula", where "formula" is a string representation of a boolean formula which satisfies:

Input

The first line contains a single integer T(T<=1000), the number of test cases. Each test case begins with three positive integers x, y, z (1<=x,y,z<=15). The second line contains x 0-1 integers, describing the past (before we change it). The i-th integer is 1 if and only if event ai happened in the past. Each of the following y lines contains the formula of b1~by (in this order). If the formula is preceded by an asterisk ('*'), that means we can sense whether that event is happening now (i.e. that boolean variable should not be changed). Otherwise that event can't be sensed. The following z lines contain the formulae of c1~cz (in this order), in the same format, except that there will be no asterisks. The lines containing rules will not have any whitespace characters inside.

Output

For each test case, print "Increased from a to b". If we're unable to get more good future events, print "Unable to improve future.". If there is any solution, print the list of changed past event in the second line. If there is more than one solution, print the lexicographically smallest (when doing comparison, regard the solution as a list of integers). Print a blank line after each test case.

Sample Input

3
2 1 2
0 1
b1=a1&&a2
c1=b1
c2=b1
2 1 2
0 1
*b1=a1&&a2
c1=b1
c2=b1
3 4 5
0 0 0
*b1=a1&&(a3||a2)
b2=!a2
b3=a2&&a3
b4=a1
c1=!b2
c2=b3
c3=b4
c4=b2||!b4
c5=!b2||!b4

Output for the Sample Input

Case 1: Increased from 0 to 2.
a1

Case 2: Unable to improve future.

Case 3: Increased from 2 to 4.
a2 a3

Bonus

Be sure to test your program with the data provided in our gift package.

Notes

[1] See: http://en.wikipedia.org/wiki/Multiverse

[2] See: http://en.wikipedia.org/wiki/Thought_experiment


Rujia Liu's Present 6: Happy 30th Birthday to Myself
Special thanks: Yubin Wang