Weak Password

AtCoder
IDabc212_b
Time2000ms
Memory256MB
Difficulty
You are given a $4$\-digit PIN: $X_1X_2X_3X_4$, which may begin with a $0$. 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 $i$ such that $1\leq i\leq 3$, $X_{i+1}$ follows $X_i$. Here, $j+1$ follows $j$ for each $0\leq j\leq 8$, and $0$ follows $9$. If the given PIN is weak, print `Weak`; otherwise, print `Strong`. ## Constraints * $0 \leq X_1, X_2, X_3, X_4 \leq 9$ * $X_1$, $X_2$, $X_3$, and $X_4$ are integers. ## Input Input is given from Standard Input in the following format: $X_1X_2X_3X_4$ [samples]
Samples
Input #1
7777
Output #1
Weak

All four digits are $7$, satisfying the first condition, so this PIN is weak.
Input #2
0112
Output #2
Strong

The first and second digits differ, and the third digit does not follow the second digit, so neither condition is satisfied.
Input #3
9012
Output #3
Weak

Note that $0$ follows $9$.
API Response (JSON)
{
  "problem": {
    "name": "Weak Password",
    "description": {
      "content": "You are given a $4$\\-digit PIN: $X_1X_2X_3X_4$, which may begin with a $0$. The PIN is said to be weak when it satisfies one of the following conditions: *   All of the four digits are the same. *   ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc212_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a $4$\\-digit PIN: $X_1X_2X_3X_4$, which may begin with a $0$. The PIN is said to be weak when it satisfies one of the following conditions:\n\n*   All of the four digits are the same.\n*   ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments