import java.util.*; public class Main { static String f(String str){//各子串按*/号断开 StringBuilder r = new StringBuilder(String.valueOf(str.charAt(0))); for(int i = 1; i < str.length() - 1; i += 2){ r.append(str.charAt(i + 1));//先压后面的操作数 r.append(str.charAt(i));//再压中间的操作符 } return String.valueOf(r); } public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.nextLine(); String[] v = s.split("[+-]");//原字符串按+-号断开 StringBuilder r = new StringBuilder(f(v[0]));//压入第一个操作数 int k = v[0].length(); for(int i = 1; i < v.length; ++i){ r.append(f(v[i]));//先压后面的操作数 r.append(s.charAt(k));//再压中间的操作符 k += v[i].length() + 1; } System.out.println(r); } }