A. Bus to Udayland
Time Limit: 2 seconds
Memory Limit: 256 megabytes
ZS and Chris need a pair of adjacent empty seats on the IOI bus. The bus has n rows, each with 4 seats arranged in pairs separated by a walkway. Given the bus configuration, determine if they can find seats and output the modified configuration with their seats marked or indicate if no suitable seats are available.
Input
The first line: An integer n (1 ≤ n ≤ 1000), representing the number of rows.
The next n lines: Strings of 5 characters representing each row. The format is AB|CD, where A, B, C, and D are either 'O' (empty) or 'X' (occupied), and '|' represents the walkway.
Output
If a suitable pair of seats is found:
Print "YES" on the first line.
Print the bus configuration with ZS and Chris's seats marked as '++' in the appropriate pair.


If no suitable pair is found:
Print "NO".


Examples
Input 1
     6
OO|OX
XO|XX
OX|OO
XX|OX
OO|OO
OO|XX
   
content_copy Use code with caution.
Output 1
     YES
++|OX
XO|XX
OX|OO
XX|OX
OO|OO
OO|XX
   
content_copy Use code with caution.
Input 2
     4
XO|OX
XO|XX
OX|OX
XX|OX
   
content_copy Use code with caution.
Output 2
     NO
   
content_copy Use code with caution.
Input 3
     5
XX|XX
XX|XX
XO|OX
XO|OO
OX|XO
   
content_copy Use code with caution.
Output 3
     YES
XX|XX
XX|XX
XO|OX
XO|++
OX|XO
   
content_copy Use code with caution.
Note: If multiple solutions exist, print any of them. The seats must be in the same pair.

The problem you're referring to revolves around finding two neighboring empty seats for ZS the Coder and Chris the Baboon on a bus with a specific seating configuration.

### Problem Breakdown:
1. **Bus Layout**: 
   - The bus has `n` rows.
   - Each row contains 4 seats, which are grouped into pairs by a walkway (thus forming two pairs in each row).
   - The layout of each row can be visualized like this: `XX_XX`, where `X` represents seats and `_` is the walkway between them.

2. **Initial Condition**: 
   - Some of the seats are already occupied, which is provided as input.

3. **Goal**:
   - ZS and Chris want to sit together in **two neighboring seats**.
   - Two seats are considered neighboring if:
     - They are in the same row.
     - They belong to the same pair (either both in the first pair or both in the second pair).

4. **Your Task**:
   - Based on the current seating arrangement, determine if there is any pair of neighboring seats available for ZS and Chris to sit together.
   - If there is such a pair, you need to determine their location.

### Input:
- A 2D seating array or string representation showing the bus's seating configuration, where:
  - 'X' indicates an occupied seat.
  - 'O' indicates an empty seat.

### Example Bus Configuration:
Assume the input might look like this for 3 rows:
```
OXXO
XOOX
XXOO
```
- In the first row, the first and last seats are available but not neighboring.
- In the second row, the two middle seats are available and neighboring.
- In the third row, the last two seats are available and neighboring.

### Steps to Solve:
1. **Check Each Row**:
   - For each row, there are two pairs of seats:
     - First pair: Seats at positions 1 and 2.
     - Second pair: Seats at positions 3 and 4.
   
2. **Check if Any Pair is Empty**:
   - For each row, check if both seats in either the first or second pair are empty ('O').

3. **Return the Result**:
   - If such a pair exists, return the row and pair number where ZS and Chris can sit.
   - If no such pair exists in any row, return a result indicating that there are no available seats.

### Example Walkthrough:
Let's consider the example configuration:
```
OXXO
XOOX
XXOO
```

- **Row 1**: No neighboring empty seats.
- **Row 2**: Seats 2 and 3 are both 'O', so ZS and Chris can sit here.
- **Row 3**: Seats 3 and 4 are both 'O', so they can also sit here.

Therefore, possible valid answers are in row 2 or row 3.

This problem mainly involves checking for neighboring empty seats in a structured grid of rows and pairs of seats, ensuring that ZS and Chris can sit together without being separated by occupied seats.
Input
The first line of the input contains a single integer n (1 ≤ n ≤ 1000) — the number of rows of seats in the bus.
Then, n lines follow. Each line contains exactly 5 characters, the first two of them denote the first pair of seats in the row, the third character denotes the walkway (it always equals '|') and the last two of them denote the second pair of seats in the row.
Each character, except the walkway, equals to 'O' or to 'X'. 'O' denotes an empty seat, 'X' denotes an occupied seat. See the sample cases for more details.

Q- infer : 
As i can see 
‘O’ → mean that the seat is empty 
‘X’ → mean that the seat is full


Q- can you explain it using your own words ? 

We we have two friends zc and chris 

→ they are going in a trip so that use a bus , the bus has same configuration 
Liek this xx | xx 
Each row contain 2 paris of sets separated by “|” 
The friends can a goal they want to set next to each other either in the first two set or the other set 

Q- you goal is to help them first it’s possible yes or now next to change the configuration based on it 

Q- what is the input & output 

N: int number of rows  

matrix : represent the initial configuration where 

O→ empty set 
And X —> occupied one 

Output : 

First line “Yes” or “No”

If “Yes” we need to reconfigure the output oky 

Q- can you go through an example ? 

6
OO|OX
XO|XX
OX|OO
XX|OX
OO|OO
OO|XX

We need to search each row one by one and for each row traverse it’s columns pariwizz ( 4 column in total ) 

We find a pair that has both “OO” we return yes and update it by it’s position (i, j) to become “++” 

For example 
In this example we have the first row 

Oo | ox 
Traversing col pairwise 
We find out that “oo” is potent solution so we return “yes “ 

And update it “++” and we break from the loop 

Q- what the coding problem here 

Q- the idea i have but the first difficult is how to parse the input ? the efficient solutio to convert it to matrix and apply matrix transversal but how ?