#P6353. [COCI 2007/2008 #3] OKTALNI

[COCI 2007/2008 #3] OKTALNI

Problem Description

You are given a binary number. Please convert it to an octal number.


You can use the following conversion method:

  • If the number of bits in the binary number is not divisible by 33, pad 00 on the left until the length becomes a multiple of 33.
  • Split this binary number into groups of three bits.
  • The binary value of each group can be replaced by the digit shown in the table below.

Now complete this procedure and output the final octal result.

Input Format

Input one line containing a binary number.

It is guaranteed that the length does not exceed 100100, and the first bit is 11.

Output Format

Output one line containing an octal number.

1010
12
11001100
314

Hint

Note

This problem is translated from COCI2007-2008 CONTEST #3 T2 OKTALNI

Translated by ChatGPT 5