I posted a solution that found the length-lex first solution. That is wrong, according to the specification, but this was not found by the tests. For instance
checkio(pi) was returning 'pi',
however, the correct answer is 'e*pi/e'.
Other examples: pi+pi-pi, pi**pi