#include <bits/stdc++.h>
using namespace std;
string str="23-a+1=-2-a";
int getn(char a){
return a-'0';
}
int a[100],b[100];
int main(){
// getline (cin,str);
int len=str.length();
int di = str.find("=");
if(str[di+1]>='0' and str[di+1]<='9'){
str.insert(di+1,"+");
}
if(str[0]>='0' and str[0]<='9'){
str.insert(0,"+");
}
di = str.find("=");
string str1 = str.substr(0,di);
string str2 = str.substr(di+1);
for(int i=0;i<str2.length();i++){
if(str2[i]=='+'){
str2[i]='-';
}else if (str2[i]=='-'){
str2[i]='+';
}
}
str = str1+str2+' ';
cout<<str<<endl;
int i=0;
int start=0, end;
int ai=0,bi=0;
for(int i=0;i<str.length();i++){
if(i==0){
continue;
}
if(str[i]=='+' || str[i]=='-' || str[i]==' '){
end=i;
// cout<<start<<" "<< end<<" "<<endl;
string tstr = str.substr(start,end-start);
cout<<tstr<< " ";
if(tstr.find("a")!=string::npos){
if(tstr[0]=='-'&&tstr.length()==2){
a[ai] = -1;
}else if(tstr[0]=='+' &&tstr.length()==2){
a[ai] = 1;
}else{
a[ai] = stoi(tstr.substr(0,tstr.length()-1));
}
cout<<a[ai]<<"a"<<endl;
ai++;
}else{
b[bi]=stoi(tstr);
cout<<b[bi]<<endl;
bi++;
}
start = end;
i=end;
}
}
cout<<"a"<<endl;
for(int i=0;i<ai;i++){
cout<<a[i]<<endl;
}
cout<<"b"<<endl;
for(int i=0;i<bi;i++){
cout<<b[i]<<endl;
}
}