$h = Hash.new(false)
def solve(s)
    return true if s == "" || s == "mew"
    return $h[s] if $h.has_key?(s)
    return false if s[0] != "m" || s[s.length - 1] != "w"
    t = s[1...(s.length - 1)]
    if !t.index("e")
        $h[s] = false
        return false
    end
    t.each_char.with_index do |c, i|
        next if c != "e"
        if solve(t[0...i]) && solve(t[(i+1)...t.length])
            $h[s] = true
            return true
        end
    end
    $h[s] = false
    return false
end
s = gets.chomp
puts solve(s) ? "Cat" : "Rabbit"