#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
int main()
{
int i, j;
cin >> hex >> i >> showbase >> j;
cout << i << '\t' << j;
cout << endl << oct << i << '\t' << showbase << j << endl;
system("pause");
return 0;
}
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
int main()
{
int i, j;
cin >> hex >> i >> showbase >> j;
cout << i << '\t' << j;
cout << endl << oct << i << '\t' << showbase << j << endl;
system("pause");
return 0;
}