Word game

0

0 votes
String
Problem

Cubo and Dumbo decide to play a game. Cubo thinks of a word w1 and Dumbo thinks of word w2. They both write their words down and share it.

If w1 and w2 share a common substring, Dumbo wins the game. Else Cubo wins the game.

Note that a substring may be as small as one character.

Given w1 and w2, print "Dumbo" if Dumbo wins the game, else print "Cubo".

Constraints

  • 0 ≤ w1.length, w2.length ≤ 104

  • w1 and w2 consist of only lowercase letters

Input Format

  • First line contains w1, the word given by Cubo

  • Second line contains w2, the word given by Dumbo

Output Format

print "Dumbo" if Dumbo wins the game, else print "Cubo"

Scoring

  • For 90% of total score, 0 ≤ w1.length, w2.length ≤ 100
  • For 100% of total score, original constraints
Sample Input
ask
art
Sample Output
Dumbo
Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

w1 = "ask", w2 = "art"
Since both of them share a common substring "a", Dumbo wins the game

Editor Image

?