#include <bits/stdc++.h>
using namespace std;
string str;
int b;
bool first=false;
int main(){
cin>>b>>str;
int k=str.size();
for(int i=0;i<k;i++){
if(first&&str[i]!='0') cout<<"+";
if(str[i]!='0'){
cout<<"1*"<<b<<"^"<<k-i-1;
first=true;
}
}
cout<<"\n";
return 0;
}
到底错在哪里了啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!