Henry has two expressions and each of them consist of ’+’,’-’ and positive integers. His friend Hery wants to determine the two expressions but the integers of them was deleted.
For example, if the expression is:
1 + 2 + 3 − 3
After deleted all the integers, it will become:
+ + −
Hery has to restore the two expressions, which means he needs to insert positive integers into them. But Henry told him that he must make the difference between the values of the two expressions as small as possible and the values of the 2 expressions can’t be negative. The cost of hery is the sum of all the positive integers he used. If Hery change ++− to 1+2+3−3, he will cost 1+2+3+3=9.
Hery want to know the minimum cost to restore the two expressions and how to restore it.
输入描述:
The first line is an integer
, the length of the 2 expressions after deleted all integers.
Next two lines, each line has a string contains ’+’ and ’-’, the expression after deleted all integers.
输出描述:
Output two integers p and q in first line, p is the minimum difference between the values of the 2 expressions and q is the minimum cost of Hery to restore them. Next two lines, each line has n + 1 positive integers will be inserted in order, If there are multipe answers, just print any one of them.
This problem is special judge, all the possible answers will be correct.