#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


void outPut(int num){
	if(num < 0){
		printf("(x-%d)",abs(num));
	}else{
		printf("(x+%d)",num);
	}
}

int main(){

	int ans_keisu[6];
	for(int i = 0; i <= 5; i++)ans_keisu[i] = 0;

	char buf[1000];
	scanf("%s",buf);

	int max_rank = buf[2]-'0';
	ans_keisu[max_rank] = 1;

	int index = 3,keisu;

	while(buf[index] != '\0'){
		if(buf[index] == '+'){
			if(buf[index+1] == 'x'){
				keisu = 1;
				if(buf[index+2] == '^'){
					ans_keisu[buf[index+3]-'0'] = keisu;
					index += 4;
				}else{
					ans_keisu[1] = keisu;
					index += 2;
				}
			}else{
				keisu = 0;
				for(++index; buf[index] >= '0' && buf[index] <= '9'; index++){
					keisu = 10*keisu + buf[index]-'0';
				}
				if(buf[index] == 'x'){
					if(buf[index+1] == '^'){
						ans_keisu[buf[index+2]-'0'] = keisu;
						index += 3;
					}else{
						ans_keisu[1] = keisu;
						index += 1;
					}
				}else{
					ans_keisu[0] = keisu;
				}
			}
		}else{ //buf[index] == '-'
			if(buf[index+1] == 'x'){
				keisu = -1;
				if(buf[index+2] == '^'){
					ans_keisu[buf[index+3]-'0'] = keisu;
					index += 4;
				}else{
					ans_keisu[1] = keisu;
					index += 2;
				}
			}else{
				keisu = 0;
				for(++index; buf[index] >= '0' && buf[index] <= '9'; index++){
					keisu = 10*keisu + buf[index]-'0';
				}
				if(buf[index] == 'x'){
					if(buf[index+1] == '^'){
						ans_keisu[buf[index+2]-'0'] = -keisu;
						index += 3;
					}else{
						ans_keisu[1] = -keisu;
						index += 1;
					}
				}else{
					ans_keisu[0] = -keisu;
				}
			}
		}
	}

	int left = -(abs(ans_keisu[0]));
	int right = abs(ans_keisu[0]);

	switch(max_rank){
	case 2:
		for(int a = left; a <= right; a++){
			if(a == 0 || ans_keisu[0]%a != 0)continue;
			for(int b = a; b <= right; b++){
				if(a+b == ans_keisu[1] && a*b == ans_keisu[0]){
					outPut(a);
					outPut(b);
					printf("\n");
					return 0;
				}
			}
		}
		break;
	case 3:
		for(int a = left; a <= right; a++){
			if(a == 0 || ans_keisu[0]%a != 0)continue;
			for(int b = a; b <= right; b++){
				if(b == 0 || ans_keisu[0]%(a*b) != 0)continue;
				for(int c = b; c <= right; c++){
					if(a+b+c == ans_keisu[2] && (a*b+b*c+c*a) == ans_keisu[1] && a*b*c == ans_keisu[0]){
						outPut(a);
						outPut(b);
						outPut(c);
						printf("\n");
						return 0;
					}
				}
			}
		}
		break;
	case 4:
		for(int a = left; a <= right; a++){
			if(a == 0 || ans_keisu[0]%a != 0)continue;
			for(int b = a; b <= right; b++){
				if(b == 0 || ans_keisu[0]%(a*b) != 0)continue;
				for(int c = b; c <= right; c++){
					if(c == 0 || ans_keisu[0]%(a*b*c) != 0)continue;
					for(int d = c; d <= right; d++){
						if(a+b+c+d == ans_keisu[3] && (a*b+b*c+c*a+a*d+b*d+c*d) == ans_keisu[2] &&
								(a*b*d+b*c*d+c*a*d+a*b*c) == ans_keisu[1] && (a*b*c*d) == ans_keisu[0]){
							outPut(a);
							outPut(b);
							outPut(c);
							outPut(d);
							printf("\n");
							return 0;
						}
					}
				}
			}
		}
		break;
	case 5:
		for(int a = left; a <= right; a++){
			if(a == 0 || ans_keisu[0]%a != 0)continue;
			for(int b = a; b <= right; b++){
				if(b == 0 || ans_keisu[0]%(a*b) != 0)continue;
				for(int c = b; c <= right; c++){
					if(c == 0 || ans_keisu[0]%(a*b*c) != 0)continue;
					for(int d = c; d <= right; d++){
						if(d == 0 || ans_keisu[0]%(a*b*c*d) != 0)continue;
						for(int e = d; e <= right; e++){
							if((a+b+c+d+e) == ans_keisu[4] && (a*b+b*c+c*a+a*d+b*d+c*d+a*e+b*e+c*e+d*e) == ans_keisu[3] &&
									(a*b*d+b*c*d+c*a*d+a*b*c+a*b*e+a*c*e+a*d*e+b*c*e+b*d*e+c*d*e) == ans_keisu[2] &&
									(a*b*c*d+a*b*c*e+a*b*d*e+a*c*d*e+b*c*d*e) == ans_keisu[1] &&
									(a*b*c*d*e) == ans_keisu[0]){
								outPut(a);
								outPut(b);
								outPut(c);
								outPut(d);
								outPut(e);
								printf("\n");
								return 0;
							}
						}
					}
				}
			}
		}
		break;
	}
	return 0;
}

Measured memory_bytes: 3212