class Binary { field boolean head field Binary tail constructor(int n) { this.head := n / 2 * 2 != n; if (n > 1) then this.tail := new Binary(n / 2) } method String toString() if (this.tail != nil & this.head) then return this.tail.toString().concat(1) else if (this.tail != nil) then return this.tail.toString().concat(0) else if (this.head) then return "1" else return "0" method void main() new Binary(815).toString().concat("\n").output() }