George is getting tired of the decimal number system.  He intends to switch and use the septenary (base 7) number system for his future needs.  Write a program to help George start his transformation into the septenary number system by taking in a list of decimal numbers and print out the corresponding septenary number.
 

Input
A list of numbers in decimal format ending with -1.

Output
A list of numbers in septenary.
 

Example
Input:
1 2 88 42 99 -1

Output:
1 2 154 60 201
import sys
def numberToBase(n, b):
    temp=''
    while n:
        temp+=str(n % b)
        n /= b
    return temp
a=map(int,sys.stdin.readline().split())
i=0
while a[i]!=-1:
    s=numberToBase(a[i],7)
    s=s[::-1]
    sys.stdout.write(s+" ")
    i+=1