[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]:
n, m = integers
k = integer
debug = bool with debug = false
bl = integer array of size 103
define the main function
    read n
    s, a, ss, S, let = strings with a = array of size n
    for i = 0 to n exclusive
        read a[i]
        transform(a[i].begin(), a[i].end(), a[i].begin(), tolower)
    end of the block
    read S, let
    resize S.size() of ss
    transform(S.begin(), S.end(), ss.begin(), tolower)
    for i = 0 to n exclusive
        pos = long long with pos = ss.find(a[i])
        while (pos is not string npos)
            for j = 0 to a[i].size() exclusive, bl[j + pos] = 1
            pos = ss.find(a[i], pos + 1)
        end of the block
    end of the block
    ans = string with ans = ""
    for i = 0 to ss.size() exclusive
        if (bl[i])
            if (ss[i] is let[0])
                if (ss[i] is not a)
                    if (isupper(S[i]))
                        ans = ans + A
                    else
                        ans = ans + a
                else
                    if (isupper(S[i]))
                        ans = ans + B
                    else
                        ans = ans + b
                end of the block
                continue next iteration
            end of the block
            if (isupper(S[i]))
                ans = ans + toupper(let[0])
            else
                ans = ans + let
        else
            ans = ans + S[i]
        end of the block
    end of the block
    print ans.c_str()
    return to indicate successful execution
end of the block

[CODE]:

int n, m;
int k;
bool debug = false;
int bl[103];
int main() {
    cin >> n;
    string s, a[n], ss, S, let;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        transform(a[i].begin(), a[i].end(), a[i].begin(), ::tolower);
    }
    cin >> S >> let;
    ss.resize(S.size());
    transform(S.begin(), S.end(), ss.begin(), ::tolower);
    for (int i = 0; i < n; i++) {
        long long pos = ss.find(a[i]);
        while (pos != string::npos) {
            for (int j = 0; j < a[i].size(); j++) { bl[j + pos] = 1; }
            pos = ss.find(a[i], pos + 1);
        }
    }
    string ans = "";
    for (int i = 0; i < ss.size(); i++) {
        if (bl[i]) {
            if (ss[i] == let[0]) {
                if (ss[i] != 'a') {
                    if (isupper(S[i]))
                        ans += 'A';
                    else
                        ans += 'a';
                } else {
                    if (isupper(S[i]))
                        ans += 'B';
                    else
                        ans += 'b';
                }
                continue;
            }
            if (isupper(S[i]))
                ans += toupper(let[0]);
            else
                ans += let;
        } else {
            ans += S[i];
        }
    }
    puts(ans.c_str());
    return 0;
}