#abc202b. B - 180°

B - 180°

Score : 200200 points

问题描述

你得到一个字符串 SS,其中包含字符 01689

将字符串 SS 旋转 180180 度,并打印旋转后的结果。换句话说,对 SS 应用以下操作并输出得到的新字符串:

  • 反转字符串 SS
  • 将每个 0 替换为 0,每个 1 替换为 1,每个 6 替换为 9,每个 8 替换为 8,每个 9 替换为 6

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a string SS consisting of 0, 1, 6, 8, and 9.

Rotate SS 180180 degrees and print the result. In other words, apply the following operations on SS and print the resulting string:

  • Reverse SS.
  • 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

  • 1S1051 \leq |S| \leq 10^5
  • SS consists of 0, 1, 6, 8, and 9.

Input

Input is given from Standard Input in the following format:

SS

Output

Print the result of rotating SS 180180 degrees.

Sample Input 1

0601889

Sample Output 1

6881090

Rotating 0601889 180180 degrees results in 6881090.

Sample Input 2

86910

Sample Output 2

01698

Sample Input 3

01010

Sample Output 3

01010

SS may remain the same.

update @ 2024/3/10 09:14:16