#include<bits/stdc++.h> using namespace std; int main(){ int n,l; string s; cin>>n>>s; l=s.length(); cout<<"1*"<<n<<"^"<<l-1;//第一位肯定不为0 for(int i=l-2;i>=0;){//从第二位开始输出 if(s[i]=='0') i--; else{ cout<<"+1*"<<n<<"^"<<i; i--; } } return 0; }