/*
p1 * p2 = a
p1 * q2 + p2 * q1 = b
q1 * q2 = c
all divisors of a -> fixam p1, p2
p1 * q2 + p2 * q1 = b | * q1
p1 * c + p2 * q1 ^ 2 - b * q1 = 0
p2 * q1 ^ 2 - b * q1 + p1 * c = 0
delta = b ^ 2 - 4 * p2 * p1 * c
q1 = (b +- sqrt(delta)) / 2p2
q2 = c / q1;
scriem pe toate
*/
#include <bits/stdc++.h>
using namespace std;
vector<int> all_divs(const int x){
vector<int> rez;
for(int i = 1; i*i <= x; ++i){
if(x%i) continue;
rez.push_back(i);
rez.push_back(-i);
rez.push_back(x/i);
rez.push_back(-x/i); }
sort(begin(rez), end(rez));
rez.erase(unique(begin(rez), end(rez)), end(rez));
return rez; }
struct a_solution{
int p1, q1, p2, q2;
a_solution(const int x, const int y, const int z, const int p):
p1(x), q1(y), p2(z), q2(p){}
bool operator<(const a_solution& rhs)const{
return p1 < rhs.p1 || (p1 == rhs.p1 && q1 < rhs.q1); }
bool operator==(const a_solution& rhs)const{
return memcmp(this, &rhs, sizeof(a_solution)) == 0; } };
void print_paren(ostream& lhs, const int p, const int q){
lhs << '(';
if(p == 1);
else if(p == -1) lhs << '-';
else lhs << p;
lhs << 'x';
if(q >= 0) lhs << '+';
lhs << q;
lhs << ')'; }
ostream& operator<<(ostream& lhs, const a_solution& rhs){
print_paren(lhs, rhs.p1, rhs.q1);
print_paren(lhs, rhs.p2, rhs.q2);
return lhs; }
bool is_whole(const double d){
double tmp;
return modf(d, &tmp) == 0; }
void add_solution_if_possible(const double a, const double b, const double c,
const double p1, const double p2, vector<a_solution>& sols){
const double delta = (b * b) - 4 * p1 * p2 * c;
const double sqdelta = round(sqrt(delta));
const double q10 = (b + sqdelta) / (2 * p2),
q11 = (b - sqdelta) / (2 * p2);
const double q20 = (double)c / q10, q21 = (double)c / q11;
if(is_whole(q10) && is_whole(q20)) sols.emplace_back(p1, q10, p2, q20);
if(is_whole(q11) && is_whole(q21)) sols.emplace_back(p1, q11, p2, q21); }
int main(){
ifstream f("ecuatie.in");
ofstream g("ecuatie.out");
int a, b, c;
f >> a >> b >> c;
vector<int> divs = all_divs(a);
vector<a_solution> sols;
for(const auto x : divs){
add_solution_if_possible(a, b, c, x, a/x, sols); }
sort(begin(sols), end(sols));
sols.erase(unique(begin(sols), end(sols)), end(sols));
int k;
f >> k;
if(k >= sols.size()) g << -1;
else g << sols[k-1] << endl;
return 0; }