open Batteries
let n = Scanf.scanf "%d" (fun x -> x)
let stats =
  Array.init n (fun _ -> Scanf.scanf " %s" (fun s ->
    let l = String.to_list s in
    Array.init 26 (fun i ->
      let c = char_of_int (i + 97) in
      List.filter ((=) c) l |> List.length
    )))

let () =
  Array.init 26 (fun i ->
    let c = char_of_int (i+97) in
    Array.init n (fun j -> stats.(j).(i))
    |> Array.fold_left min 50
    |> fun z -> Enum.iter (fun v -> Printf.printf "%c" c) (1--z)
  ) |> ignore;
  print_newline ()