Song Transcription Oops

When transcribing vocal music to Canjo Tab you can start by finding the lowest note and assigning that to zero and working your way up from there. However, without fail, I tend to miscount the notes and when I am near done I find a lower note. I mark this with a "z". This means I have to increase all the previous ones by 1. just a sting of numbers :)

Input

00024432210000024777
664444777642345401222
43210000122243210z0

Output

11135543321111135888
775555888753456512333
5432111123335432101