1.

/* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #392 (Polynomial Showdown)
* Link: http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=5&page=show_problem&problem=328
*
* @author Dennis Wilfert
* @author Johann Studt
* @version 1.0, 04/25/2009
*
* Status : Accepted
* Runtime: 0.550
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


class Main {

public static void main(String[] args) {

BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
// Aktuelle Zeile
StringTokenizer line;
// Feststellen ob es sich um die erste Zahl handelt
boolean first;
// Akktuelle Zahl
int current;
// Zhler
int i;
// StringBuilder fr die Ausgabe
StringBuilder output = new StringBuilder();
// Scanner ist sehr nah an der Zeitgrenze, deshalb StringTokenizer und die Exception zum schluss abfangen
try{
while(true){
line = new StringTokenizer(reader.readLine());
first = false;
i=8;
while(i>=0){

current = Integer.parseInt(line.nextToken());

if(current!=0){
// Erste Zahl in einer Zeile
if(first){
if(current<0){
output.append(" - ");

if(current<-1)
output.append(-current);
}

else{
output.append(" + ");
if(current>1)
output.append(current);
}
}

else{

if(current <0){
output.append("-");

if(current<-1)
output.append(-current);
}

if(current>1)
output.append(current);

first = true;
}

if(i > 1){
output.append("x^");
output.append(i);
}

else{
// Letzte Zahl in einer Zeile
if(i == 0){
if(current==-1)
output.append(-current);

if(current==1)
output.append(current);
}
// Vorletzte Zahl in einer Zeile
else
output.append("x");
}
}
i--;
}
if(!first)output.append("0");
output.append("\n");

}
}catch(Exception e){
System.out.print(output);
}

}

}