Double Doors Regional P2 - Tudor Learns DDR

View as PDF

Submit solution


Points: 3
Time limit: 1.0s
Memory limit: 64M

Problem type

Tudor is learning how to play Dance Dance Revolution!

Tudor is good at stepping to the beat, but is struggling to deal with more complex note patterns. He decides to focus on three-step sequences of notes.

There are four different directions that one can step in Dance Dance Revolution - up, down, left, and right. Note that up and down are in opposite directions, and left and right are in opposite directions. This means there are 64 different three-step sequences of notes.

Tudor is especially interested in crossover sequences or candle sequences. A crossover sequence is a three-step sequence where the first and last steps are opposite, all three steps are in distinct directions, and the first step is either left or right. A candle sequence is a three-step sequence where the first and last steps are opposite, all three steps are in distinct directions, and the first step is either up or down.

Given a particular three-note sequence, determine if it is a crossover sequence, a candle sequence, or neither.

Input Specification

The input consists of exactly one line, containing three uppercase letters, the steps in sequence in order. Each of these letters will be one of U, D, L, and R, corresponding to up, down, left, and right, respectively.

Output Specification

If the sequence is a crossover sequence, output Crossover.

Otherwise, if the sequence is a candle sequence, output Candle.

Otherwise, output Neither.

Sample Data ZIP

Click here for ZIP.

Sample Input

UUU

Sample Output

Neither

Sample Input

ULD

Sample Output

Candle

Sample Input

LDR

Sample Output

Crossover

Comments

There are no comments at the moment.