module Memoizable
	def memoize(name)
		original = "__original_#{name}__"
		([Class, Module].include?(self.class) ? self : self.class).class_eval {
			alias_method(original, name)
			private(original)
			cache = {}
			define_method(name){|*args|
				cache[args] ||= send(original, *args)
			}
		}
	end 
end

include Memoizable

def check(s)
	return true if s == ''
	return s == 'mew' if s.size <= 3
	return false unless s[0] == 'm' && s[-1] == 'w'
	
	if s[1] == 'm'
		l = 0
		(1..s.size-1).each{|i|
			c = s[i]
			l += 1 if c == ?m	
			l -= 1 if c == ?w
			if l == 0
				return s[i+1] == ?e && check(s[1..i]) && check(s[i+2..-2])
			end
		}
		return false
	elsif s[1] == 'e'
		return check(s[2..-2])
	end
end

memoize :check

str = gets.chomp
puts check(str) ? 'Cat' : 'Rabbit'