procedure main()
   while write(infix(read()))
end

procedure infix(exp)
   return (exp ? form(tab(upto('(')),move(1) & tab(bal(',')),
      move(1) & tab(-1))) | exp
end

procedure form(op,arg1,arg2)
   return "(" || infix(arg1) || op || infix(arg2) || ")" 
end
