Write a program that will read in a series of strings, in either binary or minary notation and will convert them to the other notation. Note that on input, all binary strings will start with `0', and all minary strings will start with `1'. This will not necessarily be true of the output.
Input will consist of a series of lines, each line consisting of either a binary number (starting with `0') or a minary number (starting with `1'). The file will be terminated by a line consisting of a single #.
Output will consist of a series of lines, one for each line of the input. Each line will consist of a converted string, that is binary numbers are represented in minary, and vice versa.
01110 0111101111 100#010100# #
100#0 1000#1000# 01110100111