#include <iostream> #include <string> using namespace std; int main() { int m; string n; cin>>m>>n; int i=0; while(i<n.length()) { if(n[i]!='0') cout<<n[i]<<"*"<<m<<"^"<<n.length()-i-1<<"+"; i++; } cout<<'\b'<<" "; }