#include <bits/stdc++.h>
using namespace std;
void guan() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const int maxn = 1000010;
const long long mod = 1e9 + 7;
const long long mod2 = mod - 1;
const int INF = 0x7FFFFFFF;
const long long LINF = 0x7FFFFFFFFFFFFFFF;
const double pi = acos(-1.0);
const long long maxx = 1LL << 61;
const double eps = 1e-7;
int m, k;
long long n;
char s[maxn];
inline int read() { return cin >> n ? 1 : 0; }
typedef struct Node {
  int a, b, len;
} node;
map<long long, string> f;
int num = 0;
inline int len(long long x) {
  num = 0;
  while (x) ++num, x /= 10;
  return num;
}
void solve() {
  f.clear();
  long long pos = 2;
  node t;
  long long temp, i;
  string a, b, c;
  while (pos * pos <= n) {
    temp = pos;
    i = 1;
    a = to_string(pos);
    while (temp <= n) {
      b = to_string(i);
      c = a + "^" + b;
      if (!f.count(temp) || c.length() < f[temp].length()) f[temp] = c;
      temp *= pos;
      ++i;
    }
    ++pos;
  }
  string anss = to_string(n);
  string tanss;
  int ansl = anss.length();
  int tansl;
  long long A, B, C;
  string sA, sC;
  for (auto it : f) {
    A = n / it.first, B = it.first, C = n % it.first;
    sA = to_string(A), sC = to_string(C);
    tanss.clear();
    tansl = 0;
    if (A != 1) {
      if (f.count(A) && f[A].length() < sA.length())
        tanss += f[A] + "*";
      else
        tanss += sA + "*";
    }
    tanss += it.second;
    if (C) {
      if (f.count(C) && f[C].length() < sC.length())
        tanss += "+" + f[C];
      else
        tanss += "+" + sC;
    }
    if (tanss.length() < anss.length()) anss = tanss;
  }
  cout << anss << endl;
}
int main() {
  guan();
  int t = 1;
  while (t--) {
    while (read()) solve();
  }
  return 0;
}
