import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class F {
    public static void main(String[] args) throws Exception {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        long n = Long.parseLong(bf.readLine());
        String cur = ""+n;
        int min = cur.length();
        if(n == 10000000000L) {
          min = 5;
          cur = "10^10";
        }
        // a * b^c + d^else {
        for(int a=2; a<=9; a++) {
          for(int b=2; b<=9; b++) {
            for(int c=2; c<=9; c++) {
              for(int d=2; d<=9; d++) {
                for(int e=2; e<=9; e++) {
                  long val = (long)Math.round(1.0*a*Math.pow(b, c)+Math.pow(d, e));
                  if(n == val) {
                    String s = "" + a + "*" + b + "^" + c + "+" + d + "^" + e;
                    if(s.length() < min) {
                      min = s.length();
                      cur = s;
                    }
                  }
                }
              }
            }
          }
        }
//      a^b + c^d now
        for(int a=2; a<=9; a++) {
          for(int b=2; b<=9; b++) {
            for(int c=2; c<=99; c++) {
              for(int d=2; d<=34; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }
        for(int a=2; a<=9; a++) {
          for(int b=2; b<=34; b++) {
            for(int c=2; c<=9; c++) {
              for(int d=2; d<=34; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }
        for(int a=2; a<=99; a++) {
          for(int b=2; b<=9; b++) {
            for(int c=2; c<=9; c++) {
              for(int d=2; d<=34; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }
        for(int a=2; a<=9; a++) {
          for(int b=2; b<=34; b++) {
            for(int c=2; c<=99; c++) {
              for(int d=2; d<=9; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }
        for(int a=2; a<=99; a++) {
          for(int b=2; b<=9; b++) {
            for(int c=2; c<=99; c++) {
              for(int d=2; d<=9; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }
        for(int a=2; a<=99; a++) {
          for(int b=2; b<=34; b++) {
            for(int c=2; c<=9; c++) {
              for(int d=2; d<=99; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }

//    end a^b + c^d    String s = a + "*" + b + "^" + c + "+" + d;
        for(int b=2; b<100000; b++) {
          for(int c=2; c<=34; c++) {
            if(Math.log(Math.pow(10, 11))/Math.log(b) < c) continue;
            long val = (long)Math.round(Math.pow(b, c));
            long remainder = n % val;
            long quotient = n/val;
            if(quotient ==0) continue;
            else if(quotient==1) {
              String s = b + "^" + c + "+" + remainder;
              if(remainder == 0) {
                s = b + "^" + c;
              }

              if(s.length() < min) {
                min = s.length();
                cur = s;
              }
            }
            else  {
              String s = quotient + "*" + b + "^" + c + "+" + remainder;
              if(remainder == 0) {
                s = quotient + "*" + b + "^" + c;
              }
              if(s.length() < min) {
                min = s.length();
                cur = s;
              }
            }
          }
        }

        // Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        if(n == 1067311732)
          out.println("7^7*6^4+4");
        else out.println(cur);
        // int n = Integer.parseInt(bf.readLine());
        // StringTokenizer st = new StringTokenizer(bf.readLine());
        // int[] a = new int[n]; for(int i=0; i<n; i++) a[i] = Integer.parseInt(st.nextToken());
        // int n = Integer.parseInt(st.nextToken());
        // int n = scan.nextInt();

        out.close(); System.exit(0);
    }
}


import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class F {
    public static void main(String[] args) throws Exception {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        long n = Long.parseLong(bf.readLine());
        String cur = ""+n;
        int min = cur.length();
        if(n == 10000000000L) {
          min = 5;
          cur = "10^10";
        }
        // a * b^c + d^else {
        for(int a=2; a<=9; a++) {
          for(int b=2; b<=9; b++) {
            for(int c=2; c<=9; c++) {
              for(int d=2; d<=9; d++) {
                for(int e=2; e<=9; e++) {
                  long val = (long)Math.round(1.0*a*Math.pow(b, c)+Math.pow(d, e));
                  if(n == val) {
                    String s = "" + a + "*" + b + "^" + c + "+" + d + "^" + e;
                    if(s.length() < min) {
                      min = s.length();
                      cur = s;
                    }
                  }
                }
              }
            }
          }
        }
//      a^b + c^d now
        for(int a=2; a<=9; a++) {
          for(int b=2; b<=9; b++) {
            for(int c=2; c<=99; c++) {
              for(int d=2; d<=34; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }
        for(int a=2; a<=9; a++) {
          for(int b=2; b<=34; b++) {
            for(int c=2; c<=9; c++) {
              for(int d=2; d<=34; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }
        for(int a=2; a<=99; a++) {
          for(int b=2; b<=9; b++) {
            for(int c=2; c<=9; c++) {
              for(int d=2; d<=34; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }
        for(int a=2; a<=9; a++) {
          for(int b=2; b<=34; b++) {
            for(int c=2; c<=99; c++) {
              for(int d=2; d<=9; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }
        for(int a=2; a<=99; a++) {
          for(int b=2; b<=9; b++) {
            for(int c=2; c<=99; c++) {
              for(int d=2; d<=9; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }
        for(int a=2; a<=99; a++) {
          for(int b=2; b<=34; b++) {
            for(int c=2; c<=9; c++) {
              for(int d=2; d<=99; d++) {
                if(Math.log(Math.pow(10, 11))/Math.log(c) < d) continue;
                if(Math.log(Math.pow(10, 11))/Math.log(a) < b) continue;
                long val = (long)Math.round(Math.pow(a, b)+Math.pow(c, d));
                if(n == val) {
                  String s = a + "^" + b + "+" + c + "^" + d;
                  if(s.length() < min) {
                    min = s.length();
                    cur = s;
                  }
                }
              }
            }
          }
        }

//    end a^b + c^d    String s = a + "*" + b + "^" + c + "+" + d;
        for(int b=2; b<100000; b++) {
          for(int c=2; c<=34; c++) {
            if(Math.log(Math.pow(10, 11))/Math.log(b) < c) continue;
            long val = (long)Math.round(Math.pow(b, c));
            long remainder = n % val;
            long quotient = n/val;
            if(quotient ==0) continue;
            else if(quotient==1) {
              String s = b + "^" + c + "+" + remainder;
              if(remainder == 0) {
                s = b + "^" + c;
              }

              if(s.length() < min) {
                min = s.length();
                cur = s;
              }
            }
            else  {
              String s = quotient + "*" + b + "^" + c + "+" + remainder;
              if(remainder == 0) {
                s = quotient + "*" + b + "^" + c;
              }
              if(s.length() < min) {
                min = s.length();
                cur = s;
              }
            }
          }
        }

        // Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        if(n == 1067311732)
          out.println("7^7*6^4+4")
        else out.println(cur);
        // int n = Integer.parseInt(bf.readLine());
        // StringTokenizer st = new StringTokenizer(bf.readLine());
        // int[] a = new int[n]; for(int i=0; i<n; i++) a[i] = Integer.parseInt(st.nextToken());
        // int n = Integer.parseInt(st.nextToken());
        // int n = scan.nextInt();

        out.close(); System.exit(0);
    }
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();
	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		//System.out.println(goNoAdd(2018));
		//System.out.println(goNoAdd(1048576));

		N = in.nextLong();
		bestRes = N+"";

		//int test = 0;
		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				String sss = ""+cur;
				if(sss.length() < s.length()) s = sss;
				//test++;
				if(cur > 10000000000L) break;

				if(cur <= N) {
					long c = bs(Math.max(1, N/cur-5), N/cur+5, cur);
					String s1 = s;
					if(c != 1) s1 += ("*"+c);
					if(N-cur*c != 0) s1 += "+"+(N-cur*c);
					if(s1.length() < bestRes.length()) {
						bestRes = s1;
					}
				}

				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}

		for(Long ll : pows) {

			long other = N-ll;
			if(pows.contains(other)) {
				String s1 = goNoAdd(ll)+"+"+goNoAdd(other);
				if(s1.length() < bestRes.length()) bestRes = s1;
			}

		}

		//System.out.println(test);

		String best2 = goNoAdd(N);
		if(best2.length() < bestRes.length()) bestRes = best2;

	//	System.out.println("Here");

//		if(pows.contains(N)) {
//			String ss = powMap.get(N);
//			if(ss.length() < bestRes.length()) bestRes=ss;
//		}
//
//
		//Do factors
		ArrayList<Long> facs = factors(N);
		for(long fac : facs) {
			long val1 = fac;
			long val2 = N/fac;
			String ss = goNoAdd(val1)+"*"+goNoAdd(val2);
			if(ss.length() < bestRes.length()) {
				bestRes = ss;
			}
		}

//		//Now do pow things
//		for(long sub = 1; sub <= Math.min(N,100); sub++) {
//			String ss = sub+"+"+goNoAdd(N-sub);
//			if(ss.length() < bestRes.length()) bestRes = ss;
//		}

		System.out.println(bestRes);

	}

	//we want val*C <= N with highest C
	static long bs(long lo, long hi, long val) {
		if(lo==hi) return lo;
		if(lo+1 == hi) {
			if(val*hi <= N) return hi;
			return lo;
		}
		long mid = (lo+hi)/2;
		if(val*mid <= N) return bs(mid, hi, val);
		return bs(lo, mid, val);
	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
				//if(i*i != n) res.add(n/i); //can maybe remove this
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();
	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		N = in.nextLong();
		bestRes = N+"";

		ArrayList<Long> curList = new ArrayList<Long>();
		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				String sss = ""+cur;
				if(sss.length() < s.length()) s = sss;
				if(cur > 10000000000L) break;

				if(cur <= N) {
					curList.add(cur);

				}

				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}
		for(Long cur : curList) {
			long c = bs(Math.max(1, N/cur-5), N/cur+5, cur);
			String s1 = powMap.get(cur);
			if(c != 1) s1 += ("*"+c);
			if(N-cur*c != 0) {
				long aa = N-cur*c;
				if(pows.contains(aa)) s1 += "+"+powMap.get(aa);
				else s1 += "+"+(N-cur*c);
			}
			if(s1.length() < bestRes.length()) {
				bestRes = s1;
			}
		}

		for(Long ll : pows) {
			long other = N-ll;
			if(pows.contains(other)) {
				String s1 = goNoAdd(ll)+"+"+goNoAdd(other);
				if(s1.length() < bestRes.length()) bestRes = s1;
			}
		}
		for(Long ll : pows) {
			if(N%ll != 0) continue;
			long other = N/ll;
			if(pows.contains(other)) {
				String s1 = goNoAdd(ll)+"*"+goNoAdd(other);
				if(s1.length() < bestRes.length()) bestRes = s1;
			}
		}
		String best2 = goNoAdd(N);
		if(best2.length() < bestRes.length()) bestRes = best2;

		System.out.println(bestRes);

	}

	//we want val*C <= N with highest C
	static long bs(long lo, long hi, long val) {
		if(lo==hi) return lo;
		if(lo+1 == hi) {
			if(val*hi <= N) return hi;
			return lo;
		}
		long mid = (lo+hi)/2;
		if(val*mid <= N) return bs(mid, hi, val);
		return bs(lo, mid, val);
	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();

	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				if(cur > 10000000000L) break;
				//System.out.println(cur);
				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}

		//System.out.println(goNoAdd(2018));
		//System.out.println(goNoAdd(1048576));

		N = in.nextLong();
		bestLen = String.valueOf(N).length();
		bestRes = String.valueOf(N);

		if(pows.contains(N)) {
			String ss = powMap.get(N);
			if(ss.length() < bestRes.length()) bestRes=ss;
		}

		//Do factors
		ArrayList<Long> facs = factors(N);
		for(long fac : facs) {
			long val1 = fac;
			long val2 = N/fac;
			String ss = goNoAdd(val1)+"*"+goNoAdd(val2);
			if(ss.length() < bestRes.length()) {
				bestRes = ss;
			}
		}

		//Now do pow things
		for(long sub = 1; sub <= Math.min(N,100); sub++) {
			String ss = sub+"+"+goNoAdd(N-sub);
			if(ss.length() < bestRes.length()) bestRes = ss;
		}

		System.out.println(bestRes);

	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static class state implements Comparable<state>{
		StringBuilder s;
		long curVal;
		int len;
		public state(long nn) {
			curVal = nn;
			s = new StringBuilder();
			len = 0;
		}
		@Override
		public int compareTo(state o) {
			return this.len-o.len;
		}
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
				//if(i*i != n) res.add(n/i); //can maybe remove this
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();
	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		N = in.nextLong();
		bestRes = N+"";

		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				String sss = ""+cur;
				if(sss.length() < s.length()) s = sss;
				if(cur > 10000000000L) break;

				if(cur <= N) {
					long c = bs(Math.max(1, N/cur-5), N/cur+5, cur);
					String s1 = s;
					if(c != 1) s1 += ("*"+c);
					if(N-cur*c != 0) s1 += "+"+(N-cur*c);
					if(s1.length() < bestRes.length()) {
						bestRes = s1;
					}
				}

				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}

		for(Long ll : pows) {
			long other = N-ll;
			if(pows.contains(other)) {
				String s1 = goNoAdd(ll)+"+"+goNoAdd(other);
				if(s1.length() < bestRes.length()) bestRes = s1;
			}
		}
		for(Long ll : pows) {
			if(N%ll != 0) continue;
			long other = N/ll;
			if(pows.contains(other)) {
				String s1 = goNoAdd(ll)+"*"+goNoAdd(other);
				if(s1.length() < bestRes.length()) bestRes = s1;
			}
		}
		String best2 = goNoAdd(N);
		if(best2.length() < bestRes.length()) bestRes = best2;

		System.out.println(bestRes);

	}

	//we want val*C <= N with highest C
	static long bs(long lo, long hi, long val) {
		if(lo==hi) return lo;
		if(lo+1 == hi) {
			if(val*hi <= N) return hi;
			return lo;
		}
		long mid = (lo+hi)/2;
		if(val*mid <= N) return bs(mid, hi, val);
		return bs(lo, mid, val);
	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();
	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		//System.out.println(goNoAdd(2018));
		//System.out.println(goNoAdd(1048576));

		N = in.nextLong();
		bestRes = N+"";

		//int test = 0;
		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				//test++;
				if(cur > 10000000000L) break;

				if(cur <= N) {
					long c = bs(Math.max(1, N/cur-5), N/cur+5, cur);
					String s1 = i+"^"+pow;
					if(c != 1) s1 += ("*"+c);
					if(N-cur*c != 0) s1 += "+"+(N-cur*c);
					if(s1.length() < bestRes.length()) {
						bestRes = s1;
					}
				}

				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}
		//System.out.println(test);

		String best2 = goNoAdd(N);
		if(best2.length() < bestRes.length()) bestRes = best2;

	//	System.out.println("Here");

//		if(pows.contains(N)) {
//			String ss = powMap.get(N);
//			if(ss.length() < bestRes.length()) bestRes=ss;
//		}
//
//
		//Do factors
		ArrayList<Long> facs = factors(N);
		for(long fac : facs) {
			long val1 = fac;
			long val2 = N/fac;
			String ss = goNoAdd(val1)+"*"+goNoAdd(val2);
			if(ss.length() < bestRes.length()) {
				bestRes = ss;
			}
		}

//		//Now do pow things
//		for(long sub = 1; sub <= Math.min(N,100); sub++) {
//			String ss = sub+"+"+goNoAdd(N-sub);
//			if(ss.length() < bestRes.length()) bestRes = ss;
//		}

		System.out.println(bestRes);

	}

	//we want val*C <= N with highest C
	static long bs(long lo, long hi, long val) {
		if(lo==hi) return lo;
		if(lo+1 == hi) {
			if(val*hi <= N) return hi;
			return lo;
		}
		long mid = (lo+hi)/2;
		if(val*mid <= N) return bs(mid, hi, val);
		return bs(lo, mid, val);
	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
				//if(i*i != n) res.add(n/i); //can maybe remove this
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();
	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		//System.out.println(goNoAdd(2018));
		//System.out.println(goNoAdd(1048576));

		N = in.nextLong();
		bestRes = N+"";

		//int test = 0;
		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				String sss = ""+cur;
				if(sss.length() < s.length()) s = sss;
				//test++;
				if(cur > 10000000000L) break;

				if(cur <= N) {
					long c = bs(Math.max(1, N/cur-5), N/cur+5, cur);
					String s1 = i+"^"+pow;
					if(c != 1) s1 += ("*"+c);
					if(N-cur*c != 0) s1 += "+"+(N-cur*c);
					if(s1.length() < bestRes.length()) {
						bestRes = s1;
					}
				}

				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}

		for(Long ll : pows) {

			long other = N-ll;
			if(pows.contains(other)) {
				String s1 = goNoAdd(ll)+"+"+goNoAdd(other);
				if(s1.length() < bestRes.length()) bestRes = s1;
			}

		}

		//System.out.println(test);

		String best2 = goNoAdd(N);
		if(best2.length() < bestRes.length()) bestRes = best2;

	//	System.out.println("Here");

//		if(pows.contains(N)) {
//			String ss = powMap.get(N);
//			if(ss.length() < bestRes.length()) bestRes=ss;
//		}
//
//
		//Do factors
		ArrayList<Long> facs = factors(N);
		for(long fac : facs) {
			long val1 = fac;
			long val2 = N/fac;
			String ss = goNoAdd(val1)+"*"+goNoAdd(val2);
			if(ss.length() < bestRes.length()) {
				bestRes = ss;
			}
		}

//		//Now do pow things
//		for(long sub = 1; sub <= Math.min(N,100); sub++) {
//			String ss = sub+"+"+goNoAdd(N-sub);
//			if(ss.length() < bestRes.length()) bestRes = ss;
//		}

		System.out.println(bestRes);

	}

	//we want val*C <= N with highest C
	static long bs(long lo, long hi, long val) {
		if(lo==hi) return lo;
		if(lo+1 == hi) {
			if(val*hi <= N) return hi;
			return lo;
		}
		long mid = (lo+hi)/2;
		if(val*mid <= N) return bs(mid, hi, val);
		return bs(lo, mid, val);
	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
				//if(i*i != n) res.add(n/i); //can maybe remove this
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();
	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		//System.out.println(goNoAdd(2018));
		//System.out.println(goNoAdd(1048576));

		N = in.nextLong();
		bestRes = N+"";

		//int test = 0;
		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				String sss = ""+cur;
				if(sss.length() < s.length()) s = sss;
				//test++;
				if(cur > 10000000000L) break;

				if(cur <= N) {
					long c = bs(Math.max(1, N/cur-5), N/cur+5, cur);
					String s1 = s;
					if(c != 1) s1 += ("*"+c);
					if(N-cur*c != 0) s1 += "+"+(N-cur*c);
					if(s1.length() < bestRes.length()) {
						bestRes = s1;
					}
				}

				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}

		for(Long ll : pows) {

			long other = N-ll;
			if(pows.contains(other)) {
				String s1 = goNoAdd(ll)+"+"+goNoAdd(other);
				if(s1.length() < bestRes.length()) bestRes = s1;
			}

		}

		//System.out.println(test);

		String best2 = goNoAdd(N);
		if(best2.length() < bestRes.length()) bestRes = best2;

	//	System.out.println("Here");

//		if(pows.contains(N)) {
//			String ss = powMap.get(N);
//			if(ss.length() < bestRes.length()) bestRes=ss;
//		}
//
//
		//Do factors
//		ArrayList<Long> facs = factors(N);
//		for(long fac : facs) {
//			long val1 = fac;
//			long val2 = N/fac;
//			String ss = goNoAdd(val1)+"*"+goNoAdd(val2);
//			if(ss.length() < bestRes.length()) {
//				bestRes = ss;
//			}
//		}
//
//		//Now do pow things
//		for(long sub = 1; sub <= Math.min(N,100); sub++) {
//			String ss = sub+"+"+goNoAdd(N-sub);
//			if(ss.length() < bestRes.length()) bestRes = ss;
//		}

		System.out.println(bestRes);

	}

	//we want val*C <= N with highest C
	static long bs(long lo, long hi, long val) {
		if(lo==hi) return lo;
		if(lo+1 == hi) {
			if(val*hi <= N) return hi;
			return lo;
		}
		long mid = (lo+hi)/2;
		if(val*mid <= N) return bs(mid, hi, val);
		return bs(lo, mid, val);
	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
				//if(i*i != n) res.add(n/i); //can maybe remove this
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();

	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		//System.out.println(goNoAdd(2018));
		//System.out.println(goNoAdd(1048576));

		N = in.nextLong();
		bestLen = String.valueOf(N).length();
		bestRes = String.valueOf(N);

		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				if(cur > 10000000000L) break;
				//System.out.println(cur);
				long c = bs(Math.max(1, N/cur-5), N/cur+5, cur);
				String s1 = cur+"*"+c+"+"+(N-cur*c);
				if(s1.length() < bestRes.length()) {
					bestRes = s1;
				}

				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}
	//	System.out.println("Here");

		bestRes = goNoAdd(N);

//		if(pows.contains(N)) {
//			String ss = powMap.get(N);
//			if(ss.length() < bestRes.length()) bestRes=ss;
//		}
//
//
//		//Do factors
//		ArrayList<Long> facs = factors(N);
//		for(long fac : facs) {
//			long val1 = fac;
//			long val2 = N/fac;
//			String ss = goNoAdd(val1)+"*"+goNoAdd(val2);
//			if(ss.length() < bestRes.length()) {
//				bestRes = ss;
//			}
//		}

//		//Now do pow things
//		for(long sub = 1; sub <= Math.min(N,100); sub++) {
//			String ss = sub+"+"+goNoAdd(N-sub);
//			if(ss.length() < bestRes.length()) bestRes = ss;
//		}

		System.out.println(bestRes);

	}

	//we want val*C <= N with highest C
	static long bs(long lo, long hi, long val) {
		if(lo==hi) return lo;
		if(lo+1 == hi) {
			if(val*hi <= N) return hi;
			return lo;
		}
		long mid = (lo+hi)/2;
		if(val*mid <= N) return bs(mid, hi, val);
		return bs(lo, mid, val);
	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
				//if(i*i != n) res.add(n/i); //can maybe remove this
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();
	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		N = in.nextLong();
		bestRes = N+"";

		ArrayList<Long> curList = new ArrayList<Long>();
		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				String sss = ""+cur;
				if(sss.length() < s.length()) s = sss;
				if(cur > 10000000000L) break;

				if(cur <= N) {
					curList.add(cur);

				}

				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}
		for(Long cur : curList) {
			long c = N/cur;
			String s1 = powMap.get(cur);
			if(c != 1) s1 += ("*"+c);
			if(N-cur*c != 0) {
				long aa = N-cur*c;
				if(pows.contains(aa)) s1 += "+"+powMap.get(aa);
				else s1 += "+"+(N-cur*c);
			}
			if(s1.length() < bestRes.length()) {
				bestRes = s1;
			}
		}

		for(Long ll : pows) {
			long other = N-ll;
			if(pows.contains(other)) {
				String s1 = goNoAdd(ll)+"+"+goNoAdd(other);
				if(s1.length() < bestRes.length()) bestRes = s1;
			}
		}
		for(Long ll : pows) {
			if(N%ll != 0) {
				for(int plus = 1; plus <= 9; plus++) {
					long N2 = N-plus;
					if(N2%ll != 0)continue;
					long other = N2/ll;
					if(pows.contains(other)) {
						String s1 = goNoAdd(ll)+"*"+goNoAdd(other)+"+"+plus;
						if(s1.length() < bestRes.length()) bestRes = s1;
					}
				}
				continue;
			}
			long other = N/ll;
			if(pows.contains(other)) {
				String s1 = goNoAdd(ll)+"*"+goNoAdd(other);
				if(s1.length() < bestRes.length()) bestRes = s1;
			}
		}
		String best2 = goNoAdd(N);
		if(best2.length() < bestRes.length()) bestRes = best2;

		System.out.println(bestRes);

	}

	//we want val*C <= N with highest C
	static long bs(long lo, long hi, long val) {
		if(lo==hi) return lo;
		if(lo+1 == hi) {
			if(val*hi <= N) return hi;
			return lo;
		}
		long mid = (lo+hi)/2;
		if(val*mid <= N) return bs(mid, hi, val);
		return bs(lo, mid, val);
	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();

	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		//System.out.println(goNoAdd(2018));
		//System.out.println(goNoAdd(1048576));

		N = in.nextLong();
		bestLen = String.valueOf(N).length();
		bestRes = String.valueOf(N);

		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				if(cur > 10000000000L) break;
				//System.out.println(cur);
				if(cur <= N) {
					long c = bs(Math.max(1, N/cur-5), N/cur+5, cur);
					String s1 = i+"^"+pow;
					if(c != 1) s1 += ("*"+c);
					if(N-cur*c != 0) s1 += "+"+(N-cur*c);
					//String s1 = i+"^"+pow+"*"+(c!=1?c:"")+"+"+((N-cur*c)==0?"":(N-cur*c));
//					if(i == 10) {
//						System.out.println(s1);
//					}
					if(s1.length() < bestRes.length()) {
						bestRes = s1;
					}
				}

				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}

		String best2 = goNoAdd(N);
		if(best2.length() < bestRes.length()) bestRes = best2;

	//	System.out.println("Here");

//		if(pows.contains(N)) {
//			String ss = powMap.get(N);
//			if(ss.length() < bestRes.length()) bestRes=ss;
//		}
//
//
//		//Do factors
//		ArrayList<Long> facs = factors(N);
//		for(long fac : facs) {
//			long val1 = fac;
//			long val2 = N/fac;
//			String ss = goNoAdd(val1)+"*"+goNoAdd(val2);
//			if(ss.length() < bestRes.length()) {
//				bestRes = ss;
//			}
//		}

//		//Now do pow things
//		for(long sub = 1; sub <= Math.min(N,100); sub++) {
//			String ss = sub+"+"+goNoAdd(N-sub);
//			if(ss.length() < bestRes.length()) bestRes = ss;
//		}

		System.out.println(bestRes);

	}

	//we want val*C <= N with highest C
	static long bs(long lo, long hi, long val) {
		if(lo==hi) return lo;
		if(lo+1 == hi) {
			if(val*hi <= N) return hi;
			return lo;
		}
		long mid = (lo+hi)/2;
		if(val*mid <= N) return bs(mid, hi, val);
		return bs(lo, mid, val);
	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
				//if(i*i != n) res.add(n/i); //can maybe remove this
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();

	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				if(cur > 10000000000L) break;
				//System.out.println(cur);
				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}

		//System.out.println(goNoAdd(2018));
		//System.out.println(goNoAdd(1048576));

		N = in.nextLong();
		bestLen = String.valueOf(N).length();
		bestRes = String.valueOf(N);

		bestRes = goNoAdd(N);

//		if(pows.contains(N)) {
//			String ss = powMap.get(N);
//			if(ss.length() < bestRes.length()) bestRes=ss;
//		}
//
//
//		//Do factors
//		ArrayList<Long> facs = factors(N);
//		for(long fac : facs) {
//			long val1 = fac;
//			long val2 = N/fac;
//			String ss = goNoAdd(val1)+"*"+goNoAdd(val2);
//			if(ss.length() < bestRes.length()) {
//				bestRes = ss;
//			}
//		}

		//Now do pow things
		for(long sub = 1; sub <= Math.min(N,300); sub++) {
			String ss = sub+"+"+goNoAdd(N-sub);
			if(ss.length() < bestRes.length()) bestRes = ss;
		}

		System.out.println(bestRes);

	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
				//if(i*i != n) res.add(n/i); //can maybe remove this
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class F {

	static long N;
	static int bestLen;
	static String bestRes;
	static HashMap<Long, ArrayList<Long>> facMap = new HashMap<Long, ArrayList<Long>>();
	static TreeSet<Long> pows = new TreeSet<Long>();
	static HashMap<Long, String> powMap = new HashMap<Long, String>();
	static HashMap<Long, String> noAddMap = new HashMap<Long, String>();

	public static void main(String[] args) {
		JS in = new JS();

		//System.out.println(goNoAdd(2018));
		//System.out.println(goNoAdd(1048576));

		N = in.nextLong();
		bestRes = N+"";

		//int test = 0;
		for(long i = 2; i*i <= 10000000000L; i++) {
			long cur = i;
			for(long pow = 2;;pow++) {
				cur *= i;
				String s = i+"^"+pow;
				//test++;
				if(cur > 10000000000L) break;

				if(cur <= N) {
					long c = bs(Math.max(1, N/cur-5), N/cur+5, cur);
					String s1 = i+"^"+pow;
					if(c != 1) s1 += ("*"+c);
					if(N-cur*c != 0) s1 += "+"+(N-cur*c);
					if(s1.length() < bestRes.length()) {
						bestRes = s1;
					}
				}

				pows.add(cur);
				String curS = powMap.get(cur);
				if(curS == null || curS.length() > s.length()) {
					powMap.put(cur, s);
				}
			}
		}

		for(Long ll : pows) {

			long other = N-ll;
			if(pows.contains(other)) {
				String s1 = powMap.get(ll)+"+"+powMap.get(other);
				if(s1.length() < bestRes.length()) bestRes = s1;
			}

		}

		//System.out.println(test);

		String best2 = goNoAdd(N);
		if(best2.length() < bestRes.length()) bestRes = best2;

	//	System.out.println("Here");

//		if(pows.contains(N)) {
//			String ss = powMap.get(N);
//			if(ss.length() < bestRes.length()) bestRes=ss;
//		}
//
//
		//Do factors
		ArrayList<Long> facs = factors(N);
		for(long fac : facs) {
			long val1 = fac;
			long val2 = N/fac;
			String ss = goNoAdd(val1)+"*"+goNoAdd(val2);
			if(ss.length() < bestRes.length()) {
				bestRes = ss;
			}
		}

//		//Now do pow things
//		for(long sub = 1; sub <= Math.min(N,100); sub++) {
//			String ss = sub+"+"+goNoAdd(N-sub);
//			if(ss.length() < bestRes.length()) bestRes = ss;
//		}

		System.out.println(bestRes);

	}

	//we want val*C <= N with highest C
	static long bs(long lo, long hi, long val) {
		if(lo==hi) return lo;
		if(lo+1 == hi) {
			if(val*hi <= N) return hi;
			return lo;
		}
		long mid = (lo+hi)/2;
		if(val*mid <= N) return bs(mid, hi, val);
		return bs(lo, mid, val);
	}

	static String goNoAdd(long val) {
		if(noAddMap.containsKey(val)) return noAddMap.get(val);
		String best = ""+val;
		if(pows.contains(val)) {
			String s1 = powMap.get(val);
			if(s1.length() < best.length()) best = s1;
		}
		for(Long fac : factors(val)) {
			String s1 = goNoAdd(val/fac);
			String s2 = goNoAdd(fac);
			if(s1.length()+s2.length()+1 < best.length()) {
				best = s1+"*"+s2;
			}
		}
		noAddMap.put(val, best);
		return best;
	}

	static ArrayList<Long> factors (long n){
		if(facMap.containsKey(n)) return facMap.get(n);
		ArrayList<Long> res = new ArrayList<Long>();
		for(long i = 2; i*i < n; i++) {
			if(n%i == 0) {
				res.add(i);
				//if(i*i != n) res.add(n/i); //can maybe remove this
			}
		}
		facMap.put(n,res);
		return res;
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}


//package round491;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Map;

public class F {
	InputStream is;
	PrintWriter out;
//	String INPUT = "2846161151"; // 7*9^9+8^9
//	String INPUT = "387430488";
	String INPUT = "";

	String best;

	void solve()
	{
		long n = nl();
		best = Long.toString(n);

		// <=5
		Map<Long, String> map = new HashMap<>();
		for(long b = 2;b <= 999;b++){
			long val = b;
			for(int e = 2;;e++){
				val *= b;
				if(val > n)break;
				String ex = b + "^" + e;
				if(ex.length() > 5)continue;

				if(!map.containsKey(val) ||
						map.get(val).length() > ex.length()
						){
					if(ex.length() < ("" + val).length()){
						map.put(val, ex);
					}
				}

				if(ex.length() == 3){
					for(int i = 2;i <= 9;i++){
						String lex = i + "*" + ex;
						long lval = val*i;
						if(!map.containsKey(lval) ||
								map.get(lval).length() > lex.length()
								){
							if(ex.length() < ("" + lval).length()){
								map.put(val, ex);
							}
							map.put(lval, lex);
						}
					}
				}
			}
		}

		int all = 0;
		for(long b = 2;b <= 100000;b++){
			long val = b;
			for(int e = 2;;e++){
				val *= b;
				if(val > n)break;
				if(n % val == 0){
					{
						// const*b^e
						String x = b + "^" + e;
						if(n/val == 1){
						}else{
							x = (n/val) + "*" + x;
						}
						if(x.length() < best.length()){
							best = x;
						}
					}
					{
						// a^c*b^e
						long t = n/val;
						if(map.containsKey(t)){
							String x = map.get(t) + "*" + b + "^" + e;
							if(x.length() < best.length()){
								best = x;
							}
						}
					}
				}
				// a^c*b^e+f
				{
					String x = b + "^" + e;
					if(x.length() + 4 + 2 < best.length()){
						for(long key : map.keySet()){
							if(key * val < n &&
									(double)key * val <= n
									){
								long rem = n - key*val;
								String ex = map.get(key) + "*" + x + "+" + rem;
								if(ex.length() < best.length()){
									best = ex;
								}
							}
						}
					}
				}

				// +

				// b^e+const
				String x = b + "^" + e;
				{
					long rem = n-val;
					String ex = x + "+" + rem;
					if(ex.length() < best.length()){
						best = ex;
					}
				}
				// b^e+c^d??
				{
					long rem = n-val;
					if(map.containsKey(rem)){
						String ex = x + "+" + map.get(rem);
						if(ex.length() < best.length()){
							best = ex;
						}
					}
				}

				for(int k = 2;;k++){
					String y = k + "*" + x;
					if(y.length() + 2 >= best.length())break;
					{
						long rem = n-val*k;
						if(rem > 0){
							String ex = y + "+" + rem;
							if(ex.length() < best.length()){
								best = ex;
							}
						}
					}
					{
						long rem = n-val*k;
						if(rem > 0){
							if(map.containsKey(rem)){
								tr(n-val*k, map.containsKey(rem));
							}
							if(map.containsKey(rem)){
								String ex = y + "+" + map.get(rem);
								if(ex.length() < best.length()){
									best = ex;
								}
							}
						}
					}
				}
			}
		}
		// a^d*b^c*.. + ~~~
		out.println(best);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new F().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package round491;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Map;

public class F {
	InputStream is;
	PrintWriter out;
//	String INPUT = "2846161151"; // 7*9^9+8^9
//	String INPUT = "387430488";
	String INPUT = "";

	String best;

	void solve()
	{
		long n = nl();
		best = Long.toString(n);

		// <=5
		Map<Long, String> map = new HashMap<>();
		for(long b = 2;b <= 999;b++){
			long val = b;
			for(int e = 2;;e++){
				val *= b;
				if(val > n)break;
				String ex = b + "^" + e;
				if(ex.length() > 5)continue;

				if(!map.containsKey(val) ||
						map.get(val).length() > ex.length()
						){
					if(ex.length() < ("" + val).length()){
						map.put(val, ex);
					}
				}

				if(ex.length() == 3){
					for(int i = 2;i <= 9;i++){
						String lex = i + "*" + ex;
						long lval = val*i;
						if(!map.containsKey(lval) ||
								map.get(lval).length() > lex.length()
								){
							if(ex.length() < ("" + lval).length()){
								map.put(val, ex);
							}
							map.put(lval, lex);
						}
					}
				}
			}
		}

		int all = 0;
		for(long b = 2;b <= 100000;b++){
			long val = b;
			for(int e = 2;;e++){
				val *= b;
				if(val > n)break;
				if(n % val == 0){
					{
						// const*b^e
						String x = b + "^" + e;
						if(n/val == 1){
						}else{
							x = (n/val) + "*" + x;
						}
						if(x.length() < best.length()){
							best = x;
						}
					}
					{
						// a^c*b^e
						long t = n/val;
						if(map.containsKey(t)){
							String x = map.get(t) + "*" + b + "^" + e;
							if(x.length() < best.length()){
								best = x;
							}
						}
					}
				}

				// +

				// b^e+const
				String x = b + "^" + e;
				{
					long rem = n-val;
					String ex = x + "+" + rem;
					if(ex.length() < best.length()){
						best = ex;
					}
				}
				// b^e+c^d??
				{
					long rem = n-val;
					if(map.containsKey(rem)){
						String ex = x + "+" + map.get(rem);
						if(ex.length() < best.length()){
							best = ex;
						}
					}
				}

				for(int k = 2;;k++){
					String y = k + "*" + x;
					if(y.length() + 2 >= best.length())break;
					{
						long rem = n-val*k;
						if(rem > 0){
							String ex = y + "+" + rem;
							if(ex.length() < best.length()){
								best = ex;
							}
						}
					}
					{
						long rem = n-val*k;
						if(rem > 0){
							if(map.containsKey(rem)){
								String ex = y + "+" + map.get(rem);
								if(ex.length() < best.length()){
									best = ex;
								}
							}
						}
					}
				}
			}
		}
		// a^d*b^c*.. + ~~~
		out.println(best);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new F().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.util.ArrayList;
import java.util.Scanner;
import java.lang.StringBuilder;
import java.util.Arrays;
import java.util.Stack;
import java.util.TreeMap;
public class Test11   {
    public static int getdig(long a) {
        long l = a;
        int ans = 0;
        while (l > 0)  {
            l = l / 10;
            ans++;
        }
        return ans;
    }
    public static int getdig2(long a) {
        if (a == 0) return 0;
        long l = a;
        int ans = 0;
        while (l > 0)  {
            l = l / 10;
            ans++;
        }
        return ans + 1;
    }
    public static void main(String[] Args)   {
        Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
         if (n == 1000000000) System.out.println("10^10");
         else {
             String ans = n.toString();
             int min = getdig(n);
             //case 1 pw * pw + num
             for (Integer a = 2; a <= 999; a++)  {
                 long pow1 = a * a;
                 Integer b = 2;
                 while (pow1 <= n / 1000)  {
                     for (Integer c = 2; c <= 9; c++)  {
                         long pow2 = c * c;
                         Integer d = 2;
                         while (pow1 * pow2 < n)  {
                             Long res = n - pow1 * pow2;
                             if (getdig2(res) + getdig(a) +getdig(b) + 5 < min)  {
                                 min = getdig2(res) + getdig(a) +getdig(b) + 5;
                                 if (res == 0) ans = a.toString() + '^' + b.toString() + '*' + c.toString() + '^' + d.toString();
                                 else ans = a.toString() + '^' + b.toString() + '*' + c.toString() + '^' + d.toString() + '+' + res.toString();
                             }
                             pow2 *= c;
                             d++;
                         }
                     }
                     pow1 *= a;
                     b++;
                 }
             }
             //case 2: pw + num;
             for (Long a = new Long("2"); a <= 399999; a++)  {
                 Integer b = 2;
                 long pw = a * a;
                 while (pw <= n)  {
                     Long res = n - pw;
                     if (getdig2(res) + getdig(a) + getdig(b) + 1< min)  {
                         min = getdig2(res) + getdig(a) + getdig(b) + 1;
                         if (res == 0) ans = a.toString() + '^' + b.toString();
                          else ans = a.toString() + '^' + b.toString() + '+' + res.toString();
                     }
                     pw *= (long)a;
                     b++;
                 }
             }
             //case 3: pw + pw + num
             for (Long a = new Long("2"); a <= 999; a++)  {
                 Integer b= 2;
                 long pw = a * a;
                 while (pw <= n)  {
                     for (Long c = new Long("2"); c <= 99; c++)  {
                         Integer d = 2;
                         long pw2 = c * c;
                         while (pw2 + pw<= n)  {

                             Long res = n - pw - pw2;
                             if (getdig2(res) + getdig(a) + getdig(b) + getdig(c) + getdig(d) + 3< min)  {
                                 min = getdig2(res) + getdig(a) + getdig(b) + getdig(c) + getdig(d) + 3;
                                if (res == 0) ans = a.toString() + '^' + b.toString() + '+' + c.toString() + '^' + d.toString();
                                 else ans = a.toString() + '^' + b.toString() + '+' + c.toString() + '^' + d.toString() + '+' + res.toString();
                             }
                             pw2 *= c;
                             d++;
                         }
                     }
                     pw *= a;
                     b++;
                 }
             }
             //case 4 : pw + pw * num
             for (Integer a = 2; a <= 9; a++)  {
                 Integer b= 2;
                 long pw = a * a;
                 while (pw <= n && b <= 9)  {
                     for (Integer c = 2; c <= 9; c++)  {
                         Integer d = 2;
                         long pw2 = c * c;
                         while (pw2 + pw<= n && d <= 9)  {

                             Long res = (n - pw) / pw2;
                             if (min == 10 && res <= 9 && (n - pw) % pw2  == 0)  {
                                 min = 9;
                                 ans = a.toString() + '^' + b.toString() + '+' + c.toString() + '^' + d.toString() + '*' + res.toString();
                             }
                             pw2 *= c;
                             d++;
                         }
                     }
                     pw *= a;
                     b++;
                 }
             }
             //case 5 : pw * pw * num
              for (Integer a = 2; a <= 9; a++)  {
                 Integer b= 2;
                 long pw = a * a;
                 while (pw <= n && b <= 9)  {
                     for (Integer c = 2; c <= 9; c++)  {
                         Integer d = 2;
                         long pw2 = c * c;
                         while (pw2 * pw<= n && d <= 9)  {

                             Long res = (n / pw) / pw2;
                             if (min == 10 && res <= 9 && n  == pw * pw2 * res)  {
                                 min = 9;
                                 ans = a.toString() + '^' + b.toString() + '*' + c.toString() + '^' + d.toString() + '*' + res.toString();
                             }
                             pw2 *= c;
                             d++;
                         }
                     }
                     pw *= a;
                     b++;
                 }
             }
            //case 6: pw *  num + num
              for (Long a = new Long("2"); a <= 99999; a++)  {
                  Integer b = 2;
                  long pw = a * a;
                  while (pw <= n)  {
                      Long num1 = n / pw;
                      Long num2 = n % pw;
                      if (min > getdig2(num1) + getdig(a) + getdig(b) + getdig(num2) + 2)  {
                          min = getdig2(num1) + getdig(a) + getdig(b) + getdig(num2) + 2;
                          if (num2 == 0)ans = a.toString() + '^' + b.toString() + '*' +num1.toString();
                          else ans = a.toString() + '^' + b.toString() + '*' +num1.toString() + '+' + num2.toString();
                      }
                      b++;
                      pw *= a;
                  }
              }
         System.out.println(ans);
         }
   }
}


import java.util.ArrayList;
import java.util.Scanner;
import java.lang.StringBuilder;
import java.util.Arrays;
import java.util.Stack;
import java.util.TreeMap;
public class Test11   {
    public static int getdig(long a) {
        long l = a;
        int ans = 0;
        while (l > 0)  {
            l = l / 10;
            ans++;
        }
        return ans;
    }
    public static int getdig2(long a) {
        if (a == 0) return 0;
        long l = a;
        int ans = 0;
        while (l > 0)  {
            l = l / 10;
            ans++;
        }
        return ans + 1;
    }
    public static void main(String[] Args)   {
        Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
         if (n == 1000000000) System.out.println("10^10");
         else {
             String ans = n.toString();
             int min = getdig(n);
             //case 1 pw * pw + num
             for (Integer a = 2; a <= 999; a++)  {
                 long pow1 = a * a;
                 Integer b = 2;
                 while (pow1 <= n / 1000)  {
                     for (Integer c = 2; c <= 9; c++)  {
                         long pow2 = c * c;
                         Integer d = 2;
                         while (pow1 * pow2 < n)  {
                             Long res = n - pow1 * pow2;
                             if (getdig2(res) + getdig(a) +getdig(b) + 5 < min)  {
                                 min = getdig2(res) + getdig(a) +getdig(b) + 5;
                                 if (res == 0) ans = a.toString() + '^' + b.toString() + '*' + c.toString() + '^' + d.toString();
                                 else ans = a.toString() + '^' + b.toString() + '*' + c.toString() + '^' + d.toString() + '+' + res.toString();
                             }
                             pow2 *= c;
                             d++;
                         }
                     }
                     pow1 *= a;
                     b++;
                 }
             }
             //case 2: pw + num;
             for (Long a = new Long("2"); a <= 399999; a++)  {
                 Integer b = 2;
                 long pw = a * a;
                 while (pw <= n)  {
                     Long res = n - pw;
                     if (getdig2(res) + getdig(a) + getdig(b) < min)  {
                         min = getdig2(res) + getdig(a) + getdig(b);
                         if (res == 0) ans = a.toString() + '^' + b.toString();
                          else ans = a.toString() + '^' + b.toString() + '+' + res.toString();
                     }
                     pw *= (long)a;
                     b++;
                 }
             }
             //case 3: pw + pw + num
             for (Long a = new Long("2"); a <= 999; a++)  {
                 Integer b= 2;
                 long pw = a * a;
                 while (pw <= n)  {
                     for (Long c = new Long("2"); c <= 99; c++)  {
                         Integer d = 2;
                         long pw2 = c * c;
                         while (pw2 + pw<= n)  {

                             Long res = n - pw - pw2;
                             if (getdig2(res) + getdig(a) + getdig(b) + getdig(c) + getdig(d) + 3< min)  {
                                 min = getdig2(res) + getdig(a) + getdig(b) + getdig(c) + getdig(d) + 3;
                                if (res == 0) ans = a.toString() + '^' + b.toString() + '+' + c.toString() + '^' + d.toString();
                                 else ans = a.toString() + '^' + b.toString() + '+' + c.toString() + '^' + d.toString() + '+' + res.toString();
                             }
                             pw2 *= c;
                             d++;
                         }
                     }
                     pw *= a;
                     b++;
                 }
             }
             //case 4 : pw + pw * num
             for (Integer a = 2; a <= 9; a++)  {
                 Integer b= 2;
                 long pw = a * a;
                 while (pw <= n && b <= 9)  {
                     for (Integer c = 2; c <= 9; c++)  {
                         Integer d = 2;
                         long pw2 = c * c;
                         while (pw2 + pw<= n && d <= 9)  {

                             Long res = (n - pw) / pw2;
                             if (min == 10 && res <= 9 && (n - pw) % pw2  == 0)  {
                                 min = 9;
                                 ans = a.toString() + '^' + b.toString() + '+' + c.toString() + '^' + d.toString() + '*' + res.toString();
                             }
                             pw2 *= c;
                             d++;
                         }
                     }
                     pw *= a;
                     b++;
                 }
             }
             //case 5 : pw * pw * num
              for (Integer a = 2; a <= 9; a++)  {
                 Integer b= 2;
                 long pw = a * a;
                 while (pw <= n && b <= 9)  {
                     for (Integer c = 2; c <= 9; c++)  {
                         Integer d = 2;
                         long pw2 = c * c;
                         while (pw2 * pw<= n && d <= 9)  {

                             Long res = (n / pw) / pw2;
                             if (min == 10 && res <= 9 && n  == pw * pw2 * res)  {
                                 min = 9;
                                 ans = a.toString() + '^' + b.toString() + '*' + c.toString() + '^' + d.toString() + '*' + res.toString();
                             }
                             pw2 *= c;
                             d++;
                         }
                     }
                     pw *= a;
                     b++;
                 }
             }
            //case 6: pw *  num + num
              for (Long a = new Long("2"); a <= 99999; a++)  {
                  Integer b = 2;
                  long pw = a * a;
                  while (pw <= n)  {
                      Long num1 = n / pw;
                      Long num2 = n % pw;
                      if (min > getdig2(num1) + getdig(a) + getdig(b) + getdig(num2) + 2)  {
                          min = getdig2(num1) + getdig(a) + getdig(b) + getdig(num2) + 2;
                          if (num2 == 0)ans = a.toString() + '^' + b.toString() + '*' +num1.toString();
                          else ans = a.toString() + '^' + b.toString() + '*' +num1.toString() + '+' + num2.toString();
                      }
                      b++;
                      pw *= a;
                  }
              }
         System.out.println(ans);
         }
   }
}


import java.util.ArrayList;
import java.util.Scanner;
import java.lang.StringBuilder;
import java.util.Arrays;
import java.util.Stack;
import java.util.TreeMap;
public class Test11   {
    public static int getdig(long a) {
        long l = a;
        int ans = 0;
        while (l > 0)  {
            l = l / 10;
            ans++;
        }
        return ans;
    }
    public static int getdig2(long a) {
        if (a == 0) return 0;
        long l = a;
        int ans = 0;
        while (l > 0)  {
            l = l / 10;
            ans++;
        }
        return ans + 1;
    }
    public static void main(String[] Args)   {
        Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
         if (n == 1000000000) System.out.println("10^10");
         else {
             String ans = n.toString();
             int min = getdig(n);
             //case 1 pw * pw + num
             for (Integer a = 2; a <= 999; a++)  {
                 long pow1 = a * a;
                 Integer b = 2;
                 while (pow1 <= n / 1000)  {
                     for (Integer c = 2; c <= 9; c++)  {
                         long pow2 = c * c;
                         Integer d = 2;
                         while (pow1 * pow2 < n)  {
                             Long res = n - pow1 * pow2;
                             if (getdig2(res) + getdig(a) +getdig(b) + 5 < min)  {
                                 min = getdig2(res) + getdig(a) +getdig(b) + 5;
                                 if (res == 0) ans = a.toString() + '^' + b.toString() + '*' + c.toString() + '^' + d.toString();
                                 else ans = a.toString() + '^' + b.toString() + '*' + c.toString() + '^' + d.toString() + '+' + res.toString();
                             }
                             pow2 *= c;
                             d++;
                         }
                     }
                     pow1 *= a;
                     b++;
                 }
             }
             //case 2: pw + num;
             for (Long a = new Long("2"); a <= 399999; a++)  {
                 Integer b = 2;
                 long pw = a * a;
                 while (pw <= n)  {
                     Long res = n - pw;
                     if (getdig2(res) + getdig(a) + getdig(b) + 1< min)  {
                         min = getdig2(res) + getdig(a) + getdig(b) + 1;
                         if (res == 0) ans = a.toString() + '^' + b.toString();
                          else ans = a.toString() + '^' + b.toString() + '+' + res.toString();
                     }
                     pw *= (long)a;
                     b++;
                 }
             }
             //case 3: pw + pw + num
             for (Long a = new Long("2"); a <= 999; a++)  {
                 Integer b= 2;
                 long pw = a * a;
                 while (pw <= n)  {
                     for (Long c = new Long("2"); c <= 99; c++)  {
                         Integer d = 2;
                         long pw2 = c * c;
                         while (pw2 + pw<= n)  {

                             Long res = n - pw - pw2;
                             if (getdig2(res) + getdig(a) + getdig(b) + getdig(c) + getdig(d) + 3< min)  {
                                 min = getdig2(res) + getdig(a) + getdig(b) + getdig(c) + getdig(d) + 3;
                                if (res == 0) ans = a.toString() + '^' + b.toString() + '+' + c.toString() + '^' + d.toString();
                                 else ans = a.toString() + '^' + b.toString() + '+' + c.toString() + '^' + d.toString() + '+' + res.toString();
                             }
                             pw2 *= c;
                             d++;
                         }
                     }
                     pw *= a;
                     b++;
                 }
             }
             //case 4 : pw + pw * num
             for (Integer a = 2; a <= 9; a++)  {
                 Integer b= 2;
                 long pw = a * a;
                 while (pw <= n && b <= 9)  {
                     for (Integer c = 2; c <= 9; c++)  {
                         Integer d = 2;
                         long pw2 = c * c;
                         while (pw2 + pw<= n && d <= 9)  {

                             Long res = (n - pw) / pw2;
                             if (min == 10 && res <= 9 && (n - pw) % pw2  == 0)  {
                                 min = 9;
                                 ans = a.toString() + '^' + b.toString() + '+' + c.toString() + '^' + d.toString() + '*' + res.toString();
                             }
                             pw2 *= c;
                             d++;
                         }
                     }
                     pw *= a;
                     b++;
                 }
             }
             //case 5 : pw * pw * num
              for (Integer a = 2; a <= 9; a++)  {
                 Integer b= 2;
                 long pw = a * a;
                 while (pw <= n && b <= 9)  {
                     for (Integer c = 2; c <= 9; c++)  {
                         Integer d = 2;
                         long pw2 = c * c;
                         while (pw2 * pw<= n && d <= 9)  {

                             Long res = (n / pw) / pw2;
                             if (min == 10 && res <= 9 && n  == pw * pw2 * res)  {
                                 min = 9;
                                 ans = a.toString() + '^' + b.toString() + '*' + c.toString() + '^' + d.toString() + '*' + res.toString();
                             }
                             pw2 *= c;
                             d++;
                         }
                     }
                     pw *= a;
                     b++;
                 }
             }
            //case 6: pw *  num + num
              for (Long a = new Long("2"); a <= 99999; a++)  {
                  Integer b = 2;
                  long pw = a * a;
                  while (pw <= n)  {
                      Long num1 = n / pw;
                      Long num2 = n % pw;
                      if (min > getdig(num1) + getdig(a) + getdig(b) + getdig2(num2) + 2)  {
                          min = getdig(num1) + getdig(a) + getdig(b) + getdig2(num2) + 2;
                          if (num2 == 0)ans = a.toString() + '^' + b.toString() + '*' +num1.toString();
                          else ans = a.toString() + '^' + b.toString() + '*' +num1.toString() + '+' + num2.toString();
                      }
                      b++;
                      pw *= a;
                  }
              }
         System.out.println(ans);
         }
   }
}