#AT1794. B - 180°
B - 180°
B - 180°
Score : $200$ points
Problem Statement
You are given a string $S$ consisting of 0, 1, 6, 8, and 9.
Rotate $S$ $180$ degrees and print the result. In other words, apply the following operations on $S$ and print the resulting string:
- Reverse $S$.
- Replace each
0with a0, each1with a1, each6with a9, each8with an8, and each9with a6.
Constraints
- $1 \leq |S| \leq 10^5$
- $S$ consists of
0,1,6,8, and9.
Input
Input is given from Standard Input in the following format:
Output
Print the result of rotating $S$ $180$ degrees.
0601889
6881090
Rotating 0601889 $180$ degrees results in 6881090.
86910
01698
01010
01010
$S$ may remain the same.