

def get_str(st, i, len_val):
    ret = '?'*len_val
    for s in st:
        ret[i] = s
        i += 1
    return ret

def main():
    a = input()
    b = input()
    c = input()


    total_len = 6001

    def f(a1, b1, c1):
        nonlocal total_len
        for A,B,C in zip(a1,b1,c1):
            if len(set([char for char in [A,B,C] if char != '?'])) > 1:
                return False
        while a1[-1] != '?':
            a1 = a1[:-1]
        if len(a1) < total_len:
            total_len = len(a1)
        return True

    a_temp = get_str(a,0,len(a)+len(b)+len(c))

    for i in range(len(a)+len(b)+len(c)):
        try:
            b_temp = get_str(b,i,len(a)+len(b)+len(c))
            for j in range(len(a)+len(b)+len(c)):
                try:
                    c_temp = get_str(c,j,len(a)+len(b)+len(c))

                except:
                    pass
        except:
            pass

if __name__ == '__main__':
    main()
