public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int N = Integer . parseInt ( sc . next ( ) ) ;
  String [ ] S = new String [ N ] ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    S [ i ] = sc . next ( ) ;
  }
  int [ ] xmin = new int [ 26 ] ;
  for ( int n = 0 ;
  n < 26 ;
  n ++ ) xmin [ n ] = 50 ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    int [ ] x = new int [ 26 ] ;
    for ( char a : S [ i ] . toCharArray ( ) ) {
      x [ ABCNumber ( a ) ] ++ ;
    }
    for ( int n = 0 ;
    n < 26 ;
    n ++ ) {
      xmin [ n ] = Math . min ( xmin [ n ] , x [ n ] ) ;
    }
  }
  char [ ] abc = "abcdefghijklmnopqrstuvwxyz" . toCharArray ( ) ;
  StringBuilder sb = new StringBuilder ( ) ;
  for ( int n = 0 ;
  n < 26 ;
  n ++ ) {
    for ( int cnt = 0 ;
    cnt < xmin [ n ] ;
    cnt ++ ) sb . append ( abc [ n ] ) ;
  }
  System . out . println ( sb . toString ( ) ) ;
  sc . close ( ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; String [ ] S = new String [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { S [ i ] = sc . next ( ) ; } int [ ] xmin = new int [ 26 ] ; for ( int n = 0 ; n < 26 ; n ++ ) xmin [ n ] = 50 ; for ( int i = 0 ; i < N ; i ++ ) { int [ ] x = new int [ 26 ] ; for ( char a : S [ i ] . toCharArray ( ) ) { x [ ABCNumber ( a ) ] ++ ; } for ( int n = 0 ; n < 26 ; n ++ ) { xmin [ n ] = Math . min ( xmin [ n ] , x [ n ] ) ; } } char [ ] abc = " abcdefghijklmnopqrstuvwxyz " . toCharArray ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int n = 0 ; n < 26 ; n ++ ) { for ( int cnt = 0 ; cnt < xmin [ n ] ; cnt ++ ) sb . append ( abc [ n ] ) ; } System . out . println ( sb . toString ( ) ) ; sc . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list)) body: (block (expression_statement (update_expression (array_access array: (identifier) index: (method_invocation name: (identifier) arguments: (argument_list (identifier)))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (array_access array: (identifier) index: (identifier)))))))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (string_literal) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) update: (update_expression (identifier)) body: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))