[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]:
MAXN = const int with MAXN = 200
bad = string, bool map
change = bool array of size MAXN
define the main function
    n = int
    read n
    for i = 0 to n
        s = string
        read s
        for t = 0 to length of s
            if s[t] >= 'A' and s[t] <= 'Z' set s[t] to 'a' + s[t] - 'A'
        set bad[s] to true
    end of the block
    u = string
    lucky = char
    read u then lucky
    for i = 0 to length of u
        cur = string
        for t = i to length of u
            increment cur by (u[t] - 'A' + 'a') as char if u[t] >= 'A' and u[t] <= 'Z' else u[t]
            if bad[cur]
                for j = i to t inclusive set change[j] to true
        end of the block
    end of the block
    for i = 0 to length of u
        if change[i]
            if u[i] is lucky
                if lucky is 'a'
                    set u[i] to 'b'
                else
                    set u[i] to 'a'
            else if u[i] - 'A' + 'a' is lucky
                if lucky is 'a'
                    set u[i] to 'B'
                else
                    set u[i] to 'A'
            else if u[i] >= 'A' and u[i] <= 'Z'
                set u[i] to lucky - 'a' + 'A'
            else
                set u[i] to lucky
    print u
end of the block

[CODE]:

const int MAXN = 200;
map<string, bool> bad;
bool change[MAXN];
int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        for (int t = 0; t < s.length(); t++)
            if (s[t] >= 'A' && s[t] <= 'Z') s[t] = 'a' + s[t] - 'A';
        bad[s] = true;
    }
    string u;
    char lucky;
    cin >> u >> lucky;
    for (int i = 0; i < u.length(); i++) {
        string cur;
        for (int t = i; t < u.length(); t++) {
            cur += ((u[t] >= 'A' && u[t] <= 'Z') ? (char)(u[t] - 'A' + 'a') : u[t]);
            if (bad[cur])
                for (int j = i; j <= t; j++) change[j] = true;
        }
    }
    for (int i = 0; i < u.length(); i++)
        if (change[i])
            if (u[i] == lucky)
                if (lucky == 'a')
                    u[i] = 'b';
                else
                    u[i] = 'a';
            else if (u[i] - 'A' + 'a' == lucky)
                if (lucky == 'a')
                    u[i] = 'B';
                else
                    u[i] = 'A';
            else if (u[i] >= 'A' && u[i] <= 'Z')
                u[i] = lucky - 'a' + 'A';
            else
                u[i] = lucky;
    cout << u << "\n";
}