#include
void dec2n(int x,int n)
{if(x>=n)dec2n(x/n,n);
printf("%ld",x%n);
}
int main()
{
int x;
long int n=2,m=8;
scanf("%d",&x);
printf("%d的%d进制为:\n",x,n);
dec2n(x,n);
printf("\n");
printf("%d的%d进制为:\n",x,m);
dec2n(x,m);
printf("\n");
return 0;
}