atcoder#ABC297C. [ABC297C] PC on the Table
[ABC297C] PC on the Table
Score : points
Problem Statement
Planning to place many PCs in his room, Takahashi has decided to write a code that finds how many PCs he can place in his room.
You are given strings , each of length , consisting of
.
andT
.
Takahashi may perform the following operation any number of times (possibly zero):
- Choose integers satisfying and such that the -th and -th characters of are both
T
. Replace the -th character of withP
, and -th withC
.
He tries to maximize the number of times he performs the operation. Find possible resulting .
Constraints
- and are integers.
- is a string of length consisting of
.
andT
.
Input
The input is given from Standard Input in the following format:
Output
Print a sequence of strings, , separated by newlines, possibly resulting from maximizing the number of times he performs the operation.
If multiple solutions exist, print any of them.
2 3
TTT
T.T
PCT
T.T
He can perform the operation at most once.
For example, an operation with makes PCT
.
3 5
TTT..
.TTT.
TTTTT
PCT..
.PCT.
PCTPC