[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]:
let maxn be const integer with maxn = 1e5 + 10
let arr be array of booleans of size maxn
let s be string and ss be array of strings of size maxn
let c be char
let n be integer
in function input
    read n
    for i = 0 to n exclusive, read ss[i]
    read s, c
end of the block
in function low which takes char x and returns char
    if x is greater than or equal to A and x is less than or equal to Z, update x to x - 'A' + 'a'
    return x
end of the block
define the main function
    call input
    let w be integer with w = size of s
    for i = 0 to n exclusive
        for wi = 0 to till wi + size of ss[i] - 1 is less than w
            let b be boolean with b = true
            for ssj = wi to till ssj is less than wi + size of ss[i]
                if low of s[ssj] is not equal to low of ss[i][ssj-wi]
                    set b to false
                    break
                end of the block
            end of the block
            if b is not false
                for ssj = wi to till ssj is less than wi + size of ss[i], set arr[ssj] to true
        end of the block
    end of the block
    for i = 0 to w exclusive
        if arr[i] is not zero
            if low of s[i] is equal to c
                if c is equal to 'a'
                    update s[i] to s[i] + ('b' - low of s[i])
                else
                    update s[i] to s[i] + ('a' - low of s[i])
            else
                update s[i] to s[i] + (c - low of s[i])
        end of the block
    print out s with newline
end of the block

[CODE]:

const int maxn = 1e5 + 10;
bool arr[maxn];
string s, ss[maxn];
char c;
int n;
void input() {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> ss[i];
    cin >> s >> c;
}
char low(char x) {
    if (x >= 'A' && x <= 'Z') x = x - 'A' + 'a';
    return x;
}
int main() {
    input();
    int w = s.size();
    for (int i = 0; i < n; i++) {
        for (int wi = 0; wi + ss[i].size() - 1 < w; wi++) {
            bool b = true;
            for (int ssj = wi; ssj < wi + ss[i].size(); ssj++) {
                if (low(s[ssj]) != low(ss[i][ssj - wi])) {
                    b = false;
                    break;
                }
            }
            if (b)
                for (int ssj = wi; ssj < wi + ss[i].size(); ssj++) arr[ssj] = true;
        }
    }
    for (int i = 0; i < w; i++)
        if (arr[i]) {
            if (low(s[i]) == c) {
                if (c == 'a')
                    s[i] += ('b' - low(s[i]));
                else
                    s[i] += ('a' - low(s[i]));
            } else
                s[i] += (c - low(s[i]));
        }
    cout << s << endl;
}