Sample Data for Arithmatic Practice

Sample Input

((a+b)+c)
(a+(c+b))

Sample Output

B 1 9
A 4 8