#include <stdio.h>


int main(void)
{
    int a, b, n, s = 0;
    char str[50][51];
    
    scanf("%d", &n);
    printf("Check value. n[%d]\n", n);

    for(a = 0; a < n; a++) {
        scanf("%s", str[a]);
    }

    while(str[0][s] != ' ') {
        s++;
    }

    for (a = 0; a < n; a++) {
        for (b = 0; b < s; b++) {
            if (str[a][b] != str[a+1][b]) {
                str[a+1][b] = '?';
            }
        }

    }

    printf("%s", str[n - 1]);

    return 0;
}
