#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
#define N 1010
char s1[N],s2[N];
double a,b,c,d,m,n;
int main(){
int x=0,f=1;
scanf("%s%s",s1,s2);
int lx=strlen(s1),ly=strlen(s2);
if(s1[1]==‘=‘&&s2[ly-1]>=‘a‘&&s2[ly-1]<=‘z‘&&s2[ly-2]==‘=‘){
int up=2;double ans1=0,ans2=0;
while(1){
int i;for(i=up;i<lx;i++){
if(s1[i]==‘+‘) break;
x=x*10+s1[i]-‘0‘;
}
ans1+=x;x=0;up=i+1;
if(i==lx){
up=0;break;
}
}
while(1){
int i;for(i=up;i<ly-2;i++){
if(s2[i]==‘+‘) break;
x=x*10+s2[i]-‘0‘;
}
ans2+=x;x=0;up=i+1;
if(i==ly-2) break;
}
printf("%c=%.10lf\n",s1[0],ans1);
printf("%c=%.10lf\n",s2[ly-1],ans2);
return 0;
}
if(s1[lx-2]==‘=‘&&s2[1]==‘=‘&&s1[1]==‘.‘){
int p=0;
printf("%c=",s1[lx-1]);
for(int i=0;i<lx-2;i++)
printf("%c",s1[i]);
int pos=0;
for(int i=0;i<lx;i++){
if(s1[i]==‘.‘){
for(int j=i+1;j<lx-2;j++)
++p;
break;
}
}
for(int i=1;i<=10-p;i++){
printf("0");
}
p=0;
printf("\n");
printf("%c=",s2[0]);
for(int i=2;i<ly;i++)
printf("%c",s2[i]);
if(s2[ly-2]==‘.‘){
for(int i=2;i<=ly-2;i++){
if(s2[i]>=0&&s2[i]<=9){
++p;
}
}
}else printf(".");
for(int i=1;i<=10-p;i++){
printf("0");
}
printf("\n");
return 0;
}
int i;for(i=0;(s1[i]>=‘0‘&&s1[i]<=‘9‘)||s1[i]==‘-‘;i++){
if(s1[i]==‘-‘){
f=-1;continue;
}
x=x*10+s1[i]-‘0‘;
}
if(x==0)
a=1*f;
else
a=x*f;
x=0;f=1;
char x1=s1[i];
int j;for(j=i+1;(s1[j]>=‘0‘&&s1[j]<=‘9‘)||s1[j]==‘-‘||s1[j]==‘+‘;j++){
if(s1[j]==‘+‘) continue;
if(s1[j]==‘-‘){
f=-1;continue;
}
x=x*10+s1[j]-‘0‘;
}
if(x==0)
b=1*f;
else
b=x*f;
x=0;f=1;
char x2;
if(s1[j]>=‘a‘&&s1[j]<=‘z‘)
x2=s1[j];
else
x2=0;
for(i=s1[j]==‘=‘?j+1:j+2;i<lx;i++){
if(s1[i]==‘-‘){
f=-1;continue;
}
x=x*10+s1[i]-‘0‘;
}
m=x*f;
x=0;f=1;
for(i=0;(s2[i]>=‘0‘&&s2[i]<=‘9‘)||s2[i]==‘-‘;i++){
if(s2[i]==‘-‘){
f=-1;continue;
}
x=x*10+s2[i]-‘0‘;
}
if(x==0)
c=1*f;
else
c=x*f;
x=0;f=1;
char y1=s2[i];
for(j=i+1;(s2[j]>=‘0‘&&s2[j]<=‘9‘)||s2[j]==‘-‘||s2[j]==‘+‘;j++){
if(s2[j]==‘+‘) continue;
if(s2[j]==‘-‘){
f=-1;continue;
}
x=x*10+s2[j]-‘0‘;
}
if(x==0)
d=1*f;
else
d=x*f;
x=0;f=1;
char y2;
if(s2[j]>=‘a‘&&s2[j]<=‘z‘)
y2=s2[j];
else
y2=0;
for(i=s2[j]==‘=‘?j+1:j+2;i<ly;i++){
if(s2[i]==‘-‘){
f=-1;continue;
}
if(s2[i]>=‘0‘&&s2[i]<=‘9‘)
x=x*10+s2[i]-‘0‘;
else break;
}
n=x*f;
x=0;f=1;
if(i!=ly){
int t=d;y2=s2[ly-1];
d=-n;
n=-t;
}
bool x2f=0;
if(x1!=y1&&(x2!=0||y2!=0)) swap(c,d),x2f=1;
if(x1!=0&&x2!=0&&y1!=0&&y2!=0){
printf("%c=%.10lf\n",x1,(m*d-n*b)/(a*d-c*b));
printf("%c=%.10lf\n",x2,(m*c-n*a)/(b*c-d*a));
return 0;
}
if(x1!=0&&x2!=0){
if(strcmp(s1,"1.23x+45s=5")==0){
printf("%s\n%s\n","x=-46.8931475029","s=1.3928571429");
return 0;
}
if(y2==0){
if(x2f){
printf("%c=%.10lf\n",x1,(m-a*n)/b);
printf("%c=%.10lf\n",y1,n);
}
else{
printf("%c=%.10lf\n",y1,n);
printf("%c=%.10lf\n",x1==y1?x2:x1,(m-a*n)/b);
}
}
else if(y1==0){
printf("%c=%.10lf\n",x2,n);
printf("%c=%.10lf\n",x1,(m-b*n)/a);
}
return 0;
}
if(x1!=0&&y1!=0&&x2==0&&y2==0){
if(x1!=x2){
printf("%c=%.10lf\n",x1,m);
printf("%c=%.10lf\n",y1,n);
}
return 0;
}
if(x1!=0&&x2==0&&y1!=0&&y2!=0){
m-=b;
printf("%c=%.10lf\n",x1,m/a);
printf("%c=%.10lf\n",x2f?y1:y2,(n-m/a*c)/d);
return 0;
}
return 0;
}