logo AlgoBeat OnlineJudge
登录 注册

#215445. [VKOSHP 2025] Eye Color

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

In a distant land inhabited by magical creatures, geneticists have discovered a unique phenomenon: the eye color of offspring directly depends on the eye color of their parents. In this world, there are only three eye colors: brown, green, and blue.

Geneticists have developed several rules that determine what eye color a child can have:

  • If at least one parent has brown eyes, then the child will definitely have brown eyes.
  • Otherwise, if a parent has green eyes, then the child will also have green eyes.
  • If both parents have the same eye color, then the child will have the same color.

The geneticists have an ancient book with statistics on the eye colors of parents and offspring. However, it may contain incorrect entries or the symbol ., which indicates that the eye color was not recorded and can take any of the three values.

Your task is to help the geneticists verify the correctness of the records regarding eye colors. You are given the eye colors of both parents and their offspring. You need to determine all possible correct combinations of eye colors for the parents and the offspring in lexicographic order. If such combinations are impossible, output the word "Incorrect".

输入格式

You are given three space-separated eye colors: two parents and their offspring. The eye color can take the values brown, green, blue, or ..

输出格式

Output all possible correct combinations of eye colors for the parents and the offspring, separated by spaces, in lexicographic order, with each combination on a separate line. Or the word "Incorrect" if the combination is unattainable.

样例

样例输入 1

blue blue blue

样例输出 1

blue blue blue

样例输入 2

blue brown .

样例输出 2

blue brown brown

样例输入 3

green . .

样例输出 3

green blue green
green brown brown
green green green

样例输入 4

blue blue brown

样例输出 4

Incorrect