#include
#include
#include
#include
#include
using namespace std;
char stack[100];
int top=-1;
void push(char data)
{
stack[++top]=data;
stack[top+1]=' ';
}
char *convert(int a,int b)
{
char *ch=new char[100];
char *ch1=new char[100];
int i=0,j,k=0;
while(a)
{
int t=a%b;
a/=b;
ch[i++]=t+'0';
}
ch[i]=' ';
for(j=i-1;j>=0;j--)
{
ch1[k++]=ch[j];
}
ch1[k]=' ';
return ch1;
}
void change(int a,int b)
{
int j,k;
while(a)
{
int t=a%b;
a/=b;
push(t+'0');
}
for(j=0,k=top;j>b;
change(a,b);
cout