F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

New Game

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 803    Accepted Submission(s): 227


Problem Description
While ZSTU¡¯s acmers were coding, coach Yehr was so bored that he created a new game to kill time. And the game is called ¡°Yehr Game¡± because of the inventer.
Yehr Game is a board game involving two players. It is played on a board with 40 squares arranged in an ten-by-four grid. At the beginning of the game each player controls four pieces: one acm, one bahamas, one cab and one daze. If one player has no pieces to move, he lost the game.
Setup:
Yehr Game is played on a rectangle board of ten rows and four columns. The pieces are divided, by convention, into red and black sets. The players are referred to as "Red" and "Black", and each begins the game with four pieces of the specified color. These consist of one acm, one bahamas, one cab and one daze.



Movement:
First, they setup their pieces on the board.
(1) the piece red acm can be placed on A1~,A2,A3,A4,A5;the piece black acm A6~A10;
(2) the piece red bahamas can place on B1~B5; the piece black Bahamas B6~B10;
(3) the piece red cab can place on C1~C5; the piece black cab C6~C10;
(4) the piece red daze cab can place on D1~D5; the piece black daze D6~D10;
Second, they determine who moves first by dice. After the initial move, the players alternately move one piece at a time.
Each chess piece has its own style of moving.
(1) Acm can only move one direction: red from left to right; black from right to left. Acm can only move to the next square. If one player¡¯s acm moves to a square with the opponent acm, he win the game.
(2) Bahamas and cab can move two direction: from left to right or from right to left. And they can move any number of squares but may not leap over other pieces.
(3) Daze can only move one direction: red from right to left; black from left to right.Daze can only move to the next square. In order to win the game, every clever player places the red daze on d5 and the black on d6.
Of Course, we assume that all players are clever.
 

Input
The input contains several test cases.
Each test case contains three lines:
First line contains one integer number 0 or 1: 0 indicated red move first and 1 black first.
Second line contains four integer numbers r1, r2, r3, r4 indicating the four red pieces¡¯ square. For example, r3=3 indicating the red cab on C3.
Third line contains four integer numbers k1, k2, k3, k4 indicating the four black pieces¡¯ square. For example, k1=9 indicating the black acm on A9.
We assume that r4 is always 5, and K4 is 6.

 

Output
For each test case, if red win print Red in a single line, else print Black.
 

Sample Input
0 4 5 5 5 7 6 6 6
 

Sample Output
Red
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 09:25:38, Gzip enabled