#include <iostream>
using namespace std;
long long n;
char trs(int x){
if (x>9){
return x-10+'A';
}else{
return x+'0';
}
}
int main() {
cin>>n;
while (n>0){
int t=n&0x7f;
if (n>0x7f){
t|=0x80;
}
cout<<trs(t>>4)<<trs(t&0xf)<<" ";
n=(n>>7);
}
return 0;
}