[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]:
define the main function
    curr is a 2d array of integers 3 by 3 with elements 1, 1, 1, 1, 1, 1, 1, 1, 1
    actions is a 2d array of integers 3 by 3
    for i = 0 to 3 exclusive
        for j = 0 to 3 exclusive, read actions[i][j]
    end of the block
    for i = 0 to 3 exclusive
        for j = 0 to 3 exclusive
            if actions[i][j] is odd
                if curr[i][j] = 1
                    set curr[i][j] to 0
                else
                    assign 1 to curr[i][j]
                if j is greater than 0
                    if curr[i][j - 1] = 1
                        assign 0 to curr[i][j - 1]
                    else
                        assign 1 to curr[i][j - 1]
                end of the block
                if i is greater than 0
                    if curr[i - 1][j] = 1
                        assign 0 to curr[i - 1][j]
                    else
                        assign 1 to curr[i - 1][j]
                end of the block
                if j is less than 2
                    if curr[i][j + 1] = 1
                        change curr[i][j + 1] to 0
                    else
                        change curr[i][j + 1] to 1
                end of the block
                if i is less than 2
                    if curr[i + 1][j] is equal to 1
                        assign 0 to curr[i + 1][j]
                    else
                        assign 1 to curr[i + 1][j]
                end of the block
            end of the block
        end of the block
    end of the block
    for i from 0 to 3 exclusive
        for j = 0 to 3 exclusive, print curr[i][j]
        print new line
    end of the block
    return to indicate successful execution
end of the block

[CODE]:

int main() {
    int curr[3][3] = {1, 1, 1, 1, 1, 1, 1, 1, 1};
    int actions[3][3];
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) { cin >> actions[i][j]; }
    }
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            if (actions[i][j] % 2 == 1) {
                if (curr[i][j] == 1)
                    curr[i][j] = 0;
                else
                    curr[i][j] = 1;
                if (j > 0) {
                    if (curr[i][j - 1] == 1)
                        curr[i][j - 1] = 0;
                    else
                        curr[i][j - 1] = 1;
                }
                if (i > 0) {
                    if (curr[i - 1][j] == 1)
                        curr[i - 1][j] = 0;
                    else
                        curr[i - 1][j] = 1;
                }
                if (j < 2) {
                    if (curr[i][j + 1] == 1)
                        curr[i][j + 1] = 0;
                    else
                        curr[i][j + 1] = 1;
                }
                if (i < 2) {
                    if (curr[i + 1][j] == 1)
                        curr[i + 1][j] = 0;
                    else
                        curr[i + 1][j] = 1;
                }
            }
        }
    }
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) { cout << curr[i][j]; }
        cout << endl;
    }
    return 0;
}