#include <iostream>
#include <string>
#include <vector>
using namespace std;const char hashtable[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int main(){
string str;while(getline(cin,str)){
int size = str.size();
vector<int> v;//ASCII编码for(const auto& e : str)
v.push_back(e -'\0');//二进制编码
string bin;
string temp;for(const auto& e : v){
int num = e;
temp.resize(8,'0');while(num){for(int i =7; i >=0;--i){
temp[i]=((num %2)+'0');
num /=2;}}
bin += temp;
temp.clear();}//索引
vector<int> vint;
int num =5;
int element =0;for(int i =0; bin[i]!='\0';++i){if(num >=0){
element +=((int)pow(2, num)*(bin[i]-'0'));
num--;}else{
vint.push_back(element);
element =0;
num =5;
element +=((int)pow(2, num)*(bin[i]-'0'));
num--;}if(bin[i +1]=='\0'){
vint.push_back(element);}}//Base64编码
string ret;for(const auto& e : vint){
ret += hashtable[e];}while(1){if(size >=3){break;}elseif(size >=2){
ret +='=';break;}elseif(size ==1){
ret +="==";break;}}
cout << ret << endl;}return0;}