Problem: You have an integer sequence of length N: a_1, a_2, ..., a_N.

You repeatedly perform the following operation until the length of the sequence becomes 1:

* First, choose an element of the sequence.
* If that element is at either end of the sequence, delete the element.
* If that element is not at either end of the sequence, replace the element with the sum of the two elements that are adjacent to it. Then, delete those two elements.



You would like to maximize the final element that remains in the sequence.

Find the maximum possible value of the final element, and the way to achieve it.

Constraints

* All input values are integers.
* 2 \leq N \leq 1000
* |a_i| \leq 10^9

Input

Input is given from Standard Input in the following format:


N
a_1 a_2 ... a_N


Output

* In the first line, print the maximum possible value of the final element in the sequence.
* In the second line, print the number of operations that you perform.
* In the (2+i)-th line, if the element chosen in the i-th operation is the x-th element from the left in the sequence at that moment, print x.
* If there are multiple ways to achieve the maximum value of the final element, any of them may be printed.

Examples

Input

5
1 4 3 7 5


Output

11
3
1
4
2


Input

4
100 100 -1 100


Output

200
2
3
1


Input

6
-1 -2 -3 1 2 3


Output

4
3
2
1
2


Input

9
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000


Output

5000000000
4
2
2
2
2

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
#define pi 3.1415926535897932384626
using namespace std;
      
struct P{
  int x, y;
  bool operator < (const P &a )const{
    //if(x!=a.x)
    return y<a.y;
  };
};

int a,b,c,d,i,k,n,m,e,dx[10]={1,0,-1,0,1,1,-1,-1},dy[10]={0,1,0,-1,1,-1,1,-1};
int o[2122];
int l[21];
int j[21];


long long x,y,z,mod=1000000007;
//string r;
char r[22][22];

P u[1];
queue<int> q;
stack<int> s;
//set<P> s;
map<int,int> p;

vector<int> v;

bool as(P a,P b)
{
  //if(a.x!=b.x)
  //return a.x<b.x;
  return a.x<b.x;
}

void f(int k)
{
  q.push(k);
  if(k==1)
  {
    swap(x,y);
    for(int t=2;t<=n;t++)
      o[t-1]=o[t];
    n--;
    return;
  }
  if(k==n)
  {
    n--;
    return;
  }
  o[k-1]+=o[k+1];
  n-=2;
  for(int t=k;t<=n;t++)
  {
    o[t]=o[t+2];
  }
}

int main()
{
  scanf("%d",&a);
  for(int t=1;t<=a;t++)
  {
    scanf("%d",&o[t]);
    if(t%2&&o[t]>=0) x+=o[t],e=1;
    else if(o[t]>=0) y+=o[t],e=1;
  }
  if(!e)
  {
    k=-mod;
    for(int t=1;t<=a;t++)
      k=max(k,o[t]);
    printf("%d\n%d\n",k,a-1);
    int t=a;
    for(;o[t]!=k;t--)
    {
      printf("%d\n",t);
    }
    t--;
    for(;t;t--)
    puts("1");
    return 0;
  }
  n=a;
  printf("%lld\n",max(x,y));
  for(int t=n;t;t--)
  {
    if(t%2&&x>y&&o[t]<0) f(t);
    else if(t%2==0&&x<=y&&o[t]<0) f(t);
  }
  for(int t=n;t;t--)
  {
    if(x>y&&t%2==0) f(t);
    else if(x<=y&&t%2) f(t);
  }
  printf("%d\n",q.size());
  for(;q.size();q.pop())
    printf("%d\n",q.front());
}
//0
//13
//20