Sandwich Number

AtCoder
IDabc281_b
Time2000ms
Memory256MB
Difficulty
You are given a string $S$ consisting of uppercase English letters and digits. Determine whether $S$ satisfies the following condition. * $S$ is a concatenation of the following characters and string in the order listed. * An uppercase English letter * A string of length $6$ that is a decimal representation of an integer between $100000$ and $999999$, inclusive * An uppercase English letter ## Constraints * $S$ consists of uppercase English letters and digits. * The length of $S$ is between $1$ and $10$, inclusive. ## Input The input is given from Standard Input in the following format: $S$ [samples]
Samples
Input #1
Q142857Z
Output #1
Yes

$S$ is a concatenation of `Q`, `142857`, and `Z` in this order.  
`Q` and `Z` are uppercase English letters, and `142857` is a string of length $6$ that is a decimal representation of an integer between $100000$ and $999999$, so $S$ satisfies the condition.
Input #2
AB912278C
Output #2
No

`AB` is not an uppercase English letter, so $S$ does not satisfy the condition.
Input #3
X900000
Output #3
No

The last character of $S$ is not an uppercase English letter, so $S$ does not satisfy the condition.
Input #4
K012345K
Output #4
No

`012345` is not a string of length $6$ that is a decimal representation of an integer between $100000$ and $999999$, so $S$ does not satisfy the condition.
API Response (JSON)
{
  "problem": {
    "name": "Sandwich Number",
    "description": {
      "content": "You are given a string $S$ consisting of uppercase English letters and digits. Determine whether $S$ satisfies the following condition. *   $S$ is a concatenation of the following characters and stri",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc281_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a string $S$ consisting of uppercase English letters and digits. Determine whether $S$ satisfies the following condition.\n\n*   $S$ is a concatenation of the following characters and stri...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments