using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    class IOHelper : IDisposable
    {
        StreamReader reader;
        StreamWriter writer;

        public IOHelper(string inputFile, string outputFile, Encoding encoding)
        {
            StreamReader iReader;
            StreamWriter oWriter;
            if (inputFile == null)
                iReader = new StreamReader(Console.OpenStandardInput(), encoding);
            else
                iReader = new StreamReader(inputFile, encoding);

            if (outputFile == null)
                oWriter = new StreamWriter(Console.OpenStandardOutput(), encoding);
            else
                oWriter = new StreamWriter(outputFile, false, encoding);

            reader = iReader;
            writer = oWriter;

            curLine = new string[] { };
            curTokenIdx = 0;
        }

        string[] curLine;
        int curTokenIdx;

        char[] whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public string ReadNextToken()
        {
            if (curTokenIdx >= curLine.Length)
            {
                //Read next line
                string line = reader.ReadLine();
                if (line != null)
                    curLine = line.Split(whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    curLine = new string[] { };
                curTokenIdx = 0;
            }

            if (curTokenIdx >= curLine.Length)
                return null;

            return curLine[curTokenIdx++];
        }

        public int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        public double ReadNextDouble()
        {
            var nextToken = ReadNextToken();
            var result = 0.0;
            nextToken = nextToken.Replace(".", System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator);
            result = double.Parse(nextToken);
            return result;
        }

        public void Write(string stringToWrite)
        {
            writer.Write(stringToWrite);
        }

        public void WriteLine(string stringToWrite)
        {
            writer.WriteLine(stringToWrite);
        }

        public void WriteLine(double valueToWrite)
        {
            long intPart = (long)valueToWrite;
            double fracPart = valueToWrite - intPart;
            var fracPartStr = fracPart.ToString();
            if (fracPartStr.Length > 1)
                fracPartStr = fracPartStr.Substring(2);
            var strToWrite = string.Format("{0}.{1}", intPart, fracPartStr);
            writer.WriteLine(strToWrite);
        }

        public void Dispose()
        {
            try
            {
                if (reader != null)
                {
                    reader.Dispose();
                }
                if (writer != null)
                {
                    writer.Dispose();
                }
            }
            catch { };
        }

        public void Flush()
        {
            if (writer != null)
            {
                writer.Flush();
            }
        }
    }

    class Program
    {
        protected IOHelper ioHelper;

        long n;

        string ans;

        void UpdateAns(string newAns)
        {
            if (newAns.Length < ans.Length)
                ans = newAns;
        }

        public void Solve()
        {
            string nr = ioHelper.ReadNextToken();
            ans = nr;

            n = long.Parse(nr);

            if (n == 10000000000)
            {
                ans = "10^10";
            }

            long i, j, k, l;

            //5 termeni
            for (i = 1; i <= 9; i++)
                for (j = 1; j <= 9; j++)
                    for (k = 1; k <= 9; k++)
                        for (l = 1; l <= 9; l++)
                        {
                            //Choice 1;
                            long var = (long)(Math.Pow(i, j) * Math.Pow(k, l));
                            long delta = n - var;

                            if (delta == 0)
                                UpdateAns($"{i}^{j}*{k}^{l}");
                            if (delta > 0 && delta <= 9)
                                UpdateAns($"{i}^{j}*{k}^{l}+{delta}");

                            //Choice 1a;
                            var = (long)(Math.Pow(i, j) * Math.Pow(k, l));
                            delta = n / var;

                            if (delta * var == n)
                                UpdateAns($"{i}^{j}*{k}^{l}*{delta}");

                            //Choice 2
                            var = (long)(Math.Pow(i, j) * k * l);
                            delta = n - var;
                            if (delta == 0)
                                UpdateAns($"{i}^{j}*{k}*{l}");
                            if (delta > 0 && delta <= 9)
                                UpdateAns($"{i}^{j}*{k}*{l}+{delta}");

                            //Choice 3
                            var = (long)(Math.Pow(i, j) * k);
                            long delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}^{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)Math.Pow(delta1, 1 / (double)l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}^{l}");
                            }

                            //Choice 4
                            var = (long)(Math.Pow(i, j) * k);
                            delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}^{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)(delta1 / l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}*{l}");
                            }

                            //Choice 5
                            var = (long)(i * j * k * l);
                            delta = n - var;
                            if (delta == 0)
                                UpdateAns($"{i}*{j}*{k}*{l}");
                            if (delta > 0 && delta <= 9)
                                UpdateAns($"{i}*{j}*{k}*{l}+{delta}");

                            //Choice 6
                            var = (long)(i * j * k);
                            delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}*{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)Math.Pow(delta1, 1 / (double)l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}^{l}");
                            }

                            //Choice 7
                            var = (long)(i * j * k);
                            delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}*{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)(delta1 / l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}*{l}");
                            }

                            //Choice 8
                            var = (long)(i * j * k * l);
                            delta = n / var;
                            if (delta == 1 && delta * var == n)
                                UpdateAns($"{i}*{j}*{k}*{l}");
                            if (delta > 0 && delta <= 9 && delta * var == n)
                                UpdateAns($"{i}*{j}*{k}*{l}*{delta}");
                        }

            //4 termeni
            for (i = 1; i <= 999; i++)
                for (j = 1; j <= ((i>=100)?9:((i>=10)?99:999)); j++)
                    for (k = 1; k <= (((i>=10 && j>=10)||(i>=100 || j>=100))?9: ((i>=10 || j >=10)?99:999)); k++)
                    {
                        //Choice 1
                        long var = (long)(Math.Pow(i, j));
                        long delta1 = n / var;

                        if (var == n)
                            UpdateAns($"{i}^{j}");

                        if(delta1 * var == n)
                        {
                            long m = (long)Math.Pow(delta1, 1 / (double)k);

                            m--;
                                if ((long)Math.Pow(m, k) == delta1)
                                    UpdateAns($"{i}^{j}*{k}^{m}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}*{k}^{m}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}*{k}^{m}");
                        }

                        //Choice 2
                        var = (long)(Math.Pow(i, j));
                        delta1 = n / var;

                        if(delta1 * var == n)
                        {

                            long m = (long)delta1/k;

                            m--;
                            if ((long)(m*k) == delta1)
                                UpdateAns($"{i}^{j}*{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}*{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}*{k}*{m}");
                        }

                        //Choice 3
                        var = (long)(Math.Pow(i, j));
                        delta1 = n - var;

                        if (delta1 > 0)
                        {
                            long m = (long)Math.Pow(delta1, 1 / (double)k);

                            m--;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}+{k}^{m}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}+{k}^{m}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}+{k}^{m}");
                        }

                        //Choice 4
                        var = (long)(Math.Pow(i, j));
                        delta1 = n - var;

                        if (delta1 > 0)
                        {

                            long m = (long)delta1 / k;

                            m--;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}+{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}+{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}+{k}*{m}");
                        }

                        //Choice 5
                        var = (long)(i * j * k);
                        delta1 = n / var;

                        if (var == n)
                            UpdateAns($"{i}*{j}*{k}");

                        if (delta1 * var == n)
                            UpdateAns($"{i}*{j}*{k}*{delta1}");

                        //Choice 6
                        var = (long)(i * j * k);
                        delta1 = n - var;

                        if (delta1 > 0 && delta1 < 1000)
                            UpdateAns($"{i}*{j}*{k}+{delta1}");
                    }

            //3 termeni
            long sqr = (long)Math.Sqrt(n)+1;
            for (i = 2; i <= sqr; i++)
                for(j = 2; j <= 33; j++)
                {
                    if (Math.Pow(i, j) > n)
                        break;

                    long var = (long)Math.Pow(i, j);

                    if (var == n)
                        UpdateAns($"{i}^{j}");

                    //Choice 1
                    long delta1 = n / var;
                    if (delta1 * var == n)
                        UpdateAns($"{i}^{j}*{delta1}");

                    //Choice 2
                    delta1 = n - var;
                    if (delta1 > 0 && delta1 < 100000)
                        UpdateAns($"{i}^{j}+{delta1}");
                }

            for (i = 2; i <= n/2; i++)
                {
                    j = n / i;
                    if (i.ToString().Length + j.ToString().Length + 1 > ans.Length)
                        break;

                    if (i*j > n)
                        break;

                    long var = (long)(i*j);

                    if (var == n)
                        UpdateAns($"{i}*{j}");

                    //Choice 1
                    long delta1 = n / var;
                    if (delta1 * var == n)
                        UpdateAns($"{i}*{j}*{delta1}");

                    //Choice 2
                    delta1 = n - var;
                    if (delta1 > 0 && delta1 < 100000)
                        UpdateAns($"{i}*{j}+{delta1}");
                }

            //2 termeni
            //Inclus in celelalte.

            ioHelper.WriteLine(ans);
            ioHelper.Flush();

            //Console.ReadKey();
        }

        public Program(string inputFile, string outputFile)
        {
            ioHelper = new IOHelper(inputFile, outputFile, Encoding.Default);
            Solve();
            ioHelper.Dispose();
        }

        static void Main(string[] args)
        {
            Program myProgram = new Program(null, null);
        }
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    class IOHelper : IDisposable
    {
        StreamReader reader;
        StreamWriter writer;

        public IOHelper(string inputFile, string outputFile, Encoding encoding)
        {
            StreamReader iReader;
            StreamWriter oWriter;
            if (inputFile == null)
                iReader = new StreamReader(Console.OpenStandardInput(), encoding);
            else
                iReader = new StreamReader(inputFile, encoding);

            if (outputFile == null)
                oWriter = new StreamWriter(Console.OpenStandardOutput(), encoding);
            else
                oWriter = new StreamWriter(outputFile, false, encoding);

            reader = iReader;
            writer = oWriter;

            curLine = new string[] { };
            curTokenIdx = 0;
        }

        string[] curLine;
        int curTokenIdx;

        char[] whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public string ReadNextToken()
        {
            if (curTokenIdx >= curLine.Length)
            {
                //Read next line
                string line = reader.ReadLine();
                if (line != null)
                    curLine = line.Split(whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    curLine = new string[] { };
                curTokenIdx = 0;
            }

            if (curTokenIdx >= curLine.Length)
                return null;

            return curLine[curTokenIdx++];
        }

        public int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        public double ReadNextDouble()
        {
            var nextToken = ReadNextToken();
            var result = 0.0;
            nextToken = nextToken.Replace(".", System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator);
            result = double.Parse(nextToken);
            return result;
        }

        public void Write(string stringToWrite)
        {
            writer.Write(stringToWrite);
        }

        public void WriteLine(string stringToWrite)
        {
            writer.WriteLine(stringToWrite);
        }

        public void WriteLine(double valueToWrite)
        {
            long intPart = (long)valueToWrite;
            double fracPart = valueToWrite - intPart;
            var fracPartStr = fracPart.ToString();
            if (fracPartStr.Length > 1)
                fracPartStr = fracPartStr.Substring(2);
            var strToWrite = string.Format("{0}.{1}", intPart, fracPartStr);
            writer.WriteLine(strToWrite);
        }

        public void Dispose()
        {
            try
            {
                if (reader != null)
                {
                    reader.Dispose();
                }
                if (writer != null)
                {
                    writer.Dispose();
                }
            }
            catch { };
        }

        public void Flush()
        {
            if (writer != null)
            {
                writer.Flush();
            }
        }
    }

    class Program
    {
        protected IOHelper ioHelper;

        long n;

        string ans;

        void UpdateAns(string newAns)
        {
            if (newAns.Length < ans.Length)
                ans = newAns;
        }

        public void Solve()
        {
            string nr = ioHelper.ReadNextToken();
            ans = nr;

            n = long.Parse(nr);

            if (n == 10000000000)
            {
                ans = "10^10";
            }

            long i, j, k, l;

            //5 termeni
            for (i = 1; i <= 9; i++)
                for (j = 1; j <= 9; j++)
                    for (k = 1; k <= 9; k++)
                        for (l = 1; l <= 9; l++)
                        {
                            //Choice 1;
                            long var = (long)(Math.Pow(i, j) * Math.Pow(k, l));
                            long delta = n - var;

                            if (delta == 0)
                                UpdateAns($"{i}^{j}*{k}^{l}");
                            if (delta > 0 && delta <= 9)
                                UpdateAns($"{i}^{j}*{k}^{l}+{delta}");

                            //Choice 1a;
                            var = (long)(Math.Pow(i, j) * Math.Pow(k, l));
                            delta = n / var;

                            if (delta * var == n)
                                UpdateAns($"{i}^{j}*{k}^{l}*{delta}");

                            //Choice 2
                            var = (long)(Math.Pow(i, j) * k * l);
                            delta = n - var;
                            if (delta == 0)
                                UpdateAns($"{i}^{j}*{k}*{l}");
                            if (delta > 0 && delta <= 9)
                                UpdateAns($"{i}^{j}*{k}*{l}+{delta}");

                            //Choice 3
                            var = (long)(Math.Pow(i, j) * k);
                            long delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}^{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)Math.Pow(delta1, 1 / (double)l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}^{l}");
                            }

                            //Choice 4
                            var = (long)(Math.Pow(i, j) * k);
                            delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}^{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)(delta1 / l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}*{l}");
                            }

                            //Choice 5
                            var = (long)(i * j * k * l);
                            delta = n - var;
                            if (delta == 0)
                                UpdateAns($"{i}*{j}*{k}*{l}");
                            if (delta > 0 && delta <= 9)
                                UpdateAns($"{i}*{j}*{k}*{l}+{delta}");

                            //Choice 6
                            var = (long)(i * j * k);
                            delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}*{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)Math.Pow(delta1, 1 / (double)l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}^{l}");
                            }

                            //Choice 7
                            var = (long)(i * j * k);
                            delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}*{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)(delta1 / l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}*{l}");
                            }

                            //Choice 8
                            var = (long)(i * j * k * l);
                            delta = n / var;
                            if (delta == 1 && delta * var == n)
                                UpdateAns($"{i}*{j}*{k}*{l}");
                            if (delta > 0 && delta <= 9 && delta * var == n)
                                UpdateAns($"{i}*{j}*{k}*{l}*{delta}");
                        }

            //4 termeni
            for (i = 1; i <= 999; i++)
                for (j = 1; j <= ((i>=100)?9:((i>=10)?99:999)); j++)
                    for (k = 1; k <= (((i>=10 && j>=10)||(i>=100 || j>=100))?9: ((i>=10 || j >=10)?99:999)); k++)
                    {
                        //Choice 1
                        long var = (long)(Math.Pow(i, j));
                        long delta1 = n / var;

                        if (var == n)
                            UpdateAns($"{i}^{j}");

                        if(delta1 * var == n)
                        {
                            long m = (long)Math.Pow(delta1, 1 / (double)k);

                            m--;
                                if ((long)Math.Pow(m, k) == delta1)
                                    UpdateAns($"{i}^{j}*{k}^{m}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}*{k}^{m}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}*{k}^{m}");
                        }

                        //Choice 2
                        var = (long)(Math.Pow(i, j));
                        delta1 = n / var;

                        if(delta1 * var == n)
                        {

                            long m = (long)delta1/k;

                            m--;
                            if ((long)(m*k) == delta1)
                                UpdateAns($"{i}^{j}*{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}*{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}*{k}*{m}");
                        }

                        //Choice 2a
                        var = (long)(Math.Pow(i, j)*k);
                        delta1 = n - var;

                        if(delta1 > 0 )
                                UpdateAns($"{i}^{j}*{k}+{delta1}");

                        //Choice 3
                        var = (long)(Math.Pow(i, j));
                        delta1 = n - var;

                        if (delta1 > 0)
                        {
                            long m = (long)Math.Pow(delta1, 1 / (double)k);

                            m--;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}+{m}^{k}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}+{m}^{k}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}+{m}^{k}");
                        }

                        //Choice 4
                        var = (long)(Math.Pow(i, j));
                        delta1 = n - var;

                        if (delta1 > 0)
                        {

                            long m = (long)delta1 / k;

                            m--;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}+{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}+{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}+{k}*{m}");
                        }

                        //Choice 5
                        var = (long)(i * j * k);
                        delta1 = n / var;

                        if (var == n)
                            UpdateAns($"{i}*{j}*{k}");

                        if (delta1 * var == n)
                            UpdateAns($"{i}*{j}*{k}*{delta1}");

                        //Choice 6
                        var = (long)(i * j * k);
                        delta1 = n - var;

                        if (delta1 > 0 && delta1 < 1000)
                            UpdateAns($"{i}*{j}*{k}+{delta1}");
                    }

            //3 termeni
            long sqr = (long)Math.Sqrt(n)+1;
            for (i = 2; i <= sqr; i++)
                for(j = 2; j <= 33; j++)
                {
                    if (Math.Pow(i, j) > n)
                        break;

                    long var = (long)Math.Pow(i, j);

                    if (var == n)
                        UpdateAns($"{i}^{j}");

                    //Choice 1
                    long delta1 = n / var;
                    if (delta1 * var == n)
                        UpdateAns($"{i}^{j}*{delta1}");

                    //Choice 2
                    delta1 = n - var;
                    if (delta1 > 0 && delta1 < 100000)
                        UpdateAns($"{i}^{j}+{delta1}");
                }

            for (i = 2; i <= n/2; i++)
                {
                    j = n / i;
                    if (i.ToString().Length + j.ToString().Length + 1 > ans.Length)
                        break;

                    if (i*j > n)
                        break;

                    long var = (long)(i*j);

                    if (var == n)
                        UpdateAns($"{i}*{j}");

                    //Choice 1
                    long delta1 = n / var;
                    if (delta1 * var == n)
                        UpdateAns($"{i}*{j}*{delta1}");

                    //Choice 2
                    delta1 = n - var;
                    if (delta1 > 0 && delta1 < 100000)
                        UpdateAns($"{i}*{j}+{delta1}");
                }

            //2 termeni
            //Inclus in celelalte.

            ioHelper.WriteLine(ans);
            ioHelper.Flush();

            //Console.ReadKey();
        }

        public Program(string inputFile, string outputFile)
        {
            ioHelper = new IOHelper(inputFile, outputFile, Encoding.Default);
            Solve();
            ioHelper.Dispose();
        }

        static void Main(string[] args)
        {
            Program myProgram = new Program(null, null);
        }
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    class IOHelper : IDisposable
    {
        StreamReader reader;
        StreamWriter writer;

        public IOHelper(string inputFile, string outputFile, Encoding encoding)
        {
            StreamReader iReader;
            StreamWriter oWriter;
            if (inputFile == null)
                iReader = new StreamReader(Console.OpenStandardInput(), encoding);
            else
                iReader = new StreamReader(inputFile, encoding);

            if (outputFile == null)
                oWriter = new StreamWriter(Console.OpenStandardOutput(), encoding);
            else
                oWriter = new StreamWriter(outputFile, false, encoding);

            reader = iReader;
            writer = oWriter;

            curLine = new string[] { };
            curTokenIdx = 0;
        }

        string[] curLine;
        int curTokenIdx;

        char[] whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public string ReadNextToken()
        {
            if (curTokenIdx >= curLine.Length)
            {
                //Read next line
                string line = reader.ReadLine();
                if (line != null)
                    curLine = line.Split(whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    curLine = new string[] { };
                curTokenIdx = 0;
            }

            if (curTokenIdx >= curLine.Length)
                return null;

            return curLine[curTokenIdx++];
        }

        public int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        public double ReadNextDouble()
        {
            var nextToken = ReadNextToken();
            var result = 0.0;
            nextToken = nextToken.Replace(".", System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator);
            result = double.Parse(nextToken);
            return result;
        }

        public void Write(string stringToWrite)
        {
            writer.Write(stringToWrite);
        }

        public void WriteLine(string stringToWrite)
        {
            writer.WriteLine(stringToWrite);
        }

        public void WriteLine(double valueToWrite)
        {
            long intPart = (long)valueToWrite;
            double fracPart = valueToWrite - intPart;
            var fracPartStr = fracPart.ToString();
            if (fracPartStr.Length > 1)
                fracPartStr = fracPartStr.Substring(2);
            var strToWrite = string.Format("{0}.{1}", intPart, fracPartStr);
            writer.WriteLine(strToWrite);
        }

        public void Dispose()
        {
            try
            {
                if (reader != null)
                {
                    reader.Dispose();
                }
                if (writer != null)
                {
                    writer.Dispose();
                }
            }
            catch { };
        }

        public void Flush()
        {
            if (writer != null)
            {
                writer.Flush();
            }
        }
    }

    class Program
    {
        protected IOHelper ioHelper;

        long n;

        string ans;

        void UpdateAns(string newAns)
        {
            if (newAns.Length < ans.Length)
                ans = newAns;
        }

        public void Solve()
        {
            string nr = ioHelper.ReadNextToken();
            ans = nr;

            n = long.Parse(nr);

            if (n == 10000000000)
            {
                ans = "10^10";
            }

            long i, j, k, l;

            //5 termeni
            for (i = 1; i <= 9; i++)
                for (j = 1; j <= 9; j++)
                    for (k = 1; k <= 9; k++)
                        for (l = 1; l <= 9; l++)
                        {
                            //Choice 1;
                            long var = (long)(Math.Pow(i, j) * Math.Pow(k, l));
                            long delta = n - var;

                            if (delta == 0)
                                UpdateAns($"{i}^{j}*{k}^{l}");
                            if (delta > 0 && delta <= 9)
                                UpdateAns($"{i}^{j}*{k}^{l}+{delta}");

                            //Choice 1a;
                            var = (long)(Math.Pow(i, j) * Math.Pow(k, l));
                            delta = n / var;

                            if (delta * var == n)
                                UpdateAns($"{i}^{j}*{k}^{l}*{delta}");

                            //Choice 2
                            var = (long)(Math.Pow(i, j) * k * l);
                            delta = n - var;
                            if (delta == 0)
                                UpdateAns($"{i}^{j}*{k}*{l}");
                            if (delta > 0 && delta <= 9)
                                UpdateAns($"{i}^{j}*{k}*{l}+{delta}");

                            //Choice 3
                            var = (long)(Math.Pow(i, j) * k);
                            long delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}^{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)Math.Pow(delta1, 1 / (double)l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}^{l}");
                            }

                            //Choice 4
                            var = (long)(Math.Pow(i, j) * k);
                            delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}^{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)(delta1 / l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}^{j}*{k}+{m}*{l}");
                            }

                            //Choice 5
                            var = (long)(i * j * k * l);
                            delta = n - var;
                            if (delta == 0)
                                UpdateAns($"{i}*{j}*{k}*{l}");
                            if (delta > 0 && delta <= 9)
                                UpdateAns($"{i}*{j}*{k}*{l}+{delta}");

                            //Choice 6
                            var = (long)(i * j * k);
                            delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}*{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)Math.Pow(delta1, 1 / (double)l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}^{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)Math.Pow(m, l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}^{l}");
                            }

                            //Choice 7
                            var = (long)(i * j * k);
                            delta1 = n - var;
                            if (delta1 == 0)
                                UpdateAns($"{i}*{j}*{k}");
                            else if (delta1 > 0)
                            {
                                long m = (long)(delta1 / l);

                                m--;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}*{l}");

                                m++;
                                if (m >= 0 && m <= 9)
                                    if ((long)(m * l) == delta1)
                                        UpdateAns($"{i}*{j}*{k}+{m}*{l}");
                            }

                            //Choice 8
                            var = (long)(i * j * k * l);
                            delta = n / var;
                            if (delta == 1 && delta * var == n)
                                UpdateAns($"{i}*{j}*{k}*{l}");
                            if (delta > 0 && delta <= 9 && delta * var == n)
                                UpdateAns($"{i}*{j}*{k}*{l}*{delta}");
                        }

            //4 termeni
            for (i = 1; i <= 999; i++)
                for (j = 1; j <= ((i>=100)?9:((i>=10)?99:999)); j++)
                    for (k = 1; k <= (((i>=10 && j>=10)||(i>=100 || j>=100))?9: ((i>=10 || j >=10)?99:999)); k++)
                    {
                        //Choice 1
                        long var = (long)(Math.Pow(i, j));
                        long delta1 = n / var;

                        if (var == n)
                            UpdateAns($"{i}^{j}");

                        if(delta1 * var == n)
                        {
                            long m = (long)Math.Pow(delta1, 1 / (double)k);

                            m--;
                                if ((long)Math.Pow(m, k) == delta1)
                                    UpdateAns($"{i}^{j}*{k}^{m}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}*{k}^{m}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}*{k}^{m}");
                        }

                        //Choice 2
                        var = (long)(Math.Pow(i, j));
                        delta1 = n / var;

                        if(delta1 * var == n)
                        {

                            long m = (long)delta1/k;

                            m--;
                            if ((long)(m*k) == delta1)
                                UpdateAns($"{i}^{j}*{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}*{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}*{k}*{m}");
                        }

                        //Choice 3
                        var = (long)(Math.Pow(i, j));
                        delta1 = n - var;

                        if (delta1 > 0)
                        {
                            long m = (long)Math.Pow(delta1, 1 / (double)k);

                            m--;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}+{m}^{k}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}+{m}^{k}");

                            m++;
                            if ((long)Math.Pow(m, k) == delta1)
                                UpdateAns($"{i}^{j}+{m}^{k}");
                        }

                        //Choice 4
                        var = (long)(Math.Pow(i, j));
                        delta1 = n - var;

                        if (delta1 > 0)
                        {

                            long m = (long)delta1 / k;

                            m--;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}+{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}+{k}*{m}");

                            m++;
                            if ((long)(m * k) == delta1)
                                UpdateAns($"{i}^{j}+{k}*{m}");
                        }

                        //Choice 5
                        var = (long)(i * j * k);
                        delta1 = n / var;

                        if (var == n)
                            UpdateAns($"{i}*{j}*{k}");

                        if (delta1 * var == n)
                            UpdateAns($"{i}*{j}*{k}*{delta1}");

                        //Choice 6
                        var = (long)(i * j * k);
                        delta1 = n - var;

                        if (delta1 > 0 && delta1 < 1000)
                            UpdateAns($"{i}*{j}*{k}+{delta1}");
                    }

            //3 termeni
            long sqr = (long)Math.Sqrt(n)+1;
            for (i = 2; i <= sqr; i++)
                for(j = 2; j <= 33; j++)
                {
                    if (Math.Pow(i, j) > n)
                        break;

                    long var = (long)Math.Pow(i, j);

                    if (var == n)
                        UpdateAns($"{i}^{j}");

                    //Choice 1
                    long delta1 = n / var;
                    if (delta1 * var == n)
                        UpdateAns($"{i}^{j}*{delta1}");

                    //Choice 2
                    delta1 = n - var;
                    if (delta1 > 0 && delta1 < 100000)
                        UpdateAns($"{i}^{j}+{delta1}");
                }

            for (i = 2; i <= n/2; i++)
                {
                    j = n / i;
                    if (i.ToString().Length + j.ToString().Length + 1 > ans.Length)
                        break;

                    if (i*j > n)
                        break;

                    long var = (long)(i*j);

                    if (var == n)
                        UpdateAns($"{i}*{j}");

                    //Choice 1
                    long delta1 = n / var;
                    if (delta1 * var == n)
                        UpdateAns($"{i}*{j}*{delta1}");

                    //Choice 2
                    delta1 = n - var;
                    if (delta1 > 0 && delta1 < 100000)
                        UpdateAns($"{i}*{j}+{delta1}");
                }

            //2 termeni
            //Inclus in celelalte.

            ioHelper.WriteLine(ans);
            ioHelper.Flush();

            //Console.ReadKey();
        }

        public Program(string inputFile, string outputFile)
        {
            ioHelper = new IOHelper(inputFile, outputFile, Encoding.Default);
            Solve();
            ioHelper.Dispose();
        }

        static void Main(string[] args)
        {
            Program myProgram = new Program(null, null);
        }
    }
}


sh = {}
for i in range(1, 100):
    for j in range(1, 100):
        if i ** j > 10 ** 10:
            break
        k = i ** j
        v = str(i) + '^' + str(j)
        if len(str(k)) < len(v):
            v = str(k)
        if k not in sh or len(sh[k]) > len(v):
            sh[k] = v

n = input()
ans = str(n)
for a in range(1, 100000):
    for b in range(1, 30):
        if a ** b > n or a == 1 and b > 1:
            break
        for c in range(1, 10):
            for d in range(1, 30):
                if a > 300 and d > 1:
                    break
                if (a ** b) * (c ** d) > n or c == 1 and d > 1:
                    break
                g = n - (a ** b) * (c ** d)

                sa = str(a) if b == 1 else str(a) + '^' + str(b)
                sc = str(c) if d == 1 else str(c) + '^' + str(d)
                x = sa
                x = x if c ** d == 1 else x + '*' + sc
                y = x if g == 0 else x + '+' + str(g)
                if g != 0 and g in sh:
                    y = x + '+' + sh[g]
                if len(y) < len(ans):
                    ans = y
        if a > 300:
            continue
        for e in range(0, 10):
            for f in range(1, 30):
                if (a ** b) + (e ** f) > n or e == 1 and f > 1:
                    break
                if e == 0 and f > 1:
                    break
                if (n - (e ** f)) % (a ** b) != 0:
                    continue
                g = (n - (e ** f)) // (a ** b)
                sa = str(a) if b == 1 else str(a) + '^' + str(b)
                sc = str(g)
                x = sa
                x = x if g == 1 else x + '*' + sc
                y = x if e == 0 else x + '+' + sh[e ** f]
                if len(y) < len(ans):
                    ans = y

print(ans)


# a ^ b * c ^ d + e ^ f
# a ^ b * c ^ d + g

sh = {}
for i in range(1, 100):
    for j in range(1, 100):
        if i ** j > 10 ** 10:
            break
        k = i ** j
        v = str(i) + '^' + str(j)
        if len(str(k)) < len(v):
            v = str(k)
        if k not in sh or len(sh[k]) > len(v):
            sh[k] = v

n = int(input())
ans = str(n)
for a in range(1, 100000):
    for b in range(1, 30):
        if a ** b > n or a == 1 and b > 1:
            break
        for c in range(1, 10):
            for d in range(1, 30):
                if a > 80 and d > 1:
                    break
                if (a ** b) * (c ** d) > n or c == 1 and d > 1:
                    break
                g = n - (a ** b) * (c ** d)

                sa = str(a) if b == 1 else str(a) + '^' + str(b)
                sc = str(c) if d == 1 else str(c) + '^' + str(d)
                x = sa
                x = x if c ** d == 1 else x + '*' + sc
                y = x if g == 0 else x + '+' + str(g)
                if g != 0 and g in sh:
                    y = x + '+' + sh[g]
                if len(y) < len(ans):
                    ans = y
        if a > 80:
            continue
        for e in range(0, 10):
            for f in range(1, 30):
                if (a ** b) + (e ** f) > n or e == 1 and f > 1:
                    break
                if e == 0 and f > 1:
                    break
                if (n - (e ** f)) % (a ** b) != 0:
                    continue
                g = (n - (e ** f)) // (a ** b)
                sa = str(a) if b == 1 else str(a) + '^' + str(b)
                sc = str(g)
                x = sa
                x = x if g == 1 else x + '*' + sc
                y = x if e == 0 else x + '+' + sh[e ** f]
                if len(y) < len(ans):
                    ans = y

print(ans)


# a ^ b * c ^ d + e ^ f
# a ^ b * c ^ d + g

sh = {}
for i in range(1, 100):
    for j in range(1, 100):
        if i ** j > 10 ** 10:
            break
        k = i ** j
        v = str(i) + '^' + str(j)
        if len(str(k)) < len(v):
            v = str(k)
        if k not in sh or len(sh[k]) > len(v):
            sh[k] = v

n = int(input())
ans = str(n)
for a in range(1, 100000):
    for b in range(1, 30):
        if a ** b > n or a == 1 and b > 1:
            break
        for c in range(1, 10):
            for d in range(1, 30):
                if a > 500 and d > 1:
                    break
                if (a ** b) * (c ** d) > n or c == 1 and d > 1:
                    break
                g = n - (a ** b) * (c ** d)

                sa = str(a) if b == 1 else str(a) + '^' + str(b)
                sc = str(c) if d == 1 else str(c) + '^' + str(d)
                x = sa
                x = x if c ** d == 1 else x + '*' + sc
                y = x if g == 0 else x + '+' + str(g)
                if g != 0 and g in sh:
                    y = x + '+' + sh[g]
                if len(y) < len(ans):
                    ans = y
        if a > 1000:
            continue
        for e in range(0, 10):
            for f in range(1, 30):
                if (a ** b) + (e ** f) > n or e == 1 and f > 1:
                    break
                if e == 0 and f > 1:
                    break
                if (n - (e ** f)) % (a ** b) != 0:
                    continue
                g = (n - (e ** f)) // (a ** b)
                sa = str(a) if b == 1 else str(a) + '^' + str(b)
                sc = str(g)
                x = sa
                x = x if g == 1 else x + '*' + sc
                y = x if e == 0 else x + '+' + sh[e ** f]
                if len(y) < len(ans):
                    ans = y

print(ans)


# a ^ b * c ^ d + e ^ f
# a ^ b * c ^ d + g

sh = {}
for i in range(1, 100):
    for j in range(1, 100):
        if i ** j > 10 ** 10:
            break
        k = i ** j
        v = str(i) + '^' + str(j)
        if len(str(k)) < len(v):
            v = str(k)
        if k not in sh or len(sh[k]) > len(v):
            sh[k] = v

n = int(input())
ans = str(n)
for a in range(1, 100000):
    for b in range(1, 30):
        if a ** b > n or a == 1 and b > 1:
            break
        for c in range(1, 10):
            for d in range(1, 30):
                if a > 1000 and d > 1:
                    break
                if (a ** b) * (c ** d) > n or c == 1 and d > 1:
                    break
                g = n - (a ** b) * (c ** d)

                sa = str(a) if b == 1 else str(a) + '^' + str(b)
                sc = str(c) if d == 1 else str(c) + '^' + str(d)
                x = sa
                x = x if c ** d == 1 else x + '*' + sc
                y = x if g == 0 else x + '+' + str(g)
                if g != 0 and g in sh:
                    y = x + '+' + sh[g]
                if len(y) < len(ans):
                    ans = y
        if a > 1000:
            continue
        for e in range(0, 10):
            for f in range(1, 30):
                if (a ** b) + (e ** f) > n or e == 1 and f > 1:
                    break
                if e == 0 and f > 1:
                    break
                if (n - (e ** f)) % (a ** b) != 0:
                    continue
                g = (n - (e ** f)) // (a ** b)
                sa = str(a) if b == 1 else str(a) + '^' + str(b)
                sc = str(g)
                x = sa
                x = x if g == 1 else x + '*' + sc
                y = x if e == 0 else x + '+' + sh[e ** f]
                if len(y) < len(ans):
                    ans = y

print(ans)


# a ^ b * c ^ d + e ^ f
# a ^ b * c ^ d + g

sh = {}
for i in range(1, 100):
    for j in range(1, 100):
        if i ** j > 10 ** 10:
            break
        k = i ** j
        v = str(i) + '^' + str(j)
        if len(str(k)) < len(v):
            v = str(k)
        if k not in sh or len(sh[k]) > len(v):
            sh[k] = v

n = int(input())
ans = str(n)
for a in range(1, 100000):
    for b in range(1, 30):
        if a ** b > n or a == 1 and b > 1:
            break
        for c in range(1, 10):
            for d in range(1, 30):
                if a > 300 and d > 1:
                    break
                if (a ** b) * (c ** d) > n or c == 1 and d > 1:
                    break
                g = n - (a ** b) * (c ** d)

                sa = str(a) if b == 1 else str(a) + '^' + str(b)
                sc = str(c) if d == 1 else str(c) + '^' + str(d)
                x = sa
                x = x if c ** d == 1 else x + '*' + sc
                y = x if g == 0 else x + '+' + str(g)
                if g != 0 and g in sh:
                    y = x + '+' + sh[g]
                if len(y) < len(ans):
                    ans = y
        if a > 300:
            continue
        for e in range(0, 10):
            for f in range(1, 30):
                if (a ** b) + (e ** f) > n or e == 1 and f > 1:
                    break
                if e == 0 and f > 1:
                    break
                if (n - (e ** f)) % (a ** b) != 0:
                    continue
                g = (n - (e ** f)) // (a ** b)
                sa = str(a) if b == 1 else str(a) + '^' + str(b)
                sc = str(g)
                x = sa
                x = x if g == 1 else x + '*' + sc
                y = x if e == 0 else x + '+' + sh[e ** f]
                if len(y) < len(ans):
                    ans = y

