エイシングプログラミングコンテスト2021(AtCoder Beginner Contest 202)
B
180°
AtCoder
⌀ 0
原题
← AC →
翻译中…

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 0 with a 0, each 1 with a 1, each 6 with a 9, each 8 with an 8, and each 9 with a 6.
翻译中…

Constraints

翻译中…
  • $1 \leq |S| \leq 10^5$
  • $S$ consists of 0, 1, 6, 8, and 9.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

S

翻译中…

Output

翻译中…

Print the result of rotating $S$ $180$ degrees.

翻译中…

样例

Input #1
0601889
Output #1
6881090
Rotating `0601889` $180$ degrees results in `6881090`.
Input #2
86910
Output #2
01698
Input #3
01010
Output #3
01010
$S$ may remain the same.
题目信息
题号
abc202_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。