After a lot of effort, Bytie has finally managed to place n rooks on an n×n board so that no two of them attack each other. As a reminder, a rook attacks every square that lies in the same row or the same column as it.
Unfortunately, Bytie has now accidentally bumped the board and several rooks have fallen off. Leaving every rook that is still on the board exactly where it is, help Bytie put the fallen rooks back so that all n rooks are on the board again and no two of them attack each other.
The first line contains one integer n (2≤n≤1000), the size of the board. Each of the next n lines contains n characters describing the current configuration. The character '.' is an empty square, and the character 'W' is a square occupied by a rook.
There are w rooks on the board with 1≤w≤n−1, and no two of them attack each other.
Print n lines of n characters each ('.' or 'W') describing the completed board. It must contain exactly n rooks, keep every initial rook in its original position, and have no two rooks attacking each other.
Because the n−w fallen rooks can be placed in more than one way, print the lexicographically smallest such board. Treat the board as the string formed by its output lines read top to bottom, each line left to right, and consider '.' to come before 'W'.