Seonhong keeps a flower bed in the front yard. The bed is a row of N plots numbered 1 to N from the left, and every plot holds between 0 and 100 gems.
One day Seonhong heard a rumor that gems might be buried in the bed and decided to check with a metal detector. Given two numbers s and e, the detector sweeps plot s through plot e and reports the total number of gems buried in that range.
Seonhong swept the bed M times and wrote down every result. Yeongmin walked by, tampered with the notes for fun, and left only the last digit of each result. Seonhong then told Yeongmin to recover the gem count of every plot from those digits alone. Help Yeongmin and find counts that do not contradict the notes.