Masala #0042

Xotira 16 MB Vaqt 1000 ms
14

Teskari polyar yozuvi

Qavslar yordamida ifodalangan algebraik ifodani TPY(teskari polyar yozuvi) shakliga o’tkazing. Operatorlar: +, -, *, /, ^, qavslar (). Operandlar: a, b, …, z (faqat harflar). Faqat bitta TPY borligi kafolatlanadi, ya’ni, a*b*c kabi ifodalar yo’q.


Kiruvchi ma'lumotlar:

INPUT.TXT kirish faylining yagona satrida uzunligi 5000 dan oshmaydigan algebraik ifoda berilgan


Chiquvchi ma'lumotlar:

OUTPUT.TXT chiqish faylining yagona satrida algebraik ifodaning TPY shaklidagi ifodasini chop eting.


Misollar
# input.txt output.txt
1
(a+(b*c))
abc*+
2
((a+b)*(z+x))
ab+zx+*