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

public class aplusb_md_assert implements Runnable {
    private BufferedReader in;
    private PrintWriter out;
    private final char FIRST = 'a';
    private final int SIZE = 26;
    
    private void myAssert(boolean invariant, String msg) {
    	if (invariant)
    		return;
    	System.err.println("ERROR: " + msg);
    	out.println("ERROR: " + msg);
    	out.close();
    	System.exit(1);
    }

    public void run() {
        try {
            solve();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    private void solve() throws IOException {
        Locale.setDefault(Locale.US);
        in = new BufferedReader(new FileReader("aplusb.in"));
        out = new PrintWriter("aplusb.out");
        StringTokenizer st = new StringTokenizer(in.readLine());
        int n = Integer.parseInt(st.nextToken());
        int v = Integer.parseInt(st.nextToken());
        myAssert(n >= 1 && n <= 100000, "invalid n");
        myAssert(v >= 1 && v <= 100000, "invalid v");
        myAssert(n * (long) v <= 100000, "n * v too large");
        myAssert(!st.hasMoreTokens(), "extra info in first line");
        boolean[][] set = new boolean[n][SIZE];
        for (int i = 0; i < v; i++) {
            String s = in.readLine();
            myAssert(s.equals(s.trim()), "extra spaces in string " + i);
            myAssert(s.length() == n, "length <> n in string " + i);
            for (int j = 0; j < n; j++) {
            	myAssert(s.charAt(j) >= 'a' && s.charAt(j) <= 'z', "bad character in string " + i);
                set[j][s.charAt(j) - FIRST] = true;
            }
        }
        String a = in.readLine();
        String b = in.readLine();
        myAssert(a.equals(a.trim()), "extra spaces in A");
        myAssert(a.length() == n, "length <> n in A");
        myAssert(b.equals(b.trim()), "extra spaces in B");
        myAssert(b.length() == n, "length <> n in B");
        for (int j = 0; j < n; j++) {
        	myAssert(a.charAt(j) >= 'a' && a.charAt(j) <= 'z', "bad character in A");
            myAssert(!set[j][a.charAt(j) - FIRST], "A is non-orthogonal to V, position " + j);
        	myAssert(b.charAt(j) >= 'a' && b.charAt(j) <= 'z', "bad character in B");
            myAssert(!set[j][b.charAt(j) - FIRST], "B is non-orthogonal to V, position " + j);
        }
        StringBuilder c = new StringBuilder(n);
        c.setLength(n);
        char[] chars = new char[SIZE];
        int carry = 0;
        for (int i = n - 1; i >= 0; i--) {
            int mod = 0;
            int sa = a.charAt(i) - FIRST;
            int sb = b.charAt(i) - FIRST;
            for (int j = 0; j < SIZE; j++) {
                if (!set[i][j]) {
                    chars[mod] = (char) (FIRST + j);
                    if (sa == j)
                        carry += mod;
                    if (sb == j)
                        carry += mod;
                    mod++;
                }
            }
            c.setCharAt(i, chars[carry % mod]);
            carry /= mod;
        }
        out.println(c);
        in.close();
        out.close();
    }

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