#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stdexcept>
#include<cmath>
#include<memory>
#include<algorithm>
#include<cstring>
#include<ctime>
#include<deque>
#include<sstream>
#include<iomanip>
#include<sstream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<climits>
#include<map>
#include<set>
#include<list>
#include<cassert>
#include<deque>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define INF 1<<27
#define all(n) n.begin(),n.end()
#define insert(a,b,c,d) PP(P(a,b),P(c,d))
#define F first
#define S second
#define pb push_back
#define pf push_front
#define LIM 100000
#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define mp make_pair
using namespace std;
typedef pair<int,int> P;
typedef pair<P,P> PP;
typedef long long ll;
typedef unsigned long long ull;
map<char,string> cs;
map<string,char> sc;

void init(){
  cs[' '] = "101";
cs['\''] = "000000";
cs[','] = "000011";
cs['-'] = "10010001";
cs['.'] = "010001";
cs['?'] = "000001";
cs['A'] = "100101";
cs['B'] = "10011010";
cs['C'] = "0101";
cs['D'] = "0001";
cs['E'] = "110";
cs['F'] = "01001";
cs['G'] = "10011011";
cs['H'] = "010000";
cs['I'] = "0111";
cs['J'] = "10011000";
cs['K'] = "0110";
cs['L'] = "00100";
cs['M'] = "10011001";
cs['N'] = "10011110";
cs['O'] = "00101";
cs['P'] = "111";
cs['Q'] = "10011111";
cs['R'] = "1000";
cs['S'] = "00110";
cs['T'] = "00111";
cs['U'] = "10011100";
cs['V'] = "10011101";
cs['W'] = "000010";
cs['X'] = "10010010";
cs['Y'] = "10010011";
cs['Z'] = "10010000";

sc["00000"] = 'A';
sc["00001"] = 'B';
sc["00010"] = 'C';
sc["00011"] = 'D';
sc["00100"] = 'E';
sc["00101"] = 'F';
sc["00110"] = 'G';
sc["00111"] = 'H';
sc["01000"] = 'I';
sc["01001"] = 'J';
sc["01010"] = 'K';
sc["01011"] = 'L';
sc["01100"] = 'M';
sc["01101"] = 'N';
sc["01110"] = 'O';
sc["01111"] = 'P';
sc["10000"] = 'Q';
sc["10001"] = 'R';
sc["10010"] = 'S';
sc["10011"] = 'T';
sc["10100"] = 'U';
sc["10101"] = 'V';
sc["10110"] = 'W';
sc["10111"] = 'X';
sc["11000"] = 'Y';
sc["11001"] = 'Z';
sc["11010"] = ' ';
sc["11011"] = '.';
sc["11100"] = ',';
sc["11101"] = '-';
sc["11110"] = '\'';
sc["11111"] = '?';


} 


string bina(string s){
  string ret;
  for(int i=0;i<s.length();i++){
    ret += cs[s[i]];
  }

    while(ret.size()%5 != 0){
      ret += "0";
    }
  
  return ret;
}



int main(){
  string s;
  init();
  getline(cin,s);
  string nes;
  nes = bina(s);
  for(int i=0;i<nes.length();i+=5){
    cout << sc[nes.substr(i,5)];
  }
  cout << endl;

return 0;
}