304878: CF926D. Choose Place
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Choose Place
题意翻译
教师是一个 $6\times 8$ 的空间,其中有 `*` 表示被占用的位置,`.` 表示空位置,`-` 表示过道。保证有空位。 Petya 要选一个空位,使得方便值最大,方便值如图。输出任意一个位置即可。题目描述
A classroom in a school has six rows with $ 3 $ desks in each row. Two people can use the same desk: one sitting on the left and one sitting on the right. Some places are already occupied, and some places are vacant. Petya has just entered the class and wants to occupy the most convenient place. The conveniences of the places are shown on the picture: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF926D/a082c4bc1c1ccaad840bb7d19543d2ab2a60cd65.png)Here, the desks in the top row are the closest to the blackboard, while the desks in the bottom row are the furthest from the blackboard. You are given a plan of the class, where '\*' denotes an occupied place, '.' denotes a vacant place, and the aisles are denoted by '-'. Find any of the most convenient vacant places for Petya.输入输出格式
输入格式
The input consists of $ 6 $ lines. Each line describes one row of desks, starting from the closest to the blackboard. Each line is given in the following format: two characters, each is '\*' or '.' — the description of the left desk in the current row; a character '-' — the aisle; two characters, each is '\*' or '.' — the description of the center desk in the current row; a character '-' — the aisle; two characters, each is '\*' or '.' — the description of the right desk in the current row. So, the length of each of the six lines is $ 8 $ . It is guaranteed that there is at least one vacant place in the classroom.
输出格式
Print the plan of the classroom after Petya takes one of the most convenient for him places. Mark this place with the letter 'P'. There should be exactly one letter 'P' in the plan. Petya can only take a vacant place. In all other places the output should coincide with the input. If there are multiple answers, print any.
输入输出样例
输入样例 #1
..-**-..
..-**-..
..-..-..
..-..-..
..-..-..
..-..-..
输出样例 #1
..-**-..
..-**-..
..-..-..
..-P.-..
..-..-..
..-..-..
输入样例 #2
**-**-**
**-**-**
..-**-.*
**-**-**
..-..-..
..-**-..
输出样例 #2
**-**-**
**-**-**
..-**-.*
**-**-**
..-P.-..
..-**-..
输入样例 #3
**-**-*.
*.-*.-**
**-**-**
**-**-**
..-..-..
..-**-..
输出样例 #3
**-**-*.
*.-*P-**
**-**-**
**-**-**
..-..-..
..-**-..