get_number(Number) :-
    get_string(String),
    number_string(Number, String).

get_string(String) :-
    current_input(Input),
    read_string(Input, ' \n', '', _, String).

/* memo
    code(int)
    string_code(1, S, C), (C: code)
    char_code(X, Y) (X: char, Y: code)
*/

f("Sunny", "Cloudy").
f("Cloudy", "Rainy").
f("Rainy", "Sunny").

main:-
    get_string(S),
    f(S, T),
    writeln(T).
