public static void main ( String [ ] args ) {
  Scanner s = new Scanner ( System . in ) ;
  int arraySize = Integer . parseInt ( s . nextLine ( ) . trim ( ) ) ;
  ArrayList < String > words = new ArrayList ( ) ;
  for ( int i = 0 ;
  i < arraySize ;
  i ++ ) {
    words . add ( s . nextLine ( ) . trim ( ) ) ;
  }
  ArrayList < ArrayList < Character >> keeper = new ArrayList ( ) ;
  for ( int i = 0 ;
  i < arraySize ;
  i ++ ) {
    ArrayList < Character > temp = new ArrayList ( ) ;
    char [ ] tempArr = words . get ( i ) . toCharArray ( ) ;
    for ( int x = 0 ;
    x < tempArr . length ;
    x ++ ) {
      temp . add ( tempArr [ x ] ) ;
    }
    keeper . add ( temp ) ;
  }
  ArrayList < Character > resultWords = new ArrayList ( ) ;
  for ( char c : keeper . get ( 0 ) ) {
    boolean shouldAdd = true ;
    for ( int index = 1 ;
    index < keeper . size ( ) ;
    index ++ ) {
      ArrayList < Character > arr = keeper . get ( index ) ;
      if ( arr . contains ( c ) ) {
        arr . remove ( ( Object ) c ) ;
      }
      else {
        shouldAdd = false ;
      }
    }
    if ( shouldAdd ) {
      resultWords . add ( c ) ;
    }
  }
  String result = "" ;
  while ( ! resultWords . isEmpty ( ) ) {
    char c = findLeast ( resultWords ) ;
    result += c ;
    resultWords . remove ( ( Object ) c ) ;
  }
  System . out . println ( result ) ;
}

public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int arraySize = Integer . parseInt ( s . nextLine ( ) . trim ( ) ) ; ArrayList < String > words = new ArrayList ( ) ; for ( int i = 0 ; i < arraySize ; i ++ ) { words . add ( s . nextLine ( ) . trim ( ) ) ; } ArrayList < ArrayList < Character > > keeper = new ArrayList ( ) ; for ( int i = 0 ; i < arraySize ; i ++ ) { ArrayList < Character > temp = new ArrayList ( ) ; char [ ] tempArr = words . get ( i ) . toCharArray ( ) ; for ( int x = 0 ; x < tempArr . length ; x ++ ) { temp . add ( tempArr [ x ] ) ; } keeper . add ( temp ) ; } ArrayList < Character > resultWords = new ArrayList ( ) ; for ( char c : keeper . get ( 0 ) ) { boolean shouldAdd = true ; for ( int index = 1 ; index < keeper . size ( ) ; index ++ ) { ArrayList < Character > arr = keeper . get ( index ) ; if ( arr . contains ( c ) ) { arr . remove ( ( Object ) c ) ; } else { shouldAdd = false ; } } if ( shouldAdd ) { resultWords . add ( c ) ; } } String result = " " ; while ( ! resultWords . isEmpty ( ) ) { char c = findLeast ( resultWords ) ; result += c ; resultWords . remove ( ( Object ) c ) ; } System . out . println ( result ) ; }
(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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (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: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list))))))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (generic_type (type_identifier) (type_arguments (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: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (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: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) body: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (cast_expression type: (type_identifier) value: (identifier)))))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (false))))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (while_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (cast_expression type: (type_identifier) value: (identifier))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))