// A base 7 program written in Bali-Part2.
// Author: Paul Chew, Mar 2004
// Does a weird conversion to base 7. Number is converted to a base 10 output
// that looks like the base 7 result. It would make more sense to use a
// string, but this version of Bali doesn't have strings.
int main ()
{int number, output, base, column; boolean done;} {
while !done do {
base = 7;
column = 1;
output = 0;
number = readInt();
done = number < 0;
while number > 0 do {
output = output + (column * (number % base));
number = number / base;
column = 10 * column;
}
if !done then print output;
}
return 0;
}