#K3631. Find the Missing Letter

    ID: 25726 Type: Default 1000ms 256MiB

Find the Missing Letter

Find the Missing Letter

You are given a sequence of n lowercase letters which are supposed to be in consecutive order according to the English alphabet (i.e. each letter’s ASCII code is exactly one more than the previous letter's). However, the sequence may have one missing letter. Your task is to find the missing letter in the sequence. If there is no missing letter, then you should output None.

In mathematical terms, if the sequence is represented as \(a_1, a_2, \dots, a_n\), then for each valid index \(i\) (where \(1 \le i < n\)), ideally we have:

\(\text{ord}(a_{i+1}) = \text{ord}(a_i) + 1\)

If for some \(i\) this condition is not met, then the missing letter is given by \(\text{chr}(\text{ord}(a_i)+1)\). If the condition holds for all \(i\), then there is no missing letter and the answer is None.

inputFormat

The input is read from standard input (stdin) and consists of two lines:

  1. The first line contains a single integer n representing the number of letters in the sequence.
  2. The second line contains n space-separated lowercase letters.

You can assume that n is at least 2.

outputFormat

Print the missing letter to the standard output (stdout) if one exists. If the sequence is continuous (i.e., no letter is missing), print None (without quotes).

## sample
5

a b c e f
d