public static void main ( String [ ] args ) throws Exception {
  Scanner sc = new Scanner ( System . in ) ;
  PrintWriter pw = new PrintWriter ( System . out ) ;
  String text = sc . nextLine ( ) ;
  int n = text . length ( ) ;
  StringBuilder str = new StringBuilder ( text ) ;
  int i = 0 , j = 0 ;
  for ( i = 0 ;
  i < str . length ( ) ;
  i ++ ) {
    if ( str . charAt ( i ) == ' ' ) {
      j = i + 1 ;
      while ( j < str . length ( ) && str . charAt ( j ) == ' ' ) {
        str . deleteCharAt ( j ) ;
      }
    }
  }
  for ( i = 0 ;
  i < str . length ( ) ;
  i ++ ) {
    if ( str . charAt ( i ) == '.' || str . charAt ( i ) == ',' || str . charAt ( i ) == '!' || str . charAt ( i ) == '?' ) {
      if ( str . charAt ( i - 1 ) == ' ' ) {
        str . deleteCharAt ( i - 1 ) ;
        i -= 1 ;
      }
      if ( str . charAt ( i + 1 ) != ' ' ) {
        str . insert ( i + 1 , ' ' ) ;
      }
    }
  }
  if ( str . charAt ( str . length ( ) - 1 ) == ' ' ) str . deleteCharAt ( str . length ( ) - 1 ) ;
  pw . print ( str . toString ( ) ) ;
  pw . close ( ) ;
}

public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; String text = sc . nextLine ( ) ; int n = text . length ( ) ; StringBuilder str = new StringBuilder ( text ) ; int i = 0 , j = 0 ; for ( i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == ' ▁ ' ) { j = i + 1 ; while ( j < str . length ( ) && str . charAt ( j ) == ' ▁ ' ) { str . deleteCharAt ( j ) ; } } } for ( i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == ' . ' || str . charAt ( i ) == ' , ' || str . charAt ( i ) == ' ! ' || str . charAt ( i ) == ' ? ' ) { if ( str . charAt ( i - 1 ) == ' ▁ ' ) { str . deleteCharAt ( i - 1 ) ; i -= 1 ; } if ( str . charAt ( i + 1 ) != ' ▁ ' ) { str . insert ( i + 1 , ' ▁ ' ) ; } } } if ( str . charAt ( str . length ( ) - 1 ) == ' ▁ ' ) str . deleteCharAt ( str . length ( ) - 1 ) ; pw . print ( str . toString ( ) ) ; pw . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_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: (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: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) 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 (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (character_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (character_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (character_literal)))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) right: (character_literal))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))))) (expression_statement (method_invocation object: (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)))))