P28579 [洛谷] [AHOI2002] Number Reading
提高-
题目描述

Problem Description

During a spring outing, Xiao Keke met Sealock, who had just returned to China to settle down. However, Sealock was born overseas and started learning Chinese after returning to the country. Reading numbers became a challenge for Sealock, so Xiao Keke decided to teach Sealock how to read numbers with an absolute value less than 1 billion.

Xiao Keke knew that Chinese has the following rules for reading numbers:

  1. First, read the sign, then the integer part. The integer part may be followed by a decimal point. If there is a decimal part, the decimal point must be read, and then the decimal part is read.
  2. The sign is read as follows:
    - For positive numbers, whether the "+" sign is present or not, the sign does not need to be read.
    - For negative numbers, the leftmost sign is "-", which is read as "F" (for "负").
  3. The integer part is read as follows:
    - If the integer part does not exist or is all zeros, it is read as "0".
    - Otherwise, start reading from the leftmost non-zero digit, and then read the integer part using quantity units such as ten, hundred, thousand, ten thousand, and hundred million (represented by "S", "B", "Q", "W", and "Y" respectively).
  4. In the integer part:
    - Each non-zero digit must be read in conjunction with the corresponding quantity unit.
    - Each continuous segment of "0" is read as a single "0", but if a continuous segment of "0" has no non-zero digits to its left or right (considering only the integer part), it should not be read.
  5. If there is a decimal part, first read "D" (for "点"), and then read each decimal place from left to right. Quantity units such as ten, hundred, thousand, ten thousand, and hundred million should not be used when reading the decimal part; however, each digit in the decimal part must be read, and continuous zeros should not be read as a single "0" but should be read separately.
  6. If there is a decimal point but no decimal part, the decimal point should not be read.

For example, -0020030004.567 should be read as "F2Q03W04D567", and 000.89 should be read as "0D89".

Please write a program to help Xiao Keke correctly read the given number.

Input Format

A file contains a single line with a number (no more than 50 characters) whose absolute value is less than 1 billion.

Output Format

Output the correct reading of the number in a single line.

Sample Input and Output

Sample Input #1

000.89

Sample Output #1

0D89

Sample Input #2

-0020030004.567

Sample Output #2

F2Q03W04D567
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
000.89
样例输出
0D89