P27489 [AtCoder] Set of Trees
NOI
题目描述

Problem Description

A rooted tree is recursively defined as "for a multiset of rooted trees, connect their roots to a new vertex with edges, and this new vertex becomes the root" (note that the arrangement of connecting is not distinguished). In particular, a tree consisting of only one vertex corresponds to an empty set. In this problem, we consider only rooted trees with a finite number of vertices. A rooted tree obtained by connecting rooted trees \( T_1, \ldots, T_k \) to a new root is denoted as \( \{\!\!\{T_1, \ldots, T_k\}\!\!\} \). For example, it looks like the following diagram:

Rooted trees as a multiset of rooted trees

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
8 0 0 0 1 2 2 3 7
样例输出
Black