let n = read_int ()
let ss = Array.init n @@ fun _ -> read_line ()
let cs = Array.make 128 0
let f s x = let n = ref 0 in String.iter (fun c -> if c = x then incr n) s; !n
let _ = Array.(Char.(for i = code 'a' to code 'z' do let m = ref 50 in iter (fun s -> m := min !m @@ f s @@ chr i) ss; cs.(i) <- !m done;
  iteri (fun i c -> print_string @@ String.make c @@ chr i) cs)); print_newline ()