#include <fstream>
#include <algorithm>
using namespace std;
FILE *f=fopen("ecuatie.in","r");
FILE *g=fopen("ecuatie.out","w");
struct vector
{
int p1,q1,p2,q2;
} q[1000];
int A,B,C,K,l;
double X1,X2;
long long delta;
bool stop;
struct sorting1
{
bool operator () (const vector& lhs , const vector& rhs)
{
if (lhs.p1 == rhs.p1)
return lhs.q1 == rhs.q1;
return lhs.p1 == rhs.p1;
}
};
struct sorting
{
bool operator () (const vector& lhs , const vector& rhs)
{
if (lhs.p1 == rhs.p1)
return lhs.q1 < rhs.q1;
return lhs.p1 < rhs.p1;
}
};
inline int mod(int x,int y)
{
return x-y*(x/y);
}
inline void calcul()
{
int i,cnt;
delta=(long long) ((long long)B*B-(long long )(A*C<<2));
for ( i = 1, cnt = (1<<16) ; cnt; cnt >>=1)
if ((long long) (i + cnt) * (i + cnt) <= delta) i += cnt;
if (i*i==delta) delta=i;
else stop=1;
X1=(double)((-B-delta)/(A*2.0));
X2=(double)((-B+delta)/(A*2.0));
}
inline void verf(int d)
{
double a,b;
a=-X1*d;
b=-X2*(A/d);
if ((a==int(a)) && (b==int(b)))
{
q[l].q1=int(a);
q[l].p1=d;
q[l].q2=int(b);
q[l++].p2=A/d;
}
a=-X2*d;
b=-X1*(A/d);
if ((a==int(a)) && (b==int(b)))
{
q[l].q1=int(a);
q[l].p1=d;
q[l].q2=int(b);
q[l++].p2=A/d;
}
}
inline void divizor()
{
int k=abs(A),i,cnt,d;
for ( i = 1, cnt = (1<<16) ; cnt; cnt >>=1)
if ((long long) (i + cnt) * (i + cnt) <= k) i += cnt;
k=i;
for ( d = 1; d <= k; ++d)
if (!mod(A,d))
{
verf(d);
verf(-d);
verf(A/d);
verf(-A/d);
}
}
int main()
{
fscanf(f,"%d %d %d %d",&A,&B,&C,&K);
calcul();
if (stop) fprintf(g,"-1");
else
{
divizor();
sort(q,q+l,sorting());
l=unique(q, q + l,sorting1())-q;
if (K>l) fprintf(g,"-1");
else
{
fprintf(g,"(");
if (q[K-1].p1==-1) fprintf(g,"-x");
else if (q[K-1].p1==1) fprintf(g,"x");
else fprintf(g,"%dx",q[K-1].p1);
if (q[K-1].q1>=0) fprintf(g,"+%d)(",q[K-1].q1);
else fprintf(g,"%d)(",q[K-1].q1);
if (q[K-1].p2==-1) fprintf(g,"-x");
else if (q[K-1].p2==1) fprintf(g,"x");
else fprintf(g,"%dx",q[K-1].p2);
if (q[K-1].q2>=0) fprintf(g,"+%d)",q[K-1].q2);
else fprintf(g,"%d)",q[K-1].q2);
}
}
fclose(f);
fclose(g);
return 0;
}