Many countries have a "national speed limit": a default maximum speed that applies unless a speed limit sign explicitly sets a lower one. Such a speed limit sign shows a number and overrides the default while it is in force. By contrast, a derestriction sign shows no number at all; it cancels the previous restriction and restores the national speed limit, which is always strictly higher than any speed limit sign.
You pride yourself on being a careful and attentive motorist. Whenever you encounter a speed limit sign, you smoothly and safely adjust your vehicle's speed. Alas, despite your otherwise impeccable memory, the derestriction sign always leaves you guessing. You simply cannot remember the national speed limit – only that it was a neat multiple of ten.
As you encounter each sign – limit or derestriction – determine the fastest you can go while abiding the law, based only on what you've seen so far.
The input consists of:
Output $$$N$$$ integers, the maximum legal speed that can be inferred when passing the $$$i$$$th sign for $$$1\leq i\leq N$$$.
89085/119/8585/
90 85 100 119 120 85 85 120
| Name |
|---|


