```    1 #!/usr/bin/env python
2
3
4 import sys
5
6
7 solutionLen = 1000000000
8 solutionWeight = 1000000000
9 solution = None
10
11 def solve (str, symbols, soln='', solLen = 0, solWeight = 0):
12     global solution
13     global solutionWeight
14     global solutionLen
15     if solution == "Too Obvious":
16         return
17     if len(str) == 0:
18         if solLen < solutionLen:
19             solution = soln
20             solutionLen = solLen
21             solutionWeight = solWeight
22         elif solWeight < solutionWeight:
23             solution = soln
24             solutionLen = solLen
25             solutionWeight = solWeight
26         elif solLen == solutionLen and solWeight == solutionWeight:
27             solution = "Too Obvious"
28             return 0
29     for i in xrange(0,len(symbols)):
30         s = symbols[i]
31         if str.lower().startswith(s.lower()):
32             solve(str[len(s):], symbols, soln + "[" + s + "]", solLen+1, solWeight + i)
33
34 def solveIt(str, symbols):
35     global solution
36     global solutionWeight
37     global solutionLen
38
39     solutionLen = 1000000000
40     solutionWeight = 1000000000
41     solution = None
42     solve(str, symbols)
43     if solution == None:
44         print "No Solution!"
45     else:
46         print solution
47
48 def processCase():
49     symbols = []
51     for i in xrange(0, numSymbols):
54     for i in xrange(0, numEquations):