[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
    n = integer
    read n
    forbid = vector of string
    for i = 0 to n exclusive
        s = string
        read s
        s1 = string with s1 = ""
        for j = 0 to s.size() exclusive
            a = character with a = s[j]
            if (a <= Z), a = a - A + a
            s1 = s1 + a
        end of the block
        append s1 to forbid
    end of the block
    occur = vector integer array of size 100
    s = string
    read s
    s1 = string with s1 = ""
    for j = 0 to s.size() exclusive
        a = character with a = s[j]
        if (a <= Z), a = a - A + a
        s1 = s1 + a
    end of the block
    for i = 0 to n exclusive
        copy = string with copy = s1
        pre = integer with pre = 0
        while (copy.size() > 0 and copy.find(forbid[i]) is not npos string)
            append copy.find(forbid[i]) + pre to occur[i]
            pre = pre + copy.find(forbid[i]) + 1
            copy = copy.substr(copy.find(forbid[i]) + 1)
        end of the block
    end of the block
    letter = character
    read letter
    first = bool array of size 100
    important = integer array of size 100
    set all contents of first to true
    set all contents of important to 0
    for i = 0 to n exclusive
        for j = 0 to occur[i].size() exclusive
            for k = 0 to occur[i][j] + k < s.size() and k < forbid[i].size()
                if (first[occur[i][j] + k])
                    first[occur[i][j] + k] = false
                    if (s[occur[i][j] + k] is letter)
                        important[occur[i][j] + k] = 1
                    else if (s[occur[i][j] + k] is letter - a + A)
                        important[occur[i][j] + k] = 2
                    end of the block
                end of the block
                if (s[occur[i][j] + k] <= Z)
                    s[occur[i][j] + k] = letter - a + A
                else
                    s[occur[i][j] + k] = letter
            end of the block
        end of the block
    end of the block
    for i = 0 to s.size() exclusive
        c1 = character with c1 = a
        if (letter is a), c1 = b
        if (important[i] is 1)
            s[i] = c1
        else if (important[i] is 2)
            s[i] = c1 - a + A
        end of the block
    end of the block
    print s
    return to indicate successful execution
end of the block

[CODE]:

int main() {
    int n;
    cin >> n;
    vector<string> forbid;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        string s1 = "";
        for (int j = 0; j < s.size(); j++) {
            char a = s[j];
            if (a <= 'Z') a = a - 'A' + 'a';
            s1 += a;
        }
        forbid.push_back(s1);
    }
    vector<int> occur[100];
    string s;
    cin >> s;
    string s1 = "";
    for (int j = 0; j < s.size(); j++) {
        char a = s[j];
        if (a <= 'Z') a = a - 'A' + 'a';
        s1 += a;
    }
    for (int i = 0; i < n; i++) {
        string copy = s1;
        int pre = 0;
        while (copy.size() > 0 && copy.find(forbid[i]) != string::npos) {
            occur[i].push_back(copy.find(forbid[i]) + pre);
            pre += copy.find(forbid[i]) + 1;
            copy = copy.substr(copy.find(forbid[i]) + 1);
        }
    }
    char letter;
    cin >> letter;
    bool first[100];
    int important[100];
    memset(first, true, sizeof(first));
    memset(important, 0, sizeof(important));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < occur[i].size(); j++) {
            for (int k = 0; occur[i][j] + k < s.size() && k < forbid[i].size(); k++) {
                if (first[occur[i][j] + k]) {
                    first[occur[i][j] + k] = false;
                    if (s[occur[i][j] + k] == letter) {
                        important[occur[i][j] + k] = 1;
                    } else if (s[occur[i][j] + k] == letter - 'a' + 'A') {
                        important[occur[i][j] + k] = 2;
                    }
                }
                if (s[occur[i][j] + k] <= 'Z')
                    s[occur[i][j] + k] = letter - 'a' + 'A';
                else
                    s[occur[i][j] + k] = letter;
            }
        }
    }
    for (int i = 0; i < s.size(); i++) {
        char c1 = 'a';
        if (letter == 'a') c1 = 'b';
        if (important[i] == 1) {
            s[i] = c1;
        } else if (important[i] == 2) {
            s[i] = c1 - 'a' + 'A';
        }
    }
    cout << s << endl;
    return 0;
}