Atcoder Handles

AtCoder
IDs8pc_4_a
Time1000ms
Memory256MB
Difficulty
Mr.X, who the handle name is $T$, looked at the list which written $N$ handle names, $S_1, S_2, ..., S_N$. But he couldn't see some parts of the list. Invisible part is denoted `?`. Please calculate all possible index of the handle name of Mr.X when you sort $N+1$ handle names ($S_1, S_2, ..., S_N$ and $T$) in lexicographical order. Note: If there are pair of people with same handle name, either one may come first. ## Input The input is given from standard input in the following format. $N$ $S_1$ $S_2$ : $S_N$ $T$ [samples]
API Response (JSON)
{
  "problem": {
    "name": "Atcoder Handles",
    "description": {
      "content": "Mr.X, who the handle name is $T$, looked at the list which written $N$ handle names, $S_1, S_2, ..., S_N$.   But he couldn't see some parts of the list. Invisible part is denoted `?`.      Please calc",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "s8pc_4_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Mr.X, who the handle name is $T$, looked at the list which written $N$ handle names, $S_1, S_2, ..., S_N$.  \nBut he couldn't see some parts of the list. Invisible part is denoted `?`.  \n  \nPlease calc...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments