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