public static void main ( String [ ] args ) {
  int i , j , n , m , a [ ] [ ] , b [ ] [ ] ;
  String a1 [ ] ;
  Scanner sc = new Scanner ( System . in ) ;
  n = sc . nextInt ( ) ;
  m = sc . nextInt ( ) ;
  a = new int [ n ] [ m ] ;
  b = new int [ n ] [ m ] ;
  a1 = new String [ n ] ;
  for ( i = 0 ;
  i < n ;
  i ++ ) a1 [ i ] = sc . next ( ) ;
  for ( i = 0 ;
  i < n ;
  i ++ ) for ( j = 0 ;
  j < m ;
  j ++ ) a [ i ] [ j ] = Character . getNumericValue ( a1 [ i ] . charAt ( j ) ) ;
  for ( i = 0 ;
  i < n ;
  i ++ ) for ( j = 0 ;
  j < m ;
  j ++ ) b [ i ] [ j ] = 0 ;
  for ( i = 0 ;
  i < n - 2 ;
  i ++ ) {
    for ( j = 1 ;
    j < m - 1 ;
    j ++ ) {
      if ( a [ i ] [ j ] != 0 ) {
        b [ i + 1 ] [ j ] = a [ i ] [ j ] ;
        a [ i + 1 ] [ j - 1 ] -= a [ i ] [ j ] ;
        a [ i + 1 ] [ j + 1 ] -= a [ i ] [ j ] ;
        a [ i + 2 ] [ j ] -= a [ i ] [ j ] ;
        a [ i ] [ j ] = 0 ;
      }
    }
  }
  for ( i = 0 ;
  i < n ;
  i ++ ) {
    for ( j = 0 ;
    j < m ;
    j ++ ) System . out . print ( b [ i ] [ j ] ) ;
    System . out . println ( "" ) ;
  }
}

public static void main ( String [ ] args ) { int i , j , n , m , a [ ] [ ] , b [ ] [ ] ; String a1 [ ] ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; m = sc . nextInt ( ) ; a = new int [ n ] [ m ] ; b = new int [ n ] [ m ] ; a1 = new String [ n ] ; for ( i = 0 ; i < n ; i ++ ) a1 [ i ] = sc . next ( ) ; for ( i = 0 ; i < n ; i ++ ) for ( j = 0 ; j < m ; j ++ ) a [ i ] [ j ] = Character . getNumericValue ( a1 [ i ] . charAt ( j ) ) ; for ( i = 0 ; i < n ; i ++ ) for ( j = 0 ; j < m ; j ++ ) b [ i ] [ j ] = 0 ; for ( i = 0 ; i < n - 2 ; i ++ ) { for ( j = 1 ; j < m - 1 ; j ++ ) { if ( a [ i ] [ j ] != 0 ) { b [ i + 1 ] [ j ] = a [ i ] [ j ] ; a [ i + 1 ] [ j - 1 ] -= a [ i ] [ j ] ; a [ i + 1 ] [ j + 1 ] -= a [ i ] [ j ] ; a [ i + 2 ] [ j ] -= a [ i ] [ j ] ; a [ i ] [ j ] = 0 ; } } } for ( i = 0 ; i < n ; i ++ ) { for ( j = 0 ; j < m ; j ++ ) System . out . print ( b [ i ] [ j ] ) ; System . out . println ( " " ) ; } }
(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: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) dimensions: (dimensions))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) dimensions: (dimensions))) (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)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)) dimensions: (dimensions_expr (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)) dimensions: (dimensions_expr (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (array_creation_expression type: (type_identifier) dimensions: (dimensions_expr (identifier))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (decimal_integer_literal))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (decimal_integer_literal))))))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))))))