human
Alice has written a program and now tries to improve its readability. One of the ways to improve readability is to give sensible names to the variables, so now Alice wants to rename some variables in her program. In her IDE there is a command called "massive refactoring", which can replace names of many variable in just one run. To use it, Alice needs to select two strings s and t and after that for each variable the following algorithm is performed: if the variable's name contains s as a substring, then the first (and only first) occurrence of s is replaced with t. If the name doesn't contain s, then this variable's name stays the same.

The list of variables is known and for each variable both the initial name and the name Alice wants this variable change to are known. Moreover, for each variable the lengths of the initial name and the target name are equal (otherwise the alignment of the code could become broken). You need to perform renaming of all variables in exactly one run of the massive refactoring command or determine that it is impossible.

Input

The first line contains the only integer n (1 ≤ n ≤ 3000) — the number of variables in Alice's program.

The following n lines contain the initial names of variables w_1, w_2, …, w_n, one per line. After that, n more lines go, the i-th of them contains the target name w'_i for the i-th variable. It is guaranteed that 1 ≤ |w_i| = |w'_i| ≤ 3000.

It is guaranteed that there is at least one variable having its target name different from the initial name. Both initial and target names consist of lowercase English letters only. For each variable the length of its initial name is equal to the length of its target name.

Output

If it is impossible to rename all variables with one call of "massive refactoring", print "NO" (quotes for clarity).

Otherwise, on the first line print "YES" (quotes for clarity) and on the following lines print s and t (1 ≤ |s|, |t| ≤ 5000), which should be used for replacement. Strings s and t should consist only of lowercase letters...
from
assistant
#Here is Python program to determine that it is impossible.
__future__ import division
from fileinput import input
from itertools import izip

class Ned:
    def all_matches(self, haystack):
        #max_prefix_suffix = self.precompute_max_prefix_suffix(needle)
        i = 0
        overlap_region = 0
        while i <= len(haystack) - len(self.needle):
            k = self.match_len(self.needle, haystack, i, overlap_region)
            if k == len(self.needle):
                return i
            overlap_region = self.max_prefix_suffix[k]
            i += self.amount_to_advance(self.max_prefix_suffix, k)
        return -1

    # Returns an array such that:
    # - len(result) == len(needle) + 1
    # - result[k] is the length of the longest prefix of needle[0:k], not counting
    #   needle[0:k] itself, that's also a suffix of needle[0:k]
    def __init__(self, needle):
        self.needle = needle
        result = [0] * (len(needle) + 1)
        # We start from 2 because we always have result[0] == result[1] == 0
        for k in xrange(2, len(needle) + 1):
            l_minus_one = result[k - 1]
            while l_minus_one > 0 and needle[l_minus_one] != needle[k - 1]:
                # Repeated "calls to max_prefix_suffix" become repeated array lookups
                l_minus_one = result[l_minus_one]
            if needle[l_minus_one] == needle[k - 1]:
                result[k] = l_minus_one + 1
        self.max_prefix_suffix = result

    # Given that needle[0:overlap_region] == haystack[i:i+overlap_region], returns
    # the largest k such that needle[0:k] == haystack[i:i+k]
    def match_len(self, needle, haystack, i, overlap_region):
        for j in xrange(overlap_region, len(needle)):
            if needle[j] != haystack[i + j]:
                return j
        return len(needle)

    def amount_to_advance(self, max_prefix_suffix, k):
        if k == 0:
            return 1
        return k - max_prefix_suffix[k]

def alleq(li):
    for c in li[1:]:
        if c != li[0]:
            return False
    return True

def mkst(r):
    out = ""
    for c in...