[TASK]:
You will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.

[INSTRUCTION]:
The following libraries are already included in the code.
```cpp
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <fstream>
#include <climits>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <bitset>
using namespace std;
```
Do not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.

[PSEUDOCODE]:
create a map from long longs to long longs called mpu
let vec be a vector of long longs
declare string array s with size 101
let path be long long array with size 1000006
define the main function
    declare long long variable n
    read n
    for i from 0 to n exclusive, read s[i]
    let row and col be boolean arrays with size 100
    for i from 0 to n exclusive
        for j from 0 to n exclusive
            if s[i][j] is equal to '.'
                set row[i] to 1
                set col[j] to 1
            end of the block
        end of the block
    end of the block
    create int p = 0
    loop i from 0 to n exclusive
        if row[i] is false, set p to 1
    end of the block
    if p is equal to 1
        for integer i = 0 to n exclusive
            if col[i] is false, change p to 2
        end of the block
        if p = 2
            print "-1\n"
            return to indicate successful execution
        end of the block
        loop i from 0 to n exclusive
            for j from 0 to n exclusive
                if col[j] = 1 and s[i][j] is equal to '.'
                    set col[j] to 0
                    print i + 1, " " and j + 1
                end of the block
            end of the block
        end of the block
        return to indicate successful execution
    else
        for integer i = 0 to n exclusive
            loop j from 0 to n exclusive
                if s[i][j] = '.'
                    print i + 1, " " and j + 1
                    break the loop
                end of the block
            end of the block
        end of the block
    end of the block
    return to indicate successful execution
end of the block

[CODE]:

map<long long, long long> mpu;
vector<long long> vec;
string s[101];
long long path[1000006] = {};
int main() {
    long long n;
    cin >> n;
    for (int i = 0; i < n; i++) cin >> s[i];
    bool row[100] = {}, col[100] = {};
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (s[i][j] == '.') {
                row[i] = 1;
                col[j] = 1;
            }
        }
    }
    int p = 0;
    for (int i = 0; i < n; i++) {
        if (!row[i]) p = 1;
    }
    if (p == 1) {
        for (int i = 0; i < n; i++) {
            if (!col[i]) p = 2;
        }
        if (p == 2) {
            cout << "-1\n";
            return 0;
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (col[j] == 1 && s[i][j] == '.') {
                    col[j] = 0;
                    cout << (i + 1) << " " << (j + 1) << endl;
                }
            }
        }
        return 0;
    } else {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (s[i][j] == '.') {
                    cout << (i + 1) << " " << (j + 1) << endl;
                    break;
                }
            }
        }
    }
    return 0;
}