QOJ.ac

QOJ

时间限制: 1.0 s 内存限制: 32 MB 总分: 80

#16626. KRIZALJKA

统计

你喜欢玩填字游戏吗?如果喜欢,你可能知道适合初学者的传统入门游戏——像下面这样的 $3 \times 3$ 小型填字游戏:

横向:

  1. 用于给电脑降温的设备
  2. 固态的水
  3. 获得

纵向:

  1. 细小、柔软、甜美的水果
  2. 强力的扑克牌
  3. 渔夫的工具

来试着解一个像这样的填字游戏吧!解不出来?没关系,那么至少在给定其中出现的六个单词(三个横向,三个纵向)的情况下,把这个填字游戏拼出来。

输入格式

输入共六行。每行包含一个由三个大写英文字母组成的单词。这些单词按字典序从小到大给出。

输出格式

如果无法使用给定的六个单词拼出一个 $3 \times 3$ 的填字游戏,则输出 0

否则,分三行输出该填字游戏。

如果存在多种可能的解,输出字典序最小的那个。在比较字典序时,将填字游戏按行拼接成一个长度为 9 的字符串进行比较。

样例

输入样例 1

ANA
ANA
DAR
DAR
RAD
RAD

输出样例 1

DAR
ANA
RAD

输入样例 2

EVO
HEP
HIR
IVA
PAD
ROD

输出样例 2

HEP
IVA
ROD

输入样例 3

AKO
CES
DOC
DON
ESI
KES

输出样例 3

0

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.