[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]:
declare constant integer M = 2e5 + 5
declare integer arrays G size 200 by 200, T size 200 by 200
define the main function
    declare integers n, m, i, j
    read n, m
    declare boolean f = 0
    for i = 1 to n inclusive
        for j = 1 to m inclusive
            read G[i][j]
            let T[i][j] be G[i][j]
        end of the block
    declare integer vectors r,, c
    for i = 1 to n inclusive
        declare integer mn = 1000
        for j = 1 to m inclusive, let mn be minimum of ( mn and G[i][j] )
        for j = 1 to m inclusive, decrement G[i][j] by mn
        for j = 1 to mn inclusive, add i to end of r
    end of the block
    for i = 1 to m inclusive
        declare integer mn = 1000
        for j = 1 to n inclusive, let mn be minimum of ( mn and G[j][i] )
        for j = 1 to n inclusive, decrement G[j][i] by mn
        for j = 1 to mn inclusive, add i to end of c
    end of the block
    for i = 1 to n inclusive
        for j = 1 to m inclusive
            if G[i][j] is true
                print "-1\n"
                return to indicate successful execution
            end of the block
            let G[i][j] be T[i][j]
        end of the block
    declare integer vectors r1, c1
    for i = 1 to m inclusive
        declare integer mn = 1000
        for j = 1 to n inclusive, let mn be minimum of ( mn and G[j][i] )
        for j = 1 to n inclusive, decrement G[j][i] by mn
        for j = 1 to mn inclusive, add i to end of c1
    end of the block
    for i = 1 to n inclusive
        declare integer mn = 1000
        for j = 1 to n inclusive, let mn be minimum of ( mn and G[j][i] )
        for j = 1 to n inclusive, decrement G[j][i] by mn
        for j = 1 to mn inclusive, add i to end of r1
    end of the block
    if size of r + size of c is greater than size of r1 + size of c1
        let r be r1
        let c be c1
    end of the block
    print size of r + size of c, "\n"
    for i = 0 to size of r exclusive
        print "row "
        print r[i], "\n"
    end of the block
    for i = 0 to size of c exclusive
        print "col "
        print c[i], "\n"
    end of the block
    return to indicate successful execution
end of the block

[CODE]:

const int M = 2e5 + 5;
int G[200][200], T[200][200];
int main() {
    int n, m, i, j;
    cin >> n >> m;
    bool f = 0;
    for (i = 1; i <= n; i++)
        for (j = 1; j <= m; j++) {
            cin >> G[i][j];
            T[i][j] = G[i][j];
        }
    vector<int> r, c;
    for (i = 1; i <= n; i++) {
        int mn = 1000;
        for (j = 1; j <= m; j++) mn = min(mn, G[i][j]);
        for (j = 1; j <= m; j++) G[i][j] -= mn;
        for (j = 1; j <= mn; j++) r.push_back(i);
    }
    for (i = 1; i <= m; i++) {
        int mn = 1000;
        for (j = 1; j <= n; j++) mn = min(mn, G[j][i]);
        for (j = 1; j <= n; j++) G[j][i] -= mn;
        for (j = 1; j <= mn; j++) c.push_back(i);
    }
    for (i = 1; i <= n; i++)
        for (j = 1; j <= m; j++) {
            if (G[i][j]) {
                cout << "-1\n";
                return 0;
            }
            G[i][j] = T[i][j];
        }
    vector<int> r1, c1;
    for (i = 1; i <= m; i++) {
        int mn = 1000;
        for (j = 1; j <= n; j++) mn = min(mn, G[j][i]);
        for (j = 1; j <= n; j++) G[j][i] -= mn;
        for (j = 1; j <= mn; j++) c1.push_back(i);
    }
    for (i = 1; i <= n; i++) {
        int mn = 1000;
        for (j = 1; j <= m; j++) mn = min(mn, G[i][j]);
        for (j = 1; j <= m; j++) G[i][j] -= mn;
        for (j = 1; j <= mn; j++) r1.push_back(i);
    }
    if (r.size() + c.size() > r1.size() + c1.size()) {
        r = r1;
        c = c1;
    }
    cout << r.size() + c.size() << "\n";
    for (i = 0; i < r.size(); i++) {
        cout << "row ";
        cout << r[i] << "\n";
    }
    for (i = 0; i < c.size(); i++) {
        cout << "col ";
        cout << c[i] << "\n";
    }
    return 0;
}