Barabashka
Time limit2sMemory limit1024 MB
Given five card descriptions, print the color and name of the item to grab for each card by checking which items and colors the sentence mentions.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
In this problem, you choose one of the five items based on a textual description of an image.
"Barabashka" (originally named "Geistesblitz") is a board game that favors fast reaction. The rules below differ slightly from the original game, so read them carefully.
The game set includes five items of different colors: a white ghost named Barabashka, a green bottle, a gray mouse, a blue book, and a red chair. It also includes special cards. Each card shows an image with exactly two of these five items. Each item has one of the five colors, but the color shown on the card may be wrong. The two items on a card have different colors. The image can contain other objects, but their colors differ from the five colors above.
A single move proceeds as follows. All items are put on the table, and then a card is drawn and shown to the players. If the card contains an item whose color matches the real item on the table, the players must grab that item. Otherwise, the players must grab the item that is not on the picture and whose true color also does not appear on the picture. The player who grabs the right item first wins and keeps the card. Every card has exactly one right answer.
Each test consists of exactly five sentences. Each sentence describes one card in English. The right answer for a sentence is the description of the item to grab when the players see that card.
Input
The first line contains one sentence per line, five lines in total. Each sentence is between 1 and 80 characters long. The exact format of each sentence is described in the problem. Uppercase and lowercase letters are different.
Output
For each sentence, print one line with two words separated by a space: the right color and the name of the item to grab for that card. Uppercase and lowercase letters are different.
Hint
In the first, third, and fifth sentences of the sample, the items have the right colors, so you print their colors and names. In the second and fourth sentences, that is not the case, so you must choose the item whose name and color both do not appear as words in the sentence.