s, t = gets.split r = %w[XII I II III IIII V VI VII VIII IX X XI] puts r[(r.index(s) + t.to_i) % 12]