Raghu wants to design a converter such that when a user inputs a binary number it gets converted to Octal number & also the correspond alphabet to it.

Example- if a user inputs- 10101101
then the output is 255 BEE

Note : for decimal places there should be a space between the alphabetic signs
Ex- for input  101101101110.111
output -5556.7 EEEF G

A stands for 1, b for 2 , if the octal digit is 0 consider it as a space

SAMPLE INPUT
10101101

SAMPLE OUTPUT
255 BEE
import sys
bin=raw_input();

if "." in bin:
	bdot,adot=bin.split(".")
else:
	bdot=bin
	adot=""

bdot=bdot.lstrip("0")
adot=adot.rstrip("0")

baddz= 3 - (len(bdot)%3)
aaddz= 3 - (len(adot)%3)

if(baddz==3):
	baddz=0
	
if(aaddz==3):
	aaddz=0
	
for i in range(baddz):
	bdot='0'+bdot
		
for i in range(aaddz):
	adot=adot+'0'

octno=""

groupbdot=len(bdot)/3
groupadot=len(adot)/3

for i in range(groupbdot):
	bgrp= bdot[(i*3) + 0]+bdot[(i*3) + 1]+bdot[(i*3) + 2]
	octv= oct(int(bgrp,2)).lstrip("0")
	octno=octno+octv

if "." in bin:
	octno=octno+"."

for i in range(groupadot):
	bgrp= adot[(i*3) + 0]+adot[(i*3) + 1]+adot[(i*3) + 2]
	octv= oct(int(bgrp,2)).lstrip("0")
	octno=octno+octv
	
	

print octno+" ",

arr=[' ','A','B','C','D','E','F','G']

for i in range(len(octno)):
	ch=octno[i]
	
	if(ch=="."):
		sys.stdout.write(" ")
	else:
		sys.stdout.write(arr[int(ch)])