Sequence of bits is encoded as follows. If the previous bit differs from the current encoded bit, write 1 to resulting sequence. If the values of bits are different, then write 0. For the first bit of the sequence the previous bit has value 0.
Write a program that performs encoding.
One string with no more than 100 characters, consisting only of 0 and 1, representing a coded sequence of bits.
Print the resulting code.