import java.util.*;
import java.io.*;

public class aplusb_as implements Runnable {
    public void solve() throws IOException {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int m = in.nextInt();

        String[] s = new String[m];
        boolean[][] ban = new boolean[n][26];
        for (int i = 0; i < m; i++) {
            s[i] = in.next();
            for (int j = 0; j < n; j++) {
                ban[j][s[i].charAt(j) - 'a'] = true;
            }
        }

        String a = in.next();
        String b = in.next();

        int[] sz = new int[n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < 26; j++) {
                if (!ban[i][j]) {
                    sz[i]++;
                }
            }
        }

        int[] av = new int[n];
        int[] bv = new int[n];
        for (int i = 0; i < n; i++) {
            int ac = a.charAt(i) - 'a';
            for (int j = 0; j < ac; j++) {
                if (!ban[i][j]) {
                    av[i]++;
                }
            }
            int bc = b.charAt(i) - 'a';
            for (int j = 0; j < bc; j++) {
                if (!ban[i][j]) {
                    bv[i]++;
                }
            }
        }

        int[] cv = new int[n];
        int carry = 0;
        for (int i = n - 1; i >= 0; i--) {
            int cc = (av[i] + bv[i] + carry) % sz[i];
            carry = (av[i] + bv[i] + carry) / sz[i];
            cv[i] = cc;
        }

        StringBuilder c = new StringBuilder();
        for (int i = 0; i < n; i++) {
            int z = 0;
            for (int j = 0; j < 26; j++) {
                if (!ban[i][j]) {
                    if (z == cv[i]) {
                        c.append((char) ('a' + j));
                        break;
                    } else {
                        z++;
                    }
                }
            }
        }

        out.println(c);


        in.close();
        out.close();
    }

    public void run() {
        try {
            solve();
        } catch (IOException e) {
        }
    }

    public static void main(String[] arg) {
        new Thread(new aplusb_as()).start();
    }
}
