Sequence Open on JetBrains Academy

Write a program that reads three characters and checks if they are ordered according to the Unicode table, and if each next character immediately follows the previous one (i.e. 'a', 'b', 'c' or 'x', 'y', 'z') according to the alphabet.

The program must print either true or false.


Sample Input:
a b c

Sample Output:
true


Sample Input:
c b a
Sample Output:
false

Sample Input:
a b d
Sample Output:
false

Sample Input:
x y z
Sample Output:
true


Memory limit: 256 MB
Time limit: 8 seconds

Show topic summary