#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long int num[100010];
map<long long int, pair<long long int, long long int>> smap;
long long int mod(long long int org, long long int div) {
  long long int fin = org / div;
  long long int next = org - (fin * div);
  return next;
}
int main() {
  long long int n;
  cin >> n;
  for (long long int i = 1; i * i <= n; i++) {
    if (i >= 100000)
      num[i] = 6;
    else if (i >= 10000)
      num[i] = 5;
    else if (i >= 1000)
      num[i] = 4;
    else if (i >= 100)
      num[i] = 3;
    else if (i >= 10)
      num[i] = 2;
    else
      num[i] = 1;
  }
  long long int min = to_string(n).size(), len;
  long long int m, b, p, a;
  vector<long long int> mu;
  vector<pair<long long int, long long int>> po;
  vector<long long int> ad;
  for (long long int i = 2; i * i <= n; i++) {
    long long int mult, base, pow, add;
    base = i;
    long long int sum = i;
    long long int cont = 2;
    while (sum * i <= n) {
      len = 0;
      sum *= i;
      pow = cont;
      mult = n / sum;
      add = mod(n, sum);
      cont++;
      if (smap[sum].first == 0) {
        smap[sum] = make_pair(base, pow);
      } else {
        if ((num[base] + num[pow]) <
            (num[smap[sum].first] + num[smap[sum].second]))
          smap[sum] = make_pair(base, pow);
      }
      mu.push_back(mult);
      po.push_back({base, pow});
      ad.push_back(add);
    }
  }
  long long int mlen = to_string(n).size(), loc = 0;
  for (int i = 0; i < mu.size(); i++) {
    long long int len = 0;
    long long int nlen, npen;
    if (mu[i] > 1) {
      nlen = num[smap[mu[i]].first] + num[smap[mu[i]].second] + 1;
      npen = to_string(mu[i]).size();
      if (smap[mu[i]].first != 0 && nlen < npen)
        len += nlen + 1;
      else
        len += npen + 1;
    }
    len += num[po[i].first] + num[po[i].second] + 1;
    if (ad[i] > 0) {
      nlen = num[smap[ad[i]].first] + num[smap[ad[i]].second] + 1;
      npen = to_string(ad[i]).size();
      if (smap[ad[i]].first != 0 && nlen < npen)
        len += nlen + 1;
      else
        len += npen + 1;
    }
    if (mlen > len) {
      mlen = len;
      loc = i;
    }
  }
  if (mlen == to_string(n).size()) {
    cout << n << endl;
  } else {
    long long int nlen, npen;
    if (mu[loc] > 1) {
      nlen = num[smap[mu[loc]].first] + num[smap[mu[loc]].second] + 1;
      npen = to_string(mu[loc]).size();
      if (smap[mu[loc]].first != 0 && nlen < npen)
        cout << smap[mu[loc]].first << "^" << smap[mu[loc]].second << "*";
      else
        cout << mu[loc] << "*";
    }
    cout << po[loc].first << "^" << po[loc].second;
    if (ad[loc] > 0) {
      nlen = num[smap[ad[loc]].first] + num[smap[ad[loc]].second] + 1;
      npen = to_string(ad[loc]).size();
      if (smap[ad[loc]].first != 0 && nlen < npen)
        cout << "+" << smap[ad[loc]].first << "^" << smap[ad[loc]].second;
      else
        cout << "+" << ad[loc];
    }
    cout << endl;
  }
}
