<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described.
<END_TASK>
<USER_TASK:>
Description:
Maximize the sum of array by multiplying prefix of array with
Python implementation of the approach ; To store sum ; To store ending indices of the chosen prefix arrays ; Adding the absolute value of a [ i ] ; If i == 0 then there is no index to be flipped in ( i - 1 ) position ; print the maximised sum ; print the ending indices of the chosen prefix arrays ; Driver Code

<ASSISTANT_TASK:>
Python Code:
def maxSum(arr , n ) : 
	 s = 0 
 l =[] 
 for i in range(len(a ) ) : 
	 s += abs(a[i ] ) 
 if(a[i ] >= 0 ) : 
	 continue 
  if(i == 0 ) : 
	 l . append(i + 1 ) 
  else : 
	 l . append(i + 1 ) 
 l . append(i ) 
   print(s ) 
 print(* l ) 
  n = 4 
 a =[1 , - 2 , - 3 , 4 ] 
 maxSum(a , n ) 

<END_TASK>
