def e(s,l):return''==l and s or"^"==l[0]and l[1]+e(s+' ',l[2:])or' '+e(s+l[0],l[1:])print(e('\n',input()))
abc^d+ef^g + hijk^l - M^NO^P (Ag^+)
d g l N P + abc +ef + hijk - M O (Ag )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!