fork(2) download
  1. Q=lambda C:[C[-1]in max(C)+min(C),C[1]>C[0]]*all([[i>g,i<g][[h%2>0,h%2<1][C[1]>C[0]]]for i,g,h in filter(lambda i:i[0]!=i[1],zip(C,C[1:],range(len(C))))])
  2. exec('print(Q(raw_input()));'*7)
Success #stdin #stdout 0.01s 9032KB
stdin
opera
miner
axiom
watch
earth
hello
pill
stdout
[True, True]
[True, False]
[False, True]
[False, False]
[]
[True, False]
[False, False]