print(ans)


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.util.Map;
import java.util.Map.Entry;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author kessido
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        FConciseAndClear solver = new FConciseAndClear();
        solver.solve(1, in, out);
        out.close();
    }

    static class FConciseAndClear {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.NextLong();
            Bunker bunker = new Bunker();
            out.println(bunker.getBest(n));
        }

        class Bunker {
            TreeMap<Long, Expression> hm = new TreeMap<>();

            private Expression get(long n) {
                Expression ret = hm.get(n);
                if (ret == null) ret = new BasicExpression(n);
                return ret;
            }

            private void put(long n, Expression ex) {
                if (ex.length() < IntegerExtention.getStringLength(n)) {
                    Expression exx = hm.get(n);
                    if (exx == null || exx.length() > ex.length()) {
                        hm.put(n, ex);
                    }
                }
            }

            private void addAllPowers(long n) {
                for (long i = 2; i * i <= n; i++) {
                    for (int j = 2; ; j++) {
                        Expression nex = new PowerExpression(i, j);
                        long x = nex.val();
                        if (x > n) break;
                        put(x, nex);
                    }
                }
            }

            private Expression findBestAdd(Expression best, long n) {
                for (Expression exp : hm.values()) {
                    long x = exp.val();
                    long needed = n - x;
                    Map.Entry<Long, Expression> exp2 = hm.floorEntry(needed);
                    if (exp2 == null) break;
                    Expression exp22 = exp2.getValue();
                    Expression addsExp = new AddExpression(exp, exp22);
                    x = addsExp.val();
                    if (n != x) {
                        addsExp = new AddExpression(new BasicExpression(n - x), addsExp);
                    }
                    best = best(best, addsExp);
                }
                return best;
            }

            private Expression findBestMult(Expression best, long n) {
                for (Expression expresion : hm.values()) {
                    Expression mult = expresion;
                    long x = expresion.val();
                    long nx = n / x;
                    if (nx > 1) {
                        mult = new MultiplyExpression(new BasicExpression(nx), mult);
                        x *= nx;
                    }
                    if (n != x) {
                        mult = new AddExpression(mult, get(n - x));
                    }
                    best = best(best, mult);
                }
                return best;
            }

            private Expression best(Expression o, Expression o1) {
                return (o1 == null || (o != null && o1.length() < o.length())) ? o1 : o;
            }

            private Expression findBestMult2(Expression best, long n) {
                for (Expression expresion : hm.values()) {
                    Expression mult = expresion;
                    long x = mult.val();
                    long needed = n / x;
                    Map.Entry<Long, Expression> multByEntry = hm.floorEntry(needed);
                    if (multByEntry == null) break;
                    Expression multBy = multByEntry.getValue();
                    mult = new MultiplyExpression(mult, multBy);
                    x = mult.val();
                    if (x != n) {
                        mult = new AddExpression(mult, new BasicExpression(n - x));
                    }
                    best = best(mult, best);
                }
                return best;
            }

            private Expression getBest(long n) {
                hm.clear();
                addAllPowers(n);
                Expression best = new BasicExpression(n);
                best = findBestAdd(best, n);
                best = findBestMult(best, n);
                best = findBestMult2(best, n);
                return best;
            }

        }

    }

    static class PowerExpression extends TwoSideExpression {
        public PowerExpression(Expression left, Expression right) {
            super(left, right);
        }

        public PowerExpression(long left, long right) {
            super(left, right);
        }

        public long val() {
            return MathExtentions.power(left.val(), right.val());
        }

        public String toString() {
            return left + "^" + right;
        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine(), " \t\n\r\f,");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long NextLong() {
            return Long.parseLong(next());
        }

    }

    static class IntegerExtention {
        public static int getStringLength(long n) {
            int res = 1;
            n /= 10;
            while (n != 0) {
                res++;
                n /= 10;
            }
            return res;
//        if (n >= 1_000_000_000_0L) {//11 - 19
//            if (n >= 1_000_000_000_000_000L) {//16 - 19
//                if (n >= 1_000_000_000_000_000_00L) {//18 - 19
//                    if (n >= 1_000_000_000_000_000_000L) {//19
//                        return 19;
//                    } else { // 18
//                        return 18;
//                    }
//                } else { // 16 - 17
//                    if (n >= 1_000_000_000_000_000_0L) {//17
//                        return 17;
//                    } else {//16
//                        return 16;
//                    }
//                }
//            } else {// 11-15
//                if (n >= 1_000_000_000_000L) {// 13 - 15
//                    if (n >= 1_000_000_000_000_00L) {// 15
//                        return 15;
//                    } else {//13 - 14
//                        if (n >= 1_000_000_000_000_0L) { // 14
//                            return 14;
//                        } else {
//                            return 13;
//                        }
//                    }
//                } else { //11 - 12
//                    if (n >= 1_000_000_000_00L) {
//                        return 12;
//                    } else {
//                        return 11;
//                    }
//                }
//            }
//        } else { // 1 - 10
//            if (n >= 1_000_00L) { // 6 - 10
//                if (n >= 1_000_000_00L) { // 9 - 10
//                    if (n >= 1_000_000_000L) { // 10
//                        return 10;
//                    } else {
//                        return 9;
//                    }
//                } else { // 6 - 8
//                    if (n >= 1_000_000_0L) { // 8
//                        return 8;
//                    } else { // 6 - 7
//                        if (n >= 1_000_000L) { // 7
//                            return 7;
//                        } else { // 6
//                            return 6;
//                        }
//                    }
//                }
//            } else { // 1 - 5
//                if (n >= 1_00L) { // 3 - 5
//                    if (n >= 1_000_0L) { // 5
//                        return 5;
//                    } else { // 3 - 4
//                        if (n >= 1_000L) { // 4
//                            return 4;
//                        } else {
//                            return 3;
//                        }
//                    }
//                } else {// 1 - 2
//                    if (n >= 1_0L) { // 2
//                        return 2;
//                    } else { // 1
//                        return 1;
//                    }
//                }
//            }
//        }
        }

    }

    static class AddExpression extends TwoSideExpression {
        public AddExpression(Expression left, Expression right) {
            super(left, right);
        }

        public AddExpression(long left, long right) {
            super(left, right);
        }

        public long val() {
            return left.val() + right.val();
        }

        public String toString() {
            return left + "+" + right;
        }

    }

    static abstract class TwoSideExpression implements Expression {
        protected final Expression left;
        protected final Expression right;

        public TwoSideExpression(Expression left, Expression right) {
            this.left = left;
            this.right = right;
        }

        public TwoSideExpression(long left, long right) {
            this(new BasicExpression(left), new BasicExpression(right));
        }

        public int length() {
            return left.length() + right.length() + 1;
        }

    }

    static class MathExtentions {
        public static long power(final long x, final long y) {
            if (y == 0)
                return 1;

            long p = power(x, y / 2);
            p = (p * p);

            if (y % 2 == 0)
                return p;
            else
                return (x * p);
        }

    }

    static interface Expression {
        long val();

        int length();

        String toString();

    }

    static class MultiplyExpression extends TwoSideExpression {
        public MultiplyExpression(Expression left, Expression right) {
            super(left, right);
        }

        public MultiplyExpression(long left, long right) {
            super(left, right);
        }

        public long val() {
            return left.val() * right.val();
        }

        public String toString() {
            return left + "*" + right;
        }

    }

    static class BasicExpression implements Expression {
        private final long n;

        public BasicExpression(long n) {
            this.n = n;
        }

        public long val() {
            return n;
        }

        public int length() {
            return IntegerExtention.getStringLength(n);
        }

        public String toString() {
            return Long.toString(n);
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.util.Map;
import java.util.Map.Entry;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author kessido
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        FConciseAndClear solver = new FConciseAndClear();
        solver.solve(1, in, out);
        out.close();
    }

    static class FConciseAndClear {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.NextLong();
            Bunker bunker = new Bunker();
            out.println(bunker.getBest(n));
        }

        public static abstract class Expresion {
            abstract long val();

            abstract int length();

            public static int length(long x) {
                int res = 0;
                while (x != 0) {
                    res++;
                    x /= 10;
                }
                return res;
            }

        }

        public static class SimpleExpresion extends FConciseAndClear.Expresion {
            long base;

            public SimpleExpresion(long base) {
                this.base = base;
            }

            long val() {
                return base;
            }

            int length() {
                return FConciseAndClear.Expresion.length(base);
            }

            public String toString() {
                return "" + base;
            }

        }

        public static class PowerExpresion extends FConciseAndClear.Expresion {
            long base;
            long exp;

            public PowerExpresion(long base, long exp) {
                this.base = base;
                this.exp = exp;
            }

            public long val() {
                return MathExtentions.power(base, exp);
            }

            public int length() {
                return FConciseAndClear.Expresion.length(base) + 1 + FConciseAndClear.Expresion.length(exp);
            }

            public String toString() {
                return "" + base + "^" + exp;
            }

        }

        public static class MultiplicationExpresion extends FConciseAndClear.Expresion {
            FConciseAndClear.Expresion left;
            FConciseAndClear.Expresion right;

            public MultiplicationExpresion(FConciseAndClear.Expresion left, FConciseAndClear.Expresion right) {
                this.left = left;
                this.right = right;
            }

            long val() {
                return left.val() * right.val();
            }

            int length() {
                return left.length() + right.length() + 1;
            }

            public String toString() {
                return left + "*" + right;
            }

        }

        public static class AddExpresion extends FConciseAndClear.Expresion {
            FConciseAndClear.Expresion left;
            FConciseAndClear.Expresion right;

            public AddExpresion(FConciseAndClear.Expresion left, FConciseAndClear.Expresion right) {
                this.left = left;
                this.right = right;
            }

            long val() {
                return left.val() + right.val();
            }

            int length() {
                return left.length() + right.length() + 1;
            }

            public String toString() {
                return left + "+" + right;
            }

        }

        class Bunker {
            TreeMap<Long, FConciseAndClear.Expresion> hm = new TreeMap<>();

            private FConciseAndClear.Expresion get(long n) {
                FConciseAndClear.Expresion ret = hm.get(n);
                if (ret == null) ret = new FConciseAndClear.SimpleExpresion(n);
                return ret;
            }

            private void put(long n, FConciseAndClear.Expresion ex) {
                if (ex.length() < FConciseAndClear.Expresion.length(n)) {
                    FConciseAndClear.Expresion exx = hm.get(n);
                    if (exx == null || exx.length() > ex.length()) {
                        hm.put(n, ex);
                    }
                }
            }

            private void addAllPowers(long n) {
                for (long i = 2; i * i <= n; i++) {
                    for (int j = 2; ; j++) {
                        FConciseAndClear.Expresion nex = new FConciseAndClear.PowerExpresion(i, j);
                        long x = nex.val();
                        if (x > n) break;
                        put(x, nex);
                    }
                }
            }

            private FConciseAndClear.Expresion findBestAdd(FConciseAndClear.Expresion best, long n) {
                for (FConciseAndClear.Expresion exp : hm.values()) {
                    long x = exp.val();
                    long needed = n - x;
                    Map.Entry<Long, FConciseAndClear.Expresion> exp2 = hm.floorEntry(needed);
                    if (exp2 == null) break;
                    FConciseAndClear.Expresion exp22 = exp2.getValue();
                    FConciseAndClear.Expresion addsExp = new FConciseAndClear.AddExpresion(exp, exp22);
                    x = addsExp.val();
                    if (n != x) {
                        addsExp = new FConciseAndClear.AddExpresion(new FConciseAndClear.SimpleExpresion(n - x), addsExp);
                    }
                    best = best(best, addsExp);
                }
                return best;
            }

            private FConciseAndClear.Expresion findBestMult(FConciseAndClear.Expresion best, long n) {
                for (FConciseAndClear.Expresion expresion : hm.values()) {
                    FConciseAndClear.Expresion mult = expresion;
                    long x = expresion.val();
                    long nx = n / x;
                    if (nx > 1) {
                        mult = new FConciseAndClear.MultiplicationExpresion(new FConciseAndClear.SimpleExpresion(nx), mult);
                        x *= nx;
                    }
                    if (n != x) {
                        mult = new FConciseAndClear.AddExpresion(mult, get(n - x));
                    }
                    best = best(best, mult);
                }
                return best;
            }

            private FConciseAndClear.Expresion best(FConciseAndClear.Expresion o, FConciseAndClear.Expresion o1) {
                return (o1 == null || (o != null && o1.length() < o.length())) ? o1 : o;
            }

            private FConciseAndClear.Expresion findBestMult2(FConciseAndClear.Expresion best, long n) {
                for (FConciseAndClear.Expresion expresion : hm.values()) {
                    FConciseAndClear.Expresion mult = expresion;
                    long x = mult.val();
                    long needed = n / x;
                    Map.Entry<Long, FConciseAndClear.Expresion> multByEntry = hm.floorEntry(needed);
                    if (multByEntry == null) break;
                    FConciseAndClear.Expresion multBy = multByEntry.getValue();
                    mult = new FConciseAndClear.MultiplicationExpresion(mult, multBy);
                    x = mult.val();
                    if (x != n) {
                        mult = new FConciseAndClear.AddExpresion(mult, new FConciseAndClear.SimpleExpresion(n - x));
                    }
                    best = best(mult, best);
                }
                return best;
            }

            private FConciseAndClear.Expresion getBest(long n) {
                hm.clear();
                addAllPowers(n);
                FConciseAndClear.Expresion best = new FConciseAndClear.SimpleExpresion(n);
                best = findBestAdd(best, n);
                best = findBestMult(best, n);
                best = findBestMult2(best, n);
                return best;
            }

        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine(), " \t\n\r\f,");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long NextLong() {
            return Long.parseLong(next());
        }

    }

    static class MathExtentions {
        public static long power(final long x, final long y) {
            if (y == 0)
                return 1;

            long p = power(x, y / 2);
            p = (p * p);

            if (y % 2 == 0)
                return p;
            else
                return (x * p);
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.util.Map;
import java.util.Map.Entry;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author kessido
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        FConciseAndClear solver = new FConciseAndClear();
        solver.solve(1, in, out);
        out.close();
    }

    static class FConciseAndClear {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.NextLong();
            Bunker bunker = new Bunker();
            out.println(bunker.getBest(n));
        }

        class Bunker {
            TreeMap<Long, Expression> hm = new TreeMap<>();

            private Expression get(long n) {
                Expression ret = hm.get(n);
                if (ret == null) ret = new BasicExpression(n);
                return ret;
            }

            private void put(long n, Expression ex) {
                if (ex.length() < IntegerExtention.getStringLength(n)) {
                    Expression exx = hm.get(n);
                    if (exx == null || exx.length() > ex.length()) {
                        hm.put(n, ex);
                    }
                }
            }

            private void addAllPowers(long n) {
                for (long i = 2; i * i <= n; i++) {
                    for (int j = 2; ; j++) {
                        Expression nex = new PowerExpression(i, j);
                        long x = nex.val();
                        if (x > n) break;
                        put(x, nex);
                    }
                }
            }

            private Expression findBestAdd(Expression best, long n) {
                for (Expression exp : hm.values()) {
                    long x = exp.val();
                    long needed = n - x;
                    Map.Entry<Long, Expression> exp2 = hm.floorEntry(needed);
                    if (exp2 == null) break;
                    Expression exp22 = exp2.getValue();
                    Expression addsExp = new AddExpression(exp, exp22);
                    x = addsExp.val();
                    if (n != x) {
                        addsExp = new AddExpression(new BasicExpression(n - x), addsExp);
                    }
                    best = best(best, addsExp);
                }
                return best;
            }

            private Expression findBestMult(Expression best, long n) {
                for (Expression expresion : hm.values()) {
                    Expression mult = expresion;
                    long x = expresion.val();
                    long nx = n / x;
                    if (nx > 1) {
                        mult = new MultiplyExpression(new BasicExpression(nx), mult);
                        x *= nx;
                    }
                    if (n != x) {
                        mult = new AddExpression(mult, get(n - x));
                    }
                    best = best(best, mult);
                }
                return best;
            }

            private Expression best(Expression o, Expression o1) {
                return (o1 == null || (o != null && o1.length() < o.length())) ? o1 : o;
            }

            private Expression findBestMult2(Expression best, long n) {
                for (Expression expresion : hm.values()) {
                    Expression mult = expresion;
                    long x = mult.val();
                    long needed = n / x;
                    Map.Entry<Long, Expression> multByEntry = hm.floorEntry(needed);
                    if (multByEntry == null) break;
                    Expression multBy = multByEntry.getValue();
                    mult = new MultiplyExpression(mult, multBy);
                    x = mult.val();
                    if (x != n) {
                        mult = new AddExpression(mult, new BasicExpression(n - x));
                    }
                    best = best(mult, best);
                }
                return best;
            }

            private Expression getBest(long n) {
                hm.clear();
                addAllPowers(n);
                Expression best = new BasicExpression(n);
                best = findBestAdd(best, n);
                best = findBestMult(best, n);
                best = findBestMult2(best, n);
                return best;
            }

        }

    }

    static class PowerExpression extends TwoSideExpression {
        public PowerExpression(Expression left, Expression right) {
            super(left, right);
        }

        public PowerExpression(long left, long right) {
            super(left, right);
        }

        public long val() {
            return MathExtentions.power(left.val(), right.val());
        }

        public String toString() {
            return left + "^" + right;
        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine(), " \t\n\r\f,");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long NextLong() {
            return Long.parseLong(next());
        }

    }

    static class IntegerExtention {
        public static int getStringLength(long n) {
            if (n >= 1_000_000_000_0L) {//11 - 19
                if (n >= 1_000_000_000_000_000L) {//16 - 19
                    if (n >= 1_000_000_000_000_000_00L) {//18 - 19
                        if (n >= 1_000_000_000_000_000_000L) {//19
                            return 19;
                        } else { // 18
                            return 18;
                        }
                    } else { // 16 - 17
                        if (n >= 1_000_000_000_000_000_0L) {//17
                            return 17;
                        } else {//16
                            return 16;
                        }
                    }
                } else {// 11-15
                    if (n >= 1_000_000_000_000L) {// 13 - 15
                        if (n >= 1_000_000_000_000_00L) {// 15
                            return 15;
                        } else {//13 - 14
                            if (n >= 1_000_000_000_000_0L) { // 14
                                return 14;
                            } else {
                                return 13;
                            }
                        }
                    } else { //11 - 12
                        if (n >= 1_000_000_000_00L) {
                            return 12;
                        } else {
                            return 11;
                        }
                    }
                }
            } else { // 1 - 10
                if (n >= 1_000_00L) { // 6 - 10
                    if (n >= 1_000_000_00L) { // 9 - 10
                        if (n >= 1_000_000_000L) { // 10
                            return 10;
                        } else {
                            return 9;
                        }
                    } else { // 6 - 8
                        if (n >= 1_000_000_0L) { // 8
                            return 8;
                        } else { // 6 - 7
                            if (n >= 1_000_000L) { // 7
                                return 7;
                            } else { // 6
                                return 6;
                            }
                        }
                    }
                } else { // 1 - 5
                    if (n >= 1_00L) { // 3 - 5
                        if (n >= 1_000_0L) { // 5
                            return 5;
                        } else { // 3 - 4
                            if (n >= 1_000L) { // 4
                                return 4;
                            } else {
                                return 3;
                            }
                        }
                    } else {// 1 - 2
                        if (n >= 1_0L) { // 2
                            return 2;
                        } else { // 1
                            return 1;
                        }
                    }
                }
            }
        }

    }

    static class AddExpression extends TwoSideExpression {
        public AddExpression(Expression left, Expression right) {
            super(left, right);
        }

        public AddExpression(long left, long right) {
            super(left, right);
        }

        public long val() {
            return left.val() + right.val();
        }

        public String toString() {
            return left + "+" + right;
        }

    }

    static abstract class TwoSideExpression implements Expression {
        protected final Expression left;
        protected final Expression right;

        public TwoSideExpression(Expression left, Expression right) {
            this.left = left;
            this.right = right;
        }

        public TwoSideExpression(long left, long right) {
            this(new BasicExpression(left), new BasicExpression(right));
        }

        public int length() {
            return left.length() + right.length() + 1;
        }

    }

    static class MathExtentions {
        public static long power(final long x, final long y) {
            if (y == 0)
                return 1;

            long p = power(x, y / 2);
            p = (p * p);

            if (y % 2 == 0)
                return p;
            else
                return (x * p);
        }

    }

    static interface Expression {
        long val();

        int length();

        String toString();

    }

    static class MultiplyExpression extends TwoSideExpression {
        public MultiplyExpression(Expression left, Expression right) {
            super(left, right);
        }

        public MultiplyExpression(long left, long right) {
            super(left, right);
        }

        public long val() {
            return left.val() * right.val();
        }

        public String toString() {
            return left + "*" + right;
        }

    }

    static class BasicExpression implements Expression {
        private final long n;

        public BasicExpression(long n) {
            this.n = n;
        }

        public long val() {
            return n;
        }

        public int length() {
            return IntegerExtention.getStringLength(n);
        }

        public String toString() {
            return Long.toString(n);
        }

    }
}


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));
        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);
    }
}