#abc212b. B - Weak Password

B - Weak Password

Score : 200200 points

问题描述

你将得到一个44位数的PIN码:X1X2X3X4X_1X_2X_3X_4,它可能以0开头。当PIN码满足以下任一条件时,我们认为它是弱PIN码:

  • 四个数字完全相同。
  • 对于每个整数ii,满足1i31\leq i\leq 3时,Xi+1X_{i+1}紧跟在XiX_i之后。这里,对于每个0j80\leq j\leq 8j+1j+1 紧跟在 jj 之后,并且00紧跟在99之后。

如果给出的PIN码是弱PIN码,则输出Weak;否则,输出Strong

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

Problem Statement

You are given a 44-digit PIN: X1X2X3X4X_1X_2X_3X_4, which may begin with a 00. The PIN is said to be weak when it satisfies one of the following conditions:

  • All of the four digits are the same.
  • For each integer ii such that 1i31\leq i\leq 3, Xi+1X_{i+1} follows XiX_i. Here, j+1j+1 follows jj for each 0j80\leq j\leq 8, and 00 follows 99.

If the given PIN is weak, print Weak; otherwise, print Strong.

Constraints

  • 0X1,X2,X3,X490 \leq X_1, X_2, X_3, X_4 \leq 9
  • X1X_1, X2X_2, X3X_3, and X4X_4 are integers.

Input

Input is given from Standard Input in the following format:

X1X2X3X4X_1X_2X_3X_4

Output

If the given PIN is weak, print Weak; otherwise, print Strong.

Sample Input 1

7777

Sample Output 1

Weak

All four digits are 77, satisfying the first condition, so this PIN is weak.

Sample Input 2

0112

Sample Output 2

Strong

The first and second digits differ, and the third digit does not follow the second digit, so neither condition is satisfied.

Sample Input 3

9012

Sample Output 3

Weak

Note that 00 follows 99.

update @ 2024/3/10 09:26:56