Problem:
Score: 100 points

Problem Statement

The weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...

Given is a string S representing the weather in the town today. Predict the weather tomorrow.

Constraints

S is Sunny, Cloudy, or Rainy.

Input

Input is given from Standard Input in the following format:

S

Output

Print a string representing the expected weather tomorrow, in the same format in which input is given.

Sample Input 1

Sunny

Sample Output 1

Cloudy

In Takahashi's town, a sunny day is followed by a cloudy day.

Sample Input 2

Rainy

Sample Output 2

Sunny

Solution in Rust (1.15.1) (judge verdict: Accepted)

#![allow(dead_code)]

fn solve(src: &str) -> String {
    let mut sc = Scanner::from_str(&src);

    let s = sc.chars();
    let ans = match s[0] {
        'S' => "Cloudy",
        'C' => "Rainy",
        _   => "Sunny"
    };
    format!("{}", ans)
}

#[test]
fn test() {
    assert_eq!(solve(r"Sunny"),r"Cloudy");
    assert_eq!(solve(r"Rainy"),r"Sunny");
}

fn main() {
    let mut input = String::new();
    use std:: io::Read;
    std::io::stdin().read_to_string(&mut input).unwrap();
    use std::io::Write;
    std::io::stdout().write_all(solve(&input).as_bytes());
}

struct Scanner<I> {
    src: I
}

impl<'a> Scanner<std::str::SplitWhitespace<'a>> {
    fn from_str(src: &'a str) -> Self {
        Scanner { src: src.split_whitespace() }
    }
}

impl<'a, I> Scanner<I> where I: std::iter::Iterator<Item=&'a str> {
    fn read<T: std::str::FromStr>(&mut self) -> T {
        self.src.next().unwrap().parse().ok().expect("Parse error")
    }
    fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    fn chars(&mut self) -> Vec<char> {
        self.src.next().unwrap().chars().collect()
    }
}