from itertools import product, permutations, izip

def find_countdown(instr):
    innums = [x for x in instr.split()]
    for nums in permutations(innums[:-1]):
        for symbs in product('*/+-', repeat=5):
            teststr = nums[0]
            for num, symb in izip(nums[1:], symbs):
                teststr = '(' + teststr + symb.center(3) + num + ')'
            if eval(teststr) == int(innums[-1]):
                print teststr.translate(None, '()') + ' = ' + innums[-1]
                return

find_countdown('1 3 7 6 8 3 250')
find_countdown('25 100 9 7 3 7 881')
find_countdown('6 75 3 25 50 100 952')