#include<bits/stdc++.h>
#include<iostream>
#define f(a,b,c,d)(pow(a,x)+pow(b,x)+pow(c,x)-pow(d,x))
using namespace std;
int* findres(int x,int n){
int a=1,b=1,c=1,d=1;
//x=2 or 3
// d一定比a,b,c都大
int res[4]={0,0,0,0};
for(a=1;a<=n;++a){
for(b=a;b<=n;++b){
for(c=b;c<=n;++c){
for(d=c;d<=n;++d) {
if (f(a, b, c, d) == 0) {
res[0] = a;
res[1] = b;
res[2] = c;
res[3] = d;
cout<<res[0]<<'^'<<x<<'+'<<res[1]<<'^'<<x<<'+'<<res[2]<<'^'<<x<<'='<<res[3]<<'^'<<x<<endl