#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const long long INF = 1e9 + 47;
const long long LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int get(string s) {
  int res = 0;
  for (auto i : s)
    if (i != '.') res = res * 10 + i - '0';
  return res;
}
const long double EPS = 1e-6;
int cmp(long double x, long double y) {
  if (abs(x - y) < EPS) return 0;
  if (x < y)
    return 1;
  else
    return -1;
}
pair<long double, int> get(long double x, long double y, long double z) {
  if (abs(x - 1) < EPS) return {1.0, 1};
  if (x > 1) {
    long double pw = z * log(y);
    int id = 1;
    if (cmp(pw, y * log(z)) == 1) pw = y * log(z), id = 2;
    if (cmp(pw, log(y) + log(z)) == 1) pw = log(y) + log(z), id = 3;
    return {pw, id};
  } else {
    long double pw = z * log(y);
    int id = 1;
    if (cmp(pw, y * log(z)) == -1) pw = y * log(z), id = 2;
    if (cmp(pw, log(y) + log(z)) == -1) pw = log(y) + log(z), id = 3;
    return {pw, id};
  }
}
int cmp(pair<long double, long double> x, pair<long double, long double> y) {
  long double valx = log(x.first) * exp(x.second);
  long double valy = log(y.first) * exp(y.second);
  if (abs(valx - valy) < EPS) return 1;
  return valx > valy;
}
void solve(int x) {
  string s;
  if (x == 1) s = "x^y^z";
  if (x == 2) s = "x^z^y";
  if (x == 3) s = "(x^y)^z";
  if (x == 5) s = "y^x^z";
  if (x == 6) s = "y^z^x";
  if (x == 7) s = "(y^x)^z";
  if (x == 9) s = "z^x^y";
  if (x == 10) s = "z^y^x";
  if (x == 11) s = "(z^x)^y";
  cout << s << endl;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string first, second, Z;
  cin >> first >> second >> Z;
  long double x = get(first) / 10.0;
  long double y = get(second) / 10.0;
  long double z = get(Z) / 10.0;
  auto mxx = get(x, y, z);
  auto mxy = get(y, x, z);
  auto mxz = get(z, x, y);
  if (cmp({x, mxx.first}, {y, mxy.first})) {
    if (cmp({x, mxx.first}, {z, mxz.first}))
      solve(mxx.second);
    else
      solve(mxz.second + 8);
  } else {
    if (cmp({y, mxy.first}, {z, mxz.first}))
      solve(mxy.second + 4);
    else
      solve(mxz.second + 8);
  }
  cerr << "Time elapsed: " << clock() / (long double)CLOCKS_PER_SEC << endl;
  return 0;
}
