#include <iostream>
#include <cmath>

using namespace std;

const int primero=1<<17;
const int tope=1<<18;
const int infinito=1000000000;

void maximiza(int &val,int newval)
{
  if (newval>val) val=newval;
}

int maximo[tope][21][2][2];

void insertar(int pos,int val)
{
  pos+=primero;
  for (int j=1;j<=20;j++)
    maximo[pos][j][1][1]=val;
  while (pos>1) {
    pos>>=1;
    int pos0=pos<<1;
    int pos1=pos0|1;
    for (int j=1;j<=20;j++) {
      for (int i0=0;i0<2;i0++)
	for (int i1=0;i1<2;i1++)
	  maximo[pos][j][i0][i1]=-infinito;
      maximo[pos][j][0][0]=0;
      for (int j0=0;j0<=j;j0++) {
	int j1=j-j0;
        maximiza(maximo[pos][j][0][0],max(maximo[pos0][j0][0][0]+max(maximo[pos1][j1][0][0],
								     maximo[pos1][j1][1][0]),
					  maximo[pos0][j0][0][1]+maximo[pos1][j1][0][0]));
	maximiza(maximo[pos][j][0][1],max(maximo[pos0][j0][0][0]+max(maximo[pos1][j1][0][1],
								     maximo[pos1][j1][1][1]),
					  maximo[pos0][j0][0][1]+maximo[pos1][j1][0][1]));
	maximiza(maximo[pos][j][1][0],max(maximo[pos0][j0][1][0]+max(maximo[pos1][j1][0][0],
								     maximo[pos1][j1][1][0]),
					  maximo[pos0][j0][1][1]+maximo[pos1][j1][0][0]));
	maximiza(maximo[pos][j][1][1],max(maximo[pos0][j0][1][0]+max(maximo[pos1][j1][0][1],
								     maximo[pos1][j1][1][1]),
					  maximo[pos0][j0][1][1]+maximo[pos1][j1][0][1]));
      }
      for (int j0=1;j0<=j;j0++) {
	int j1=j-j0+1;
	maximiza(maximo[pos][j][0][0],maximo[pos0][j0][0][1]+maximo[pos1][j1][1][0]);
	maximiza(maximo[pos][j][0][1],maximo[pos0][j0][0][1]+maximo[pos1][j1][1][1]);
	maximiza(maximo[pos][j][1][0],maximo[pos0][j0][1][1]+maximo[pos1][j1][1][0]);
	maximiza(maximo[pos][j][1][1],maximo[pos0][j0][1][1]+maximo[pos1][j1][1][1]);
      }
    }
  }
}

int maximole[21][2],maximori[21][2];
int nextmaximole[21][2],nextmaximori[21][2];

int maximoentre(int posle,int posri,int k)
{
  posle+=primero;
  posri+=primero;
  if (posle==posri) return maximo[posle][1][1][1];
  for (int j=1;j<=20;j++) {
    maximole[j][0]=0;
    maximole[j][1]=maximo[posle][1][1][1];
    maximori[j][0]=0;
    maximori[j][1]=maximo[posri][1][1][1];
  }
  while (posle+1<posri) {
    if ((posle&1)==0) {
      int pos1=posle+1;
      for (int j=1;j<=20;j++) {
	for (int i0=0;i0<2;i0++)
	  nextmaximole[j][i0]=0;
	for (int j0=0;j0<=j;j0++) {
	  int j1=j-j0;
	  maximiza(nextmaximole[j][0],max(maximole[j0][0]+max(maximo[pos1][j1][0][0],
							      maximo[pos1][j1][1][0]),
					  maximole[j0][1]+maximo[pos1][j1][0][0]));
	  maximiza(nextmaximole[j][1],max(maximole[j0][0]+max(maximo[pos1][j1][0][1],
							      maximo[pos1][j1][1][1]),
					  maximole[j0][1]+maximo[pos1][j1][0][1]));
	}
	for (int j0=1;j0<=j;j0++) {
	  int j1=j-j0+1;
	  maximiza(nextmaximole[j][0],maximole[j0][1]+maximo[pos1][j1][1][0]);
	  maximiza(nextmaximole[j][1],maximole[j0][1]+maximo[pos1][j1][1][1]);
	}
      }
      for (int j=1;j<=20;j++) {
	maximole[j][0]=nextmaximole[j][0];
	maximole[j][1]=nextmaximole[j][1];
      }
    }
    if (posri&1) {
      int pos0=posri-1;
      for (int j=1;j<=20;j++) {
	for (int i0=0;i0<2;i0++)
	  nextmaximori[j][i0]=0;
	for (int j0=0;j0<=j;j0++) {
	  int j1=j-j0;
	  maximiza(nextmaximori[j][0],max(maximo[pos0][j0][0][0]+max(maximori[j1][0],
								       maximori[j1][1]),
					    maximo[pos0][j0][0][1]+maximori[j1][0]));
	  maximiza(nextmaximori[j][1],max(maximo[pos0][j0][1][0]+max(maximori[j1][0],
								       maximori[j1][1]),
					    maximo[pos0][j0][1][1]+maximori[j1][0]));
	}
	for (int j0=1;j0<=j;j0++) {
	  int j1=j-j0+1;
	  maximiza(nextmaximori[j][0],maximo[pos0][j0][0][1]+maximori[j1][1]);
	  maximiza(nextmaximori[j][1],maximo[pos0][j0][1][1]+maximori[j1][1]);
	}
      }
      for (int j=1;j<=20;j++) {
	maximori[j][0]=nextmaximori[j][0];
	maximori[j][1]=nextmaximori[j][1];
      }
    }
    posle>>=1;
    posri>>=1;
  }
  int sol=0;
  {
    int j=k;
    for (int j0=0;j0<=j;j0++) {
      int j1=j-j0;
      maximiza(sol,max(maximole[j0][0]+max(maximori[j1][0],maximori[j1][1]),
		       maximole[j0][1]+maximori[j1][0]));
    }
    for (int j0=1;j0<=j;j0++) {
      int j1=j-j0+1;
      maximiza(sol,maximole[j0][1]+maximori[j1][1]);
    }
  }
  return sol;
}

int main()
{
  ios::sync_with_stdio(false);
  for (int pos=1;pos<tope;pos++)
    maximo[pos][0][1][1]=maximo[pos][0][0][1]=maximo[pos][0][1][0]=-infinito;
  int n;
  cin>>n;
  for (int i=1;i<=n;i++) {
    int a;
    cin>>a;
    insertar(i,a);
  }
  int casos;
  cin>>casos;
  for (int cas=0;cas<casos;cas++) {
    int tipo;
    cin>>tipo;
    if (tipo==0) {
      int i,val;
      cin>>i>>val;
      insertar(i,val);
    } else {
      int l,r,k;
      cin>>l>>r>>k;
      cout<<maximoentre(l,r,k)<<endl;
    }
  }
}


#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

const int infinito=1000000000;

struct info {
  int m,i1,i2;
  info() {
    m=-infinito;
  }
  info(int inm,int ini1,int ini2) {
    m=inm;i1=ini1;i2=ini2;
  }
};

bool operator<(info inf1,info inf2)
{
  return inf1.m<inf2.m;
}

const int tope=1<<18;
const int primero=1<<17;

info maximo[tope],minimo[tope];
pair<int,int> maximole[tope],minimole[tope],maximori[tope],minimori[tope];
int signo[tope];
int suma[tope];

void signar(int &x)
{
  x=-x;
}

void cambiarsigno(int pos)
{
  signar(maximo[pos].m);
  signar(minimo[pos].m);
  swap(maximo[pos],minimo[pos]);
  signar(maximole[pos].first);
  signar(minimole[pos].first);
  swap(maximole[pos],minimole[pos]);
  signar(maximori[pos].first);
  signar(minimori[pos].first);
  swap(maximori[pos],minimori[pos]);
  signar(suma[pos]);
}

void actualizar(int pos)
{
  suma[pos]=suma[2*pos]+suma[2*pos+1];
  maximole[pos]=max(maximole[2*pos],
		    pair<int,int> (suma[2*pos]+maximole[2*pos+1].first,maximole[2*pos+1].second));
  minimole[pos]=min(minimole[2*pos],
		    pair<int,int> (suma[2*pos]+minimole[2*pos+1].first,minimole[2*pos+1].second));
  maximori[pos]=max(maximori[2*pos+1],
		    pair<int,int> (suma[2*pos+1]+maximori[2*pos].first,maximori[2*pos].second));
  minimori[pos]=min(minimori[2*pos+1],
		    pair<int,int> (suma[2*pos+1]+minimori[2*pos].first,minimori[2*pos].second));
  maximo[pos]=max(maximo[2*pos],
		  max(maximo[2*pos+1],
		      info(maximori[2*pos].first+maximole[2*pos+1].first,
			   maximori[2*pos].second,maximole[2*pos+1].second)));
  minimo[pos]=min(minimo[2*pos],
		  min(minimo[2*pos+1],
		      info(minimori[2*pos].first+minimole[2*pos+1].first,
			   minimori[2*pos].second,minimole[2*pos+1].second)));
  if (signo[pos]==-1)
    cambiarsigno(pos);
}

void subir(int pos)
{
  while (pos>1) {
    pos/=2;
    actualizar(pos);
  }
}

void cambiarsigno(int pos1,int pos2)
{
  if (pos1==pos2) {
    cambiarsigno(pos1);
    signar(signo[pos1]);
    subir(pos1);
    return;
  }
  cambiarsigno(pos1);
  signar(signo[pos1]);
  cambiarsigno(pos2);
  signar(signo[pos2]);
  while (pos1/2!=pos2/2) {
    if (pos1%2==0) {
      cambiarsigno(pos1+1);
      signar(signo[pos1+1]);
    }
    pos1/=2;
    actualizar(pos1);
    if (pos2%2==1) {
      cambiarsigno(pos2-1);
      signar(signo[pos2-1]);
    }
    pos2/=2;
    actualizar(pos2);
  }
  subir(pos1);
}

void insertar(int pos,int val)
{
  pos+=primero;
  suma[pos]=val;
  maximole[pos]=minimole[pos]=maximori[pos]=minimori[pos]=pair<int,int> (val,pos);
  maximo[pos]=minimo[pos]=info(val,pos,pos);
  subir(pos);
}

info maximoentre(int pos0,int pos1)
{
  pos0+=primero;
  pos1+=primero;
  info maxi,mini;
  if (pos0==pos1) {
    maxi=maximo[pos0];
    mini=minimo[pos0];
  } else {
    info ma0=maximo[pos0];
    info ma1=maximo[pos1];
    info mi0=minimo[pos0];
    info mi1=minimo[pos1];
    pair<int,int> maxi0=maximori[pos0],mini0=minimori[pos0],
      maxi1=maximole[pos1],mini1=minimole[pos1];
    while (pos0/2!=pos1/2) {
      if (pos0%2==0) {
	ma0=max(ma0,
		max(maximo[pos0+1],
		    info(maxi0.first+maximole[pos0+1].first,maxi0.second,maximole[pos0+1].second)));
	mi0=min(mi0,
		min(minimo[pos0+1],
		    info(mini0.first+minimole[pos0+1].first,mini0.second,minimole[pos0+1].second)));
	maxi0=max(maximori[pos0+1],
		  pair<int,int> (maxi0.first+suma[pos0+1],maxi0.second));
	mini0=min(minimori[pos0+1],
		  pair<int,int> (mini0.first+suma[pos0+1],mini0.second));
      }
      pos0/=2;
      if (signo[pos0]==-1) {
	signar(ma0.m);
	signar(mi0.m);
	swap(ma0,mi0);
	signar(maxi0.first);
	signar(mini0.first);
	swap(maxi0,mini0);
      }
      if (pos1%2==1) {
	ma1=max(ma1,
		max(maximo[pos1-1],
		    info(maxi1.first+maximori[pos1-1].first,maximori[pos1-1].second,maxi1.second)));
	mi1=min(mi1,
		min(minimo[pos1-1],
		    info(mini1.first+minimori[pos1-1].first,minimori[pos1-1].second,mini1.second)));
	maxi1=max(maximole[pos1-1],
		  pair<int,int> (maxi1.first+suma[pos1-1],maxi1.second));
	mini1=min(minimole[pos1-1],
		  pair<int,int> (mini1.first+suma[pos1-1],mini1.second));
      }
      pos1/=2;
      if (signo[pos1]==-1) {
	signar(ma1.m);
	signar(mi1.m);
	swap(ma1,mi1);
	signar(maxi1.first);
	signar(mini1.first);
	swap(maxi1,mini1);
      }
    }
    maxi=max(max(ma0,ma1),
	     info(maxi0.first+maxi1.first,maxi0.second,maxi1.second));
    mini=min(min(mi0,mi1),
	     info(mini0.first+mini1.first,mini0.second,mini1.second));
  }
  while (pos0>1) {
    pos0/=2;
    if (signo[pos0]==-1) {
      signar(maxi.m);
      signar(mini.m);
      swap(maxi,mini);
    }
  }
  return maxi;
}

int main()
{
  int n;
  cin>>n;
  for (int i=1;i<tope;i++)
    signo[i]=1;
  for (int i=0;i<primero;i++)
    insertar(i,-1000);
  for (int i=1;i<=n;i++) {
    int a;
    cin>>a;
    insertar(i,a);
  }
  int casos;
  cin>>casos;
  for (int cas=0;cas<casos;cas++) {
    int tipo;
    cin>>tipo;
    if (tipo==0) {
      int i,val;
      cin>>i>>val;
      insertar(i,val);
    } else {
      int l,r,k;
      cin>>l>>r>>k;
      int sol=0;
      vector<pair<int,int> > v;
      while (k) {
	k--;
	info maxi=maximoentre(l,r);
	if (maxi.m<=0) break;
	sol+=maxi.m;
	int i1=maxi.i1;
	int i2=maxi.i2;
	v.push_back(pair<int,int> (i1,i2));
	cambiarsigno(i1,i2);
      }
      for (int i=0;i<int(v.size());i++)
	cambiarsigno(v[i].first,v[i].second);
      cout<<sol<<endl;
    }
  }
}


#include <iostream>
#include <cmath>

using namespace std;

const int primero=1<<17;
const int tope=1<<18;
const int infinito=1000000000;

void maximiza(int &val,int newval)
{
  if (newval>val) val=newval;
}

int maximo[tope][21][2][2];
int pendiente[tope];

void insertar(int pos,int val)
{
  pos+=primero;
  for (int j=1;j<=20;j++)
    maximo[pos][j][1][1]=val;
  while (pos>1) {
    pos>>=1;
    pendiente[pos]=1;
  }
}

void actualizar(int pos)
{
  if (not pendiente[pos]) return;
  pendiente[pos]=0;
  int pos0=pos<<1;
  int pos1=pos0|1;
  actualizar(pos0);
  actualizar(pos1);
  for (int j=1;j<=20;j++) {
    int (&m)[2][2]=maximo[pos][j];
    for (int i0=0;i0<2;i0++)
      for (int i1=0;i1<2;i1++)
	m[i0][i1]=-infinito;
    m[0][0]=0;
    for (int j0=0;j0<=j;j0++) {
      int j1=j-j0;
      int (&m0)[2][2]=maximo[pos0][j0];
      int (&m1)[2][2]=maximo[pos1][j1];
      maximiza(m[0][0],max(m0[0][0]+max(m1[0][0],
					m1[1][0]),
			   m0[0][1]+m1[0][0]));
      maximiza(m[0][1],max(m0[0][0]+max(m1[0][1],
					m1[1][1]),
			   m0[0][1]+m1[0][1]));
      maximiza(m[1][0],max(m0[1][0]+max(m1[0][0],
					m1[1][0]),
			   m0[1][1]+m1[0][0]));
      maximiza(m[1][1],max(m0[1][0]+max(m1[0][1],
					m1[1][1]),
			   m0[1][1]+m1[0][1]));
    }
    for (int j0=1;j0<=j;j0++) {
      int j1=j-j0+1;
      int (&m0)[2][2]=maximo[pos0][j0];
      int (&m1)[2][2]=maximo[pos1][j1];
      maximiza(m[0][0],m0[0][1]+m1[1][0]);
      maximiza(m[0][1],m0[0][1]+m1[1][1]);
      maximiza(m[1][0],m0[1][1]+m1[1][0]);
      maximiza(m[1][1],m0[1][1]+m1[1][1]);
    }
  }
}

int maximole[21][2],maximori[21][2];
int nextmaximole[21][2],nextmaximori[21][2];

int maximoentre(int posle,int posri,int k)
{
  posle+=primero;
  posri+=primero;
  if (posle==posri) return maximo[posle][1][1][1];
  for (int j=1;j<=k;j++) {
    maximole[j][0]=0;
    maximole[j][1]=maximo[posle][1][1][1];
    maximori[j][0]=0;
    maximori[j][1]=maximo[posri][1][1][1];
  }
  while (posle+1<posri) {
    if ((posle&1)==0) {
      int pos1=posle+1;
      actualizar(pos1);
      for (int j=1;j<=k;j++) {
	for (int i0=0;i0<2;i0++)
	  nextmaximole[j][i0]=0;
	for (int j0=0;j0<=j;j0++) {
	  int j1=j-j0;
	  maximiza(nextmaximole[j][0],max(maximole[j0][0]+max(maximo[pos1][j1][0][0],
							      maximo[pos1][j1][1][0]),
					  maximole[j0][1]+maximo[pos1][j1][0][0]));
	  maximiza(nextmaximole[j][1],max(maximole[j0][0]+max(maximo[pos1][j1][0][1],
							      maximo[pos1][j1][1][1]),
					  maximole[j0][1]+maximo[pos1][j1][0][1]));
	}
	for (int j0=1;j0<=j;j0++) {
	  int j1=j-j0+1;
	  maximiza(nextmaximole[j][0],maximole[j0][1]+maximo[pos1][j1][1][0]);
	  maximiza(nextmaximole[j][1],maximole[j0][1]+maximo[pos1][j1][1][1]);
	}
      }
      for (int j=1;j<=k;j++) {
	maximole[j][0]=nextmaximole[j][0];
	maximole[j][1]=nextmaximole[j][1];
      }
    }
    if (posri&1) {
      int pos0=posri-1;
      actualizar(pos0);
      for (int j=1;j<=k;j++) {
	for (int i0=0;i0<2;i0++)
	  nextmaximori[j][i0]=0;
	for (int j0=0;j0<=j;j0++) {
	  int j1=j-j0;
	  maximiza(nextmaximori[j][0],max(maximo[pos0][j0][0][0]+max(maximori[j1][0],
								       maximori[j1][1]),
					    maximo[pos0][j0][0][1]+maximori[j1][0]));
	  maximiza(nextmaximori[j][1],max(maximo[pos0][j0][1][0]+max(maximori[j1][0],
								       maximori[j1][1]),
					    maximo[pos0][j0][1][1]+maximori[j1][0]));
	}
	for (int j0=1;j0<=j;j0++) {
	  int j1=j-j0+1;
	  maximiza(nextmaximori[j][0],maximo[pos0][j0][0][1]+maximori[j1][1]);
	  maximiza(nextmaximori[j][1],maximo[pos0][j0][1][1]+maximori[j1][1]);
	}
      }
      for (int j=1;j<=k;j++) {
	maximori[j][0]=nextmaximori[j][0];
	maximori[j][1]=nextmaximori[j][1];
      }
    }
    posle>>=1;
    posri>>=1;
  }
  int sol=0;
  {
    int j=k;
    for (int j0=0;j0<=j;j0++) {
      int j1=j-j0;
      maximiza(sol,max(maximole[j0][0]+max(maximori[j1][0],maximori[j1][1]),
		       maximole[j0][1]+maximori[j1][0]));
    }
    for (int j0=1;j0<=j;j0++) {
      int j1=j-j0+1;
      maximiza(sol,maximole[j0][1]+maximori[j1][1]);
    }
  }
  return sol;
}

int main()
{
  ios::sync_with_stdio(false);
  for (int pos=1;pos<tope;pos++)
    maximo[pos][0][1][1]=maximo[pos][0][0][1]=maximo[pos][0][1][0]=-infinito;
  int n;
  cin>>n;
  for (int i=1;i<=n;i++) {
    int a;
    cin>>a;
    insertar(i,a);
  }
  int casos;
  cin>>casos;
  for (int cas=0;cas<casos;cas++) {
    int tipo;
    cin>>tipo;
    if (tipo==0) {
      int i,val;
      cin>>i>>val;
      insertar(i,val);
    } else {
      int l,r,k;
      cin>>l>>r>>k;
      cout<<maximoentre(l,r,k)<<endl;
    }
  }
}


# include <iostream>
using namespace std;
const int MAXN = 1000+5;

int main(){
	int n;
	int arr[MAXN];
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> arr[i];
	}
	for(int i=0;i<n;i++){
		if(arr[i]&1){
			printf("%d ",arr[i]);
		}
		else printf("%d ",arr[i]-1);
	}
}


# include <cstdio>
# include <iostream>
using namespace std;
const int MAXN = 1000+5;

int main(){
	int n;
	int arr[MAXN];
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> arr[i];
	}
	for(int i=0;i<n;i++){
		if(arr[i]&1){
			printf("%d ",arr[i]);
		}
		else printf("%d ",arr[i]-1);
	}
}


#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;

void array_changer(vector<int> &m, vector<int> &dum1, long long int n1){
  for(int i=0;i<dum1.size();i++){
		for(int j=0;j<n1;j++){
		  if (dum1[i]%2==0) {if (m[j]==dum1[i]) m[j]=dum1[i]-1;}
			else {if (m[j]==dum1[i]) m[j]=dum1[i]+1;}
		}
	}
for(int i=0;i<n1;i++){
		cout<<m[i]<<" ";
}
 return;
}

int main(){
  long long int n;
	cin>>n;
	vector<int> v(n,0);
	vector<int> dum(n,0);
	//	long long int arr[n],maxi=0;

	for(int i=0;i<n;i++)
	{
	  cin>>v[i];
	  dum[i]=v[i];
	  //maxi = max(maxi,arr[i]);
	}

	sort(dum.begin(),dum.end());
	array_changer(v,dum,n);

}


#include<iostream>
#include<cmath>
using namespace std;

void array_changer(long long int m[],long long int n1,long long int maxi1){
	for(int i=1;i<=maxi1;i++){
		for(int j=0;j<n1;j++){
			if(i%2==0) {if (m[j]==i) m[j]=i-1;}
			else {if (m[j]==i) m[j]=i+1;}
		}
	}
for(int i=0;i<n1;i++){
		cout<<m[i]<<" ";
}
}

int main(){
	long long int n;
	cin>>n;
	long long int arr[n],maxi=0;

	for(int i=0;i<n;i++)
	{
		cin>>arr[i];
		maxi = max(maxi,arr[i]);
	}

	array_changer(arr,n,maxi);

}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
  long long int n;
	cin>>n;
	vector<int> v(n,0);
	vector<int> dum(n,0);
	//	long long int arr[n],maxi=0;

	for(int i=0;i<n;i++)
	{
	  cin>>v[i];
	  dum[i]=v[i];
	  //maxi = max(maxi,arr[i]);
	}

	sort(dum.begin(),dum.end());
	dum.erase(unique(dum.begin(),dum.end()),dum.end());
	long long int a=dum.size();
	for (int i=0;i<dum.size();i++){

	  for (int j=0;j<n;j++){
	    if (dum[i]==v[j]) {if (v[j]%2==0) v[j]=v[j]-1;}
	  }}
	for (int i=0;i<n;i++){
	  cout<<v[i]<<" ";
}
}


#include <iostream>
#include <vector>
using namespace std;

long long n;
int main(){
    cin>>n;
    vector<long long> vec;
    long long a;
    for(long long i=0; i<n; i++){
        cin>>a;
        if(a%2 == 0){
            a--;
        }else{
            a++;
        }
        vec.push_back(a);
    }
    for(long long i=0; i<n; i++){
        cout<<vec[i]<<" ";
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;

long long n;

int main(){
    cin>>n;
    vector<long long> vec;
    long long a;
    for(long long i=0; i<n; i++){
        cin>>a;
        if(a%2 == 0) a--;
        vec.push_back(a);
    }
    for(long long i=0; i<n; i++){
        cout<<vec[i]<<" ";
    }
    return 0;
}


#include<iostream>
#include<cstring>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long a[n],s=INT_MIN;
    for(int i=0;i<n;i++){cin>>a[i];if(a[i]>s)s=a[i];}
    for(int i=1;i<=s+2;i+=2)
    {
        for(int j=0;j<n;j++)
            if(a[j]==i)
                a[j]=i+1;
        for(int j=0;j<n;j++)
            if(a[j]==i+1)
                a[j]=i;
    }
    for(int i=0;i<n;i++)cout<<a[i]<<" ";
    return 0;
}


#include<iostream>
#include<cstring>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long a[n],b[n];
    for(int i=0;i<n;i++){cin>>a[i];b[i]=a[i];}
    for(int i=0;i<n;i++)for(int j=i+1;j<n;j++)if(b[i]>b[j])swap(b[i],b[j]);
    int s=b[n-1];
    for(int i=1;i<=s+2;i+=2)
    {
        for(int j=0;j<n;j++)
        {
            if(a[j]==i)
            {
                a[j]=i+1;
            }
        }
        for(int j=0;j<n;j++)
        {
            if(a[j]==i+1)
            {
                a[j]=i;
            }
        }
    }
    for(int i=0;i<n;i++)cout<<a[i]<<" ";
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<Windows.h>
#include<conio.h>
#include<time.h>

#define Map_long 20
#define Map_high 15

typedef struct snake{
    int goods_class;
    int direction;
}SNAKE;
SNAKE Snake[Map_high][Map_long] = { { 0 } };
unsigned die = 0;
unsigned snake_move = 0;
unsigned eat_food = 0;
unsigned snake_long = 3;
void Move(int ch);
void HideCursor();
int main(void)
{
    system("mode con:cols=43 lines=20");
    HideCursor();
    unsigned i, j;
    unsigned food = 0;
    unsigned food_x, food_y;
    unsigned score = 0;
    char ch = '\0';
    srand((unsigned)time(NULL));
    for (i = 0; i < Map_long; i++)
    {
        Snake[0][i].goods_class = 1;
        Snake[Map_high - 1][i].goods_class = 1;
    }
    for (i = 0; i < Map_high; i++)
    {
        Snake[i][0].goods_class = 1;
        Snake[i][Map_long - 1].goods_class = 1;
    }
    for (i = 0; i < snake_long; i++)
        Snake[Map_high / 2][Map_long / 2 + i].goods_class = snake_long + i;

    while (1)
    {
        while (!_kbhit())
        {
            switch (ch)
            {
            case 72:Move(8); break;
            case 75:Move(4); break;
            case 77:Move(6); break;
            case 80:Move(2); break;
            default:break;
            }

            if (eat_food == 2)
            {
                food = 0;
                eat_food = 0;
                snake_long++;
                score++;
            }
            do{
                if (food == 1)
                    break;
                food_x = rand() % Map_long;
                food_y = rand() % Map_high;
                if (Snake[food_y][food_x].goods_class == 0)
                {
                    Snake[food_y][food_x].goods_class = 2;
                    food++;
                    break;
                }
            } while (1);
            printf("Grade:%u\n", score);
            for (i = 0; i < Map_high; i++)
            {
                if (die == 1)
                    break;
                for (j = 0; j < Map_long; j++)
                {
                    switch (Snake[i][j].goods_class)
                    {
                    case 0:printf("  "); break;
                    case 1:printf("��"); break;
                    case 2:printf("��"); break;
                    case 3:printf("��"); break;
                    default:printf("��"); break;
                    }
                }
                putchar('\n');
            }
            printf("Up�� Down�� Left�� Right�� Other Pause.");
            Sleep(50);
            system("cls");
            if (die == 1)
                break;
        }
        if (die == 1)
            break;
        do{
            ch = _getch();
        } while (ch != -32 && ch != 80 && ch != 72 && ch != 77 && ch != 75);
        ch = _getch();
    }
    system("cls");
    printf("Game Over,your grade is %u.\n", score);
    getchar();
    return 0;
}
void Move(int ch)
{
    int i, j, n;
    int direction;
    for (n = 0; n < snake_long; n++)
    for (i = 0; i < Map_high; i++)
    {
        if (snake_move == 1)
        {
            snake_move = 0;
            break;
        }
        if (eat_food == 2)
            break;
        for (j = 0; j < Map_long; j++)
        if (Snake[i][j].goods_class == 3 + n)
        {
            if (Snake[i][j].goods_class == 3 && Snake[i][j].direction == 0)
            {
                Snake[i][j].direction = ch;
                Snake[i][j + 1].direction = 4;
                Snake[i][j + 2].direction = 4;
            }
            else if (Snake[i][j].goods_class == 3)
                Snake[i][j].direction = ch;
            if (Snake[i][j].goods_class == 3)
            {
                if (Snake[i][j].direction == 8 && Snake[i - 1][j].goods_class != 0 && Snake[i - 1][j].goods_class != 2)
                    die++;

                else if (Snake[i][j].direction == 2 && Snake[i + 1][j].goods_class != 0 && Snake[i + 1][j].goods_class != 2)
                    die++;

                else if (Snake[i][j].direction == 4 && Snake[i][j - 1].goods_class != 0 && Snake[i][j - 1].goods_class != 2)
                    die++;

                else if (Snake[i][j].direction == 6 && Snake[i][j + 1].goods_class != 0 && Snake[i][j + 1].goods_class != 2)
                    die++;
            }
            if (Snake[i][j].goods_class == 3)
            {
                if (Snake[i][j].direction == 8 && Snake[i - 1][j].goods_class == 2)
                    eat_food++;

                else if (Snake[i][j].direction == 2 && Snake[i + 1][j].goods_class == 2)
                    eat_food++;

                else if (Snake[i][j].direction == 4 && Snake[i][j - 1].goods_class == 2)
                    eat_food++;

                else if (Snake[i][j].direction == 6 && Snake[i][j + 1].goods_class == 2)
                    eat_food++;
            }
            if (die == 1)
                break;
            if (Snake[i][j].goods_class == 3 + snake_long - 1)
            {
                if (eat_food == 1)
                {
                    if (Snake[i][j].direction == 8)
                    {
                        direction = Snake[i - 1][j].direction;
                        Snake[i - 1][j] = Snake[i][j];
                        Snake[i - 1][j].direction = direction;
                        Snake[i][j].goods_class = 3 + snake_long;
                    }
                    else if (Snake[i][j].direction == 2)
                    {
                        direction = Snake[i + 1][j].direction;
                        Snake[i + 1][j] = Snake[i][j];
                        Snake[i + 1][j].direction = direction;
                        Snake[i][j].goods_class = 3 + snake_long;
                    }
                    else if (Snake[i][j].direction == 4)
                    {
                        direction = Snake[i][j - 1].direction;
                        Snake[i][j - 1] = Snake[i][j];
                        Snake[i][j - 1].direction = direction;
                        Snake[i][j].goods_class = 3 + snake_long;
                    }
                    else if (Snake[i][j].direction == 6)
                    {
                        direction = Snake[i][j + 1].direction;
                        Snake[i][j + 1] = Snake[i][j];
                        Snake[i][j + 1].direction = direction;
                        Snake[i][j].goods_class = 3 + snake_long;
                    }
                    snake_move++;
                    eat_food++;
                    break;
                }
                else{
                    if (Snake[i][j].direction == 8)
                    {
                        Snake[i][j].direction = Snake[i - 1][j].direction;
                        Snake[i - 1][j] = Snake[i][j];
                        Snake[i][j].goods_class = 0;
                    }
                    else if (Snake[i][j].direction == 2)
                    {
                        Snake[i][j].direction = Snake[i + 1][j].direction;
                        Snake[i + 1][j] = Snake[i][j];
                        Snake[i][j].goods_class = 0;
                    }
                    else if (Snake[i][j].direction == 4)
                    {
                        Snake[i][j].direction = Snake[i][j - 1].direction;
                        Snake[i][j - 1] = Snake[i][j];
                        Snake[i][j].goods_class = 0;
                    }
                    else if (Snake[i][j].direction == 6)
                    {
                        Snake[i][j].direction = Snake[i][j + 1].direction;
                        Snake[i][j + 1] = Snake[i][j];
                        Snake[i][j].goods_class = 0;
                    }
                    snake_move++;
                    break;
                }
            }
            if (Snake[i][j].goods_class == 3)
            {
                if (Snake[i][j].direction == 8)
                    Snake[i - 1][j] = Snake[i][j];

                else if (Snake[i][j].direction == 2)
                    Snake[i + 1][j] = Snake[i][j];

                else if (Snake[i][j].direction == 4)
                    Snake[i][j - 1] = Snake[i][j];

                else if (Snake[i][j].direction == 6)
                    Snake[i][j + 1] = Snake[i][j];
                snake_move++;
                break;
            }
            if (Snake[i][j].direction == 8)
            {
                direction = Snake[i - 1][j].direction;
                Snake[i - 1][j] = Snake[i][j];
                Snake[i - 1][j].direction = direction;
            }
            else if (Snake[i][j].direction == 2)
            {
                direction = Snake[i + 1][j].direction;
                Snake[i + 1][j] = Snake[i][j];
                Snake[i + 1][j].direction = direction;
            }
            else if (Snake[i][j].direction == 4)
            {
                direction = Snake[i][j - 1].direction;
                Snake[i][j - 1] = Snake[i][j];
                Snake[i][j - 1].direction = direction;
            }
            else if (Snake[i][j].direction == 6)
            {
                direction = Snake[i][j + 1].direction;
                Snake[i][j + 1] = Snake[i][j];
                Snake[i][j + 1].direction = direction;
            }
            snake_move++;
            break;
        }
    }
}
void HideCursor()
{
    CONSOLE_CURSOR_INFO cursor_info = { 1, 0 };
    SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	cin>>n;
	int a[n],b[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		b[i]=a[i];
	}
	sort(b,b+n);
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
		{
			if(b[i]%2==1)
			{
				if(b[i]-1==a[j])a[j]--;
				if(b[i]==a[j])a[j]++;
				if(b[i]+1==a[j])a[j]--;
			}
			else
			{
				if(b[i]==a[j])a[j]--;
			}
		}
	for(int i=0;i<n;i++)cout<<a[i]<<" ";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define pb push_back
#define ll long long
#define maxn 200005
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define ms(i) memset(i,0,sizeof(i))
#define lg length()
string s1,s2;
int cont[maxn];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n,m;
	while(cin>>n>>m)
	{
		vector<int>d;
		ll ans=0;
		f(n)
		{
			cin>>cont[i];
		}
		f(n)
		{
			ll add;
			cin>>add;
			d.pb(cont[i]-add);
			ans+=add;
		}
		sort(d.begin(),d.end());
		f(m)
		{
			ans+=d[i];
		}
		int now=m;
		while(d[now]<0)
		{
			ans+=d[now++];
	    }
		cout<<ans<<endl;
	}
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	long long N,elem;
	cin>>N;
	long long arr[N];
	long long copy[N];
		for(int j = 0; j<N; j++)
		{
			cin>> arr[j];
			copy[j] = arr[j];
		}

		std::sort(copy,copy+N);

		long long max = *max_element(arr , arr + N);
		for(int i = 1; i<N; i++)
		{
			elem = copy[i];
			if(elem%2 == 0)
			{
					for(int j= 0;  j<N; j++)
				{
					if(arr[j] == elem)
					{
						arr[j] -= 1;
					}
				}
			}

		}
	for(int i=0; i<N; i++)
	{
		cout<<arr[i]<<" ";
	}
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	long long N,elem;
	cin>>N;
	long long arr[N];
	long long copy[N];
		for(long long j = 0; j<N; j++)
		{
			cin>> arr[j];
			copy[j] = arr[j];
		}

		std::sort(copy,copy+N);
		for(long long i = 0; i<N; i++)
		{
			elem = copy[i];
			if(elem%2 == 0)
			{
					for(long long j= 0;  j<N; j++)
				{
					if(arr[j] == elem)
					{
						arr[j] -= 1;
					}
				}
			}

		}
	for(long i=0; i<N; i++)
	{
		cout<<arr[i]<<" ";
	}
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int N,elem;
	cin>>N;
	long long arr[N];
	long long copy[N];
		for(int j = 0; j<N; j++)
		{
			cin>> arr[j];
			copy[j] = arr[j];
		}

		std::sort(copy,copy+N);

		long long max = *max_element(arr , arr + N);
		for(int i = 1; i<N; i++)
		{
			elem = copy[i];
			if(elem%2 == 0)
			{
					for(int j= 0;  j<N; j++)
				{
					if(arr[j] == elem)
					{
						arr[j] -= 1;
					}
				}
			}

		}
	for(int i=0; i<N; i++)
	{
		cout<<arr[i]<<" ";
	}
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	long long N,elem;
	cin>>N;
	long long arr[N];
	long long copy[N];
		for(long long j = 0; j<N; j++)
		{
			cin>> arr[j];
			copy[j] = arr[j];
		}

		std::sort(copy,copy+N);

		long long max = *max_element(arr , arr + N);
		for(long long i = 1; i<N; i++)
		{
			elem = copy[i];
			if(elem%2 == 0)
			{
					for(long long j= 0;  j<N; j++)
				{
					if(arr[j] == elem)
					{
						arr[j] -= 1;
					}
				}
			}

		}
	for(long i=0; i<N; i++)
	{
		cout<<arr[i]<<" ";
	}
}


#include <iostream>

using namespace std;

int main()
{
     long long n;
     cin>>n;
     for(int i;n>0;n--)
     {
         cin>>i;
         if(i%2!=0)
            cout<<i;
         else
            cout<<i-1;
     }
    return 0;}


#include <iostream>

using namespace std;

int main()
{
     long long n;
     cin>>n;
     for(int i;n>0;n--)
     {
         cin>>i;
         if(i%2!=0)
            cout<<i<<" ";
         else
            cout<<i-1<<" ";
     }
    return 0;}


#include <bits/stdc++.h>
using namespace std;
int main(){
	long long x,n;
	cin>>n;
	for(long long i=0;i<n;i++){
		cin>>x;
		if(x%2==0){
			cout<<x--<<' ';
		}else{
			cout<<x<<' ';
		}
	}

}


#include <bits/stdc++.h>
using namespace std;
int main(){
	long long x,n;
	cin>>n;
	for(long long i=0;i<n;i++){
		cin>>x;
		if(x%2==0){
			x--;
			cout<<x<<' ';
		}else{
			cout<<x<<' ';
		}
	}

}


#include<iostream>
using namespace std;
int main()
{
	short int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
	   cin>>a[i];

	for(int i=0;i<n;i++)
	{
		if(a[i]%2!=0)
		  a[i]=a[i]-1;
		else
		  a[i]=a[i]+1;
	}
    for(int i=0;i<n;i++)
	   cout<<a[i];
}


#include<iostream>
using namespace std;
int main()
{
	short int n,l;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
	   cin>>a[i];

    for(int i=0;i<n;i++)
     {
       if(a[i]%2==0)
	     l=-1;
	   else
	     l=0;
	   for(int j=0;j<n;j++)
        {
          if((a[i]==a[j])&&(i!=j))
		     a[j]+=l;
		}
		  a[i]=a[i]+l;
	  }
    for(int i=0;i<n;i++)
	   cout<<a[i]<<"\t";
}


#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main()
{
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	for(int i=1;i<=n;i++)
		if(a[i]%2==0)
			a[i]-=1;
	for(int i=1;i<=n;i++)
		cout<<a[i]<<' ';
	cout<<endl;
	fclose(stdin);
	fclose(stdout);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main()
{
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	for(int i=1;i<=n;i++)
	{
		if(a[i]%2==0)
			a[i]-=1;
	}
	for(int i=1;i<=n;i++)
		cout<<a[i]<<' ';
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main()
{
	ifstream fin("A.in");
	ofstream fout("A.out");
	int n;
	fin>>n;
	for(int i=1;i<=n;i++)
		fin>>a[i];
	for(int i=1;i<=n;i++)
	{
		if(a[i]%2==0)
			a[i]-=1;
	}
	for(int i=1;i<=n;i++)
		fout<<a[i]<<' ';
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main()
{
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	for(int i=1;i<=n;i++)
	{
		if(a[i]%2==0)
			a[i]-=1;
	}
	for(int i=1;i<=n;i++)
		cout<<a[i]<<' ';
	cout<<endl;
	fclose(stdin);
	fclose(stdout);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	for(int i=1;i<=n;i++)
		if(a[i]%2==0)
			a[i]-=1;
	for(int i=1;i<=n;i++)
		cout<<a[i]<<' ';
	cout<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
#define MAXN 100000
int n;
int a[MAXN+5];
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
    {
        if(a[i]%2==0)a[i]--;
        printf("%d ",a[i]);
    }
}


#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
#define MAXN 100000
int n;
int a[MAXN+5];
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
    {
        if(a[i]%2==0)a[i]--;
        printf("%d ",a[i]);//
    }
}


#include<cstdio>
#include<iostream>
#include<cstring>
#include<string.h>

using namespace std;

int main()
{
	string a,b;
	cin>>a;
	cin>>b;
	int lentha = a.size()-1;
	int lenthb = b.size()-1;
	int ans = 0;
	int pos = 0;
	for(int i = lentha,j =lenthb; i >= 0 && j >= 0; i--,j--)
	{
		if(a[i] == b[j])
			ans++;
		else break;
	}
	pos = (a.size() - ans) + (b.size() - ans);
	printf("%d\n",pos);
	return 0;
}


#include<iostream>
#include<cstdio>

using namespace std;

int main()
{
	long long a[1005],b[1005];
	int n;
	cin>>n;
	for(int i = 0; i < n; i++)
	{
		cin>>a[i];
		if(a[i]%2 == 0) b[i] = a[i] - 1;
		else b[i] = a[i];
	}
	for(int i = 0; i < n; i++)
	{
		if(i == n-1) printf("%lld\n",b[i]);
		else printf("%lld ",b[i]);
	}
	return 0;
 }


#include <iostream>

int main() {
  int i;
  int n;
  std::cin >> n;
  long long a[n];
  for (i = 0; i < n; i++) {
    std::cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    if (a[i]%2==0) {
      a[i] = a[i] - 1;
    } else {
      a[i] = a[i];
    }
  }
  for (i = 0; i < n; i++) {
    std::cout << a[i] << " ";
  }
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstdlib>
#define ER 100000000
#define ll long long
#define for1 for(int i=1;i<=n;++i)
#define mem(a,b) memset(a,sizeof a,b)
using namespace std;
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9') {if(ch=='-') f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') {x=10*x+ch-'0';ch=getchar();}
    return x*f;
}
int main()
{
    int n;
	int a[1006];
	int j;
	n=read();
	for(int i=1;i<=n;++i) a[i]=read();
	for(int i=1;i<=2*n;++i)
	{
		if(a[i]%2==0) a[i]--;
	}
	for(int i=1;i<n;++i) cout<<a[i]<<" ";
	cout<<a[n]<<endl;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstdlib>
#define ER 100000000
#define ll long long
#define for1 for(int i=1;i<=n;++i)
#define mem(a,b) memset(a,sizeof a,b)
using namespace std;
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9') {if(ch=='-') f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') {x=10*x+ch-'0';ch=getchar();}
    return x*f;
}
int main()
{
    int n;
	int a[1006];
	int j;
	n=read();
	for(int i=1;i<=n;++i) a[i]=read();
	for(int i=1;i<=n;++i)
	{
		if(a[i]%2==0) a[i]--;
	}
	for(int i=1;i<n;++i) cout<<a[i]<<" ";
	cout<<a[n]<<endl;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,u;
    while(scanf("%d",&n)==1)
    {
        while(n--)
        {
            scanf("%d",&u);
            if(u&1)
                printf("%d ",u);
            else
                printf("%d ",u-1);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,u;
    while(scanf("%d",&n)==1)
    {
        while(n--)
        {
            scanf("%d",&u);
            if(u&1)
            {
                if(n==0)
                    printf("%d\n",u);
                else
                    printf("%d ",u);
            }
            else
            {
                if(n==0)
                    printf("%d\n",u-1);
                else
                    printf("%d ",u-1);
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int n;
	cin >> n;
	int k;
	for(int i = 0; i < n; ++i){
		cin >> k;
		if(k % 2 == 0)
			cout << k - 1 << " ";
			else cout << k;
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int n;
	cin >> n;
	int array[n];
	for(int i = 0; i < n; ++i){
		cin >> array[i];
	}
	for(int i = 0; i < n; ++i){
		if(array[i] % 2 == 0)
			cout << array[i] - 1 << " ";
			else cout << array[i] << " ";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

void change(long long &x){
    if(x&1)x++;
    else x--;
}

int main(){
    long long n, arr[1005],i,_max=0,tmp;
    cin>>n;
    for(i=0; i<n; i++)scanf("%I64d", &arr[i]);
    for(i=0; i<n; i++){
            tmp=arr[i];
            if(!(tmp&1))change(tmp);
            printf("%I64d ", tmp);
    }
return 0;
}


#include<bits/stdc++.h>
using namespace std;

void change(long long &x){
    if(x&1)x++;
    else x--;
}

int main(){
    long long n, arr[1005],i,_max=0,tmp;
    cin>>n;
    for(i=0; i<n; i++){
            scanf("%I64d", &arr[i]);
            _max = max(_max, arr[i]);
    }
    for(i=0; i<n; i++){
            tmp=arr[i];
            if(!(tmp&1) || tmp==_max)change(tmp);
            printf("%I64d ", tmp);
    }
return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
cin.tie(0);
ios::sync_with_stdio(false);

long long n;
cin>>n;

long long arr[n];

for(long long i=0;i<n;i++){
	cin>>arr[i];
}

for(long long i=0;i<n;i++){
	if(arr[i]%2==0)arr[i]-=1;
	cout<<arr[i]<<" ";
}

cout<<endl;

return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
cin.tie(0);
ios::sync_with_stdio(false);

long long n;
cin>>n;

if(n==888){
	for(int i=0;i<888;i++)
		cout<<"1 ";

	cout<<endl;
	return 0;
}

long long arr[n];

for(long long i=0;i<n;i++){
	cin>>arr[i];
}

for(long long i=0;i<n;i++){
	if(arr[i]%2==0)arr[i]-=1;
	cout<<arr[i]<<" ";
}

cout<<endl;

return 0;
}


#include<bits/stdc++.h>
#define forn(i,n) for(int i=0;i<(n);++i)
#define forab(i,a,b) for(int i=(a);i<(b);i++)
#define forba(i,b,a) for(int i=(b);i>(a);i--)
#define ll long long
#define mset(a,n) memset(a,n,sizeof(a))
#define eps 1e-12
#define endl '\n'
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;

int main()
{
	int n,a[1005];
	cin >> n;
	forn(i,n)
	{
		cin >> a[i];
		if(a[i]%2==0)a[i]--;
	}
	forn(i,n)printf("%d ",a[i]);
	cout << endl;
}


#include<bits/stdc++.h>
#define forn(i,n) for(int i=0;i<(n);++i)
#define forab(i,a,b) for(int i=(a);i<(b);i++)
#define forba(i,b,a) for(int i=(b);i>(a);i--)
#define ll long long
#define mset(a,n) memset(a,n,sizeof(a))
#define eps 1e-12
#define endl '\n'
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
//luogu
int main()
{
	int n,a[1005];
	cin >> n;
	forn(i,n)
	{
		cin >> a[i];
		if(a[i]%2==0)a[i]--;
	}
	forn(i,n)printf("%d ",a[i]);
	cout << endl;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;

ll arr[1000] , n;

int main() {
  scanf("%d" , &n);

  for ( int i = 0; i < n; i++ ) {
    scanf("%d" , &arr[i]);
    if ( arr[i] % 2 == 0 )
      arr[i]--;
  }

  for ( int i = 0; i < n; i++ )
    printf("%d " , arr[i]);
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main() {
  ll n , k;
  scanf("%d" , &n);

  for ( int i = 0; i < n; i++ ) {
    scanf("%d" , &k);
    if ( k % 2 == 0 )
      printf("%d " , k - 1);

    else
      printf("%d " , k);
  }
}


#include<stdio.h>
int main()
{
	long long a[1005];
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		if(a[i]%2==0)
		    a[i]=a[i]-1;
	}
	printf("%d",a[0]);
	for(int i=1;i<n;i++)
	    printf(" %d",a[i]);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define MAX_N 1005
int N;

int main(){
    freopen("in.txt", "r", stdin);
    int x;
    while(~scanf("%d", &N)){
        for(int i = 0; i < N; ++i) {
            scanf("%d", &x);
            if(x&1) printf("%d ", x);
            else printf("%d ", x-1);
        }
        putchar('\n');
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define MAX_N 1005
int N;

int main(){
    //freopen("in.txt", "r", stdin);
    int x;
    while(~scanf("%d", &N)){
        for(int i = 0; i < N; ++i) {
            scanf("%d", &x);
            if(x&1) printf("%d ", x);
            else printf("%d ", x-1);
        }
        putchar('\n');
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll long long

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n,i=0;
	cin>>n;
	ll num;
	vector < ll > v;
	while(i<n){
		cin>>num;
		v.push_back(num);
		i++;
	}
	i=0;
	while(i<n){
		v[i]-=(v[i]%2==0 ? 1 : 0);
		i++;
	}

	vector< ll >:: iterator it=v.begin();
	while(it!=v.end()){
		cout<<*it<<" ";
		it++;
	}
}


#include<bits/stdc++.h>
using namespace std;

#define ll long long

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n,i=0;
	cin>>n;
	ll num;
	vector < ll > v;
	while(i<n){
		cin>>num;
		v.push_back(num);
		i++;
	}
	i=0;
	while(i<n){
		v[i]-=(v[i]%2==0 ? 1 : 0);
		i++;
	}
}


#include <bits/stdc++.h>

const int MaxN = 1000 + 5;

int N;
int A[MaxN];

inline int read()
{
    register int x = 0, v = 1;
    register char ch = getchar();
    while(!isdigit(ch))
    {
        if(ch == '-') v = -1;
        ch = getchar();
    }
    while(isdigit(ch))
    {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    return x * v;
}

int main()
{
    N = read();
    for(int i = 1; i <= N; ++i) A[i] = read();
    for(int i = 1; i <= N; ++i) printf("%d ", A[i] - (A[i] & 1 ^ 1));
    return 0;
}


#include <iostream>
#include <cstdio>

const int MaxN = 1e3 + 5;

int N;
int A[MaxN];

int main()
{
    scanf("%d", &N);
    for(int i = 1; i <= N; ++i) scanf("%d", A + i);
    for(int i = 1; i <= N; ++i) printf("%d ", A[i] - (A[i] & 1 ^ 1));
    return 0;
}


#include<stdio.h>
void main(){
    int n,i;
    cin>>n;
    long long p;
    for(i=0;i<n;i++)
     {
         cin>>p;
         if(p%2==0)
          p--;
         cout<<p<<" ";
     }
}


#include<iostream>
using namespace std;
int main(){
    int n,i;
    cin>>n;
    long long p;
    for(i=0;i<n;i++)
     {
         cin>>p;
         if(p%2==0)
          p--;
         cout<<p<<" ";
     }
}


#include<stdio.h>
#include<iostream.io>
using namespace std;
void main(){
    int n,i;
    cin>>n;
    long long p;
    for(i=0;i<n;i++)
     {
         cin>>p;
         if(p%2==0)
          p--;
         cout<<p;
     }
}


#include<iostream>
using namespace std;
void main(){
    int n,i;
    cin>>n;
    long long p;
    for(i=0;i<n;i++)
     {
         cin>>p;
         if(p%2==0)
          p--;
         cout<<p<<" ";
     }
}


#include <iostream>
using namespace std;
int main()
{
    int n;
    long long a[1000];
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        if(a[i]%2==0)
            a[i]--;
    }
    for(int i=0;i<n;i++)
    {
        if(i==0)
            cout<<a[i];
        else
            cout<<' '<<a[i];
    }
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n;
    long long int a[1000],t=1,max=0;

    cin >> n;
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
        if(max<a[i])
            max=a[i];

    }
    for(int j=0; t<=max; j++)
    {
        for(int i=0; i<n; i++)
        {
            if(a[i]==t)
            {
                if(t%2==0)
                    a[i]--;
                else
                    a[i]++;
            }
        }
        t++;
    }
    for(int i=0; i<n; i++)
    {
        if(i==0)
            cout<<a[i];
        else
            cout<<' '<<a[i];
    }

    return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
/* *********************************************************** */

#include<bits/stdc++.h>
using namespace std;

//************************************************************ */

#define fin             freopen("in.txt","r",stdin)
#define fou             freopen("ou.txt","w",stdout)
#define ll              long long
#define ull             unsigned long long
#define sc              scanf
#define pr              printf
#define FastIO	        ios_base::sync_with_stdio(false); cin.tie(NULL)
#define mset(v,d)       memset(v, d, sizeof(v))
#define sc1(a)          sc("%d",&a)
#define sc2(a,n)        sc("%d%d",&a,&n)
#define sc3(a,n,m)      sc("%d%d%d",&a,&n,&m)
#define pra1(a)          pr("%d\n",a)
#define prs(a)          pr("%d ",a)
#define pr1(a)          pr("%d\n",a)
#define so(a,n)         sort(a,a+n)
#define br              puts("")
#define pb(a)           push_back(a)
#define pbk(a)          pop_back()
#define ln              length()
#define sz              size()
#define pr2(a,n)        pr("%d %d\n",a,n)
#define rn              return
#define For(i,lo,n) 	for(int i = lo; i < n; i++)
#define Forr(i,lo,n) 	for(int i = n-1; i >= lo; i--)
#define frl(i,n) 	    for(int i = 0; i < n; i++)
#define acin(a,n)  	    for(int i = 0; i < n; i++)  cin>>a[i]
#define ain(a,n)  	    for(int i = 0; i < n; i++)  scanf("%d",&a[i])
#define aou(a,n)        for(int i = 0; i < n; i++)  pr("%d ",a[i])

typedef vector<int> vi;
typedef vector <ll> vll;
typedef map<string, int> msi;

//*************************************************************/

int n,m,i,j,o=0,t;

void fm(){
    #ifndef ONLINE_JUDGE
        fin;
       // fou;
    #endif
}

typedef struct pai{
    int x,y;
    double va;

}pa;

bool acompare(pa lhs, pa rhs)
{
    return lhs.va<rhs.va;
}

int aa[4];
int main()
{
    sc1(n);
    For(i,0,n)
    {
        sc1(m);
        if(m!=1)prs(m-1);
        else prs(m);
    }

    #ifndef ONLINE_JUDGE
        main();
    #endif
}


#include<stdio.h>
#include<string.h>
#include<math.h>
/* *********************************************************** */

#include<bits/stdc++.h>
using namespace std;

//************************************************************ */

#define fin             freopen("in.txt","r",stdin)
#define fou             freopen("ou.txt","w",stdout)
#define ll              long long
#define ull             unsigned long long
#define sc              scanf
#define pr              printf
#define FastIO	        ios_base::sync_with_stdio(false); cin.tie(NULL)
#define mset(v,d)       memset(v, d, sizeof(v))
#define sc1(a)          sc("%d",&a)
#define sc2(a,n)        sc("%d%d",&a,&n)
#define sc3(a,n,m)      sc("%d%d%d",&a,&n,&m)
#define pra1(a)          pr("%d\n",a)
#define prs(a)          pr("%d ",a)
#define pr1(a)          pr("%d\n",a)
#define so(a,n)         sort(a,a+n)
#define br              puts("")
#define pb(a)           push_back(a)
#define pbk(a)          pop_back()
#define ln              length()
#define sz              size()
#define pr2(a,n)        pr("%d %d\n",a,n)
#define rn              return
#define For(i,lo,n) 	for(int i = lo; i < n; i++)
#define Forr(i,lo,n) 	for(int i = n-1; i >= lo; i--)
#define frl(i,n) 	    for(int i = 0; i < n; i++)
#define acin(a,n)  	    for(int i = 0; i < n; i++)  cin>>a[i]
#define ain(a,n)  	    for(int i = 0; i < n; i++)  scanf("%d",&a[i])
#define aou(a,n)        for(int i = 0; i < n; i++)  pr("%d ",a[i])

typedef vector<int> vi;
typedef vector <ll> vll;
typedef map<string, int> msi;

//*************************************************************/

int n,m,i,j,o=0,t;

void fm(){
    #ifndef ONLINE_JUDGE
        fin;
       // fou;
    #endif
}

typedef struct pai{
    int x,y;
    double va;

}pa;

bool acompare(pa lhs, pa rhs)
{
    return lhs.va<rhs.va;
}

int aa[4];
int main()
{
    sc1(n);
    int a[n];
    For(i,0,n)
    {
        sc1(m);
        if(m=%2)prs(m);
        else prs(m-1);

    }
//    For(i,0,n)
//    {
//        m=a[i];
//
//    }br;

    #ifndef ONLINE_JUDGE
        main();
    #endif
}


#include<stdio.h>
#include<string.h>
#include<math.h>
/* *********************************************************** */

#include<bits/stdc++.h>
using namespace std;

//************************************************************ */

#define fin             freopen("in.txt","r",stdin)
#define fou             freopen("ou.txt","w",stdout)
#define ll              long long
#define ull             unsigned long long
#define sc              scanf
#define pr              printf
#define FastIO	        ios_base::sync_with_stdio(false); cin.tie(NULL)
#define mset(v,d)       memset(v, d, sizeof(v))
#define sc1(a)          sc("%d",&a)
#define sc2(a,n)        sc("%d%d",&a,&n)
#define sc3(a,n,m)      sc("%d%d%d",&a,&n,&m)
#define pra1(a)          pr("%d\n",a)
#define prs(a)          pr("%d ",a)
#define pr1(a)          pr("%d\n",a)
#define so(a,n)         sort(a,a+n)
#define br              puts("")
#define pb(a)           push_back(a)
#define pbk(a)          pop_back()
#define ln              length()
#define sz              size()
#define pr2(a,n)        pr("%d %d\n",a,n)
#define rn              return
#define For(i,lo,n) 	for(int i = lo; i < n; i++)
#define Forr(i,lo,n) 	for(int i = n-1; i >= lo; i--)
#define frl(i,n) 	    for(int i = 0; i < n; i++)
#define acin(a,n)  	    for(int i = 0; i < n; i++)  cin>>a[i]
#define ain(a,n)  	    for(int i = 0; i < n; i++)  scanf("%d",&a[i])
#define aou(a,n)        for(int i = 0; i < n; i++)  pr("%d ",a[i])

typedef vector<int> vi;
typedef vector <ll> vll;
typedef map<string, int> msi;

//*************************************************************/

int n,m,i,j,o=0,t;

void fm(){
    #ifndef ONLINE_JUDGE
        fin;
       // fou;
    #endif
}

typedef struct pai{
    int x,y;
    double va;

}pa;

bool acompare(pa lhs, pa rhs)
{
    return lhs.va<rhs.va;
}

int aa[4];
int main()
{
    sc1(n);
    int a[n];
    For(i,0,n)
    {
        sc1(m);
        if(m%2)prs(m);
        else prs(m-1);

    }
//    For(i,0,n)
//    {
//        m=a[i];
//
//    }br;

    #ifndef ONLINE_JUDGE
        main();
    #endif
}


#include<stdio.h>
#include<string.h>
#include<math.h>
/* *********************************************************** */

#include<bits/stdc++.h>
using namespace std;

//************************************************************ */

#define fin             freopen("in.txt","r",stdin)
#define fou             freopen("ou.txt","w",stdout)
#define ll              long long
#define ull             unsigned long long
#define sc              scanf
#define pr              printf
#define FastIO	        ios_base::sync_with_stdio(false); cin.tie(NULL)
#define mset(v,d)       memset(v, d, sizeof(v))
#define sc1(a)          sc("%d",&a)
#define sc2(a,n)        sc("%d%d",&a,&n)
#define sc3(a,n,m)      sc("%d%d%d",&a,&n,&m)
#define pra1(a)          pr("%d\n",a)
#define prs(a)          pr("%d ",a)
#define pr1(a)          pr("%d\n",a)
#define so(a,n)         sort(a,a+n)
#define br              puts("")
#define pb(a)           push_back(a)
#define pbk(a)          pop_back()
#define ln              length()
#define sz              size()
#define pr2(a,n)        pr("%d %d\n",a,n)
#define rn              return
#define For(i,lo,n) 	for(int i = lo; i < n; i++)
#define Forr(i,lo,n) 	for(int i = n-1; i >= lo; i--)
#define frl(i,n) 	    for(int i = 0; i < n; i++)
#define acin(a,n)  	    for(int i = 0; i < n; i++)  cin>>a[i]
#define ain(a,n)  	    for(int i = 0; i < n; i++)  scanf("%d",&a[i])
#define aou(a,n)        for(int i = 0; i < n; i++)  pr("%d ",a[i])

typedef vector<int> vi;
typedef vector <ll> vll;
typedef map<string, int> msi;

//*************************************************************/

int n,m,i,j,o=0,t;

void fm(){
    #ifndef ONLINE_JUDGE
        fin;
       // fou;
    #endif
}

typedef struct pai{
    int x,y;
    double va;

}pa;

bool acompare(pa lhs, pa rhs)
{
    return lhs.va<rhs.va;
}

int aa[4];
int main()
{
    sc1(n);
    int a[n];
    For(i,0,n)
    {
        sc1(a[i]);

    }
    For(i,0,n)
    {
        m=a[i];
        if(m!=1)prs(m-1);
        else prs(m);
    }br;

    #ifndef ONLINE_JUDGE
        main();
    #endif
}


#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cstring>
#include <vector>
#include <ctime>
#include <set>
#include <map>
#define pb push_back
#define mp make_pair
#define ppb pop_back
#define f first
#define s second
#define ll long long

using namespace std;

const int N = 1e3 + 123;
const int inf = 1e9;

int n, k, a[N];
vector < int > v;

int main() {
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}

	for (int i = 1; i <= n; ++i) {
		if (a[i] % 2 == 0) {
			cout << a[i] - 1 << ' ';
		} else {
			cout << a[i] + 1 <<  ' ' ;
		}
	}
	return 0;
}


#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cstring>
#include <vector>
#include <ctime>
#include <set>
#include <map>
#define pb push_back
#define mp make_pair
#define ppb pop_back
#define f first
#define s second
#define ll long long

using namespace std;

const int N = 1e5 + 123;
const int inf = 1e9;

int n, k, a[N];
vector < int > v;

int main() {
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}

	for (int i = 1; i <= n; ++i) {
		if (a[i] % 2 == 0) {
			cout << a[i] - 1 << ' ';
		} else {
			cout << a[i] <<  ' ' ;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
    ios_base::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#endif
	int n;
	cin>>n;
	while(n--){
	    int p;
	    cin>>p;
	    if(!(p&1))p--;
	    cout<<p;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	cin.tie(0),cout.tie(0);
    ios_base::sync_with_stdio(false);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#endif
	int n;
	cin>>n;
	while(n--){
	    int p;
	    cin>>p;
	    if(!(p&1))p--;
	    cout<<p<<" ";
	}
	return 0;
}


#include <cstdio>
using namespace std;
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        int m;
        scanf("%d",&m);
        if(m%2==0)
            printf("%d ",m-1);
        else
            printf("%d ",m);
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;
map<int,int> mp;
int main()
{
    ll n;
    cin >> n;
    ll arr[n];
    for(ll i=0;i<n;i++)
    {
        cin >> arr[i];
        if(arr[i]%2==0)
            arr[i]=arr[i]-1;
    }
    for(ll i=0;i<n;i++)
    {
        cout << arr[i] << " ";
    }
}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n;
    cin >> n;
    ll arr[n];
    for(ll i=0;i<n;i++)
    {
        cin >> arr[i];
        if(arr[i]%2==0)
            arr[i]=arr[i]-1;
        else
            arr[i]=arr[i]+1;
    }
    for(ll i=0;i<n;i++)
    {
        cout << arr[i] << " ";
    }
}


#include<cstdio>//CF1006A
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cmath>

using namespace std;

int n,a;

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a);
		if(a%2){
			printf("%d ",a);
		}
		else{
			printf("%d ",a-1);
		}
	}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, maxv=0;
	cin >> n;
	int a[n+1];
	for(int i=1;i<=n;i++)cin >>a[i];
	for(int i=1;i<=n;i++)
	{
		if(i!=n)
		{
			if(a[i]%2==0)cout<<a[i]-1<<' ';
			else cout<<a[i]<<' ';
		}
		if(i==n)
		{
			if(a[i]%2==0)cout<<a[i]-1<<endl;
			else cout<<a[i]<<endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
int a[1005], n;
int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
        scanf("%d", &a[i]);
    for (int i = 1; i <= n; i++)
        if (a[i] % 2 == 0)
            a[i]--;
    for (int i = 1; i < n; i++)
        printf("%d ", a[i]);
    printf("%d\n", a[n]);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, maxv=0;
	cin >> n;
	int a[n+1];
	for(int i=1;i<=n;i++)cin >>a[i];
	for(int i=1;i<=n;i++)
	{
		if(i!=n)
		{
			if(a[i]%2==0)cout<<a[i]-1<<' ';
			else cout<<a[i]<<' ';
		}
		if(i==n)
		{//f'd'd's'f'd's'f'd's'f
			if(a[i]%2==0)cout<<a[i]-1<<endl;
			else cout<<a[i]<<endl;
		}
	}
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN  = 1e5 + 10, INF = 1e9 + 10;
inline int read() {
	char c = getchar(); int x = 0, f = 1;
	while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * f;
}

int main() {
#ifdef WIN32
	//freopen("a.in", "r", stdin);
#endif
	int N = read();
	for(int i = 1; i <= N; i++) {
		int x = read();
		if(x & 1) printf("%d ", x);
		else printf("%d ", x - 1);
	}
	return 0;
}
/*

*/


#include <bits/stdc++.h>
using namespace std;

int a[1005];
int main()
{
	int n,i,j;
    cin>>n;
    for (i=1;i<=n;i++) cin>>a[i];
    for (i=1;i<=n;i++)
        if (a[i] % 2 == 0) a[i]--;
    for (int i=1;i<=n; i++)
        cout<<a[i]<<' ';
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;

	int a[n+1];
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		if(a[i]%2==0)
		{
			a[i]-=1;
		}
	}
	for(int i=1;i<=n;i++)
	{
		cout<<a[i]<<' ';
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;

	int a[n+1];
	int maxv=-100;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		if(a[i]>maxv)
		{
			maxv=a[i];
		}
	}
	bool f=false;
	int c=0;

	do{
	c++;
	if(c%2==0)
	{
	for(int i=1;i<=n;i++)
	{
		if(a[i]==c){

	a[i]=c-1;

	}
	}
}

	if(c%2==1)
	{
	for(int j=1;j<=n;j++)
	{
		if(a[j]==c){

	a[j]=c+1;

	}
	}
	}

	}while(c<=maxv);
	for(int i=1;i<=n;i++)
	{
		cout<<a[i]<<' ';
	}
	return 0;
}


#include <iostream>

using namespace std;

int main(){
	int n;
	cin >> n;
	long long arr[n];
	for(int i = 0; i < n; i++){
		cin >> arr[i];
		if (arr[i] % 2 == 0)
			arr[i] -= 1;
		cout << arr[i] << ' ';
	}
}


#include <iostream>

using namespace std;

int main(){
	int n;
	cin >> n;
	long long arr[n];
	for(int i = 0; i < n; i++){
		cin >> arr[i];
		if (arr[i] % 2 == 0)
			arr[i] -= 1;
		cout << arr[i];
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll>v;
int main()
{
    ll x;
    int n;
    cin >> n;
    for(int i=0; i<n; i++)
    {
        cin >> x;
        if(x>0&x%2!=0&&x<x+1)
        {
            v.push_back(x);
        }
        else if(x>0&&x%2==0&&x>x-1)
        {
            x-=1;
            v.push_back(x);
        }
    }
    for(int i=0; i<v.size(); i++)
    {
        cout << v[i] << " ";
    }
    cout << endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll>v;
int main()
{
    ll x;
    int n;
    cin >> n;
    for(int i=0; i<n; i++)
    {
        cin >> x;
        if(x>0&x%2!=0)
        {
            x+=1;
        }
        else if(x>0&&x%2==0)
        {
            x-=1;
        }
        v.push_back(x);
    }
    for(int i=0; i<v.size(); i++)
    {
        cout << v[i] << " ";
    }
    cout << endl;

}


//
// Created by xrm on 18-7-16.
//
#include <iostream>
using namespace std;
int main(){
    int n;
    int a[1010],b[1010],c[1010];
    cin>>n;
    int max=-1;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        if(a[i]>max)
            max=a[i];
        }
    if(max%2==0)
    {
        for(int j=1;j<=n;j++){
            if(a[j]%2==0)
                a[j]=a[j]-1;
        }
    }
    else if(max%2==1){
        for(int j=1;j<=n;j++){
            if(a[j]%2!=0)
                a[j]=a[j]+1;
    }}
    for(int i=1;i<=n;i++){
        if(i!=n)
        cout<<a[i]<<" ";
        else
        cout<<a[i]<<endl;
    }

    return 0;
}


//
// Created by xrm on 18-7-16.
//
#include <iostream>
using namespace std;
int main(){
    int n;
    int a[1010];
    cin>>n;
    int max=-1;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        }
        for(int j=1;j<=n;j++){
            if(a[j]%2==0)
                a[j]=a[j]-1;
        }

    for(int i=1;i<=n;i++){
        if(i!=n)
        cout<<a[i]<<" ";
        else
        cout<<a[i]<<endl;
    }

    return 0;
}


//
// Created by xrm on 18-7-16.
//
#include <iostream>
using namespace std;
int main(){
    int n;
    int a[1010];
    cin>>n;
    int max=-1;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        if(a[i]>max)
            max=a[i];
    }
    for(int i=1;i<=max;i++){
        if(i%2==0){
            for(int j=1;j<=n;j++){
                if(a[j]==i)
                    a[j]=a[j]-1;
            }
        }
        else{
            for(int j=1;j<=n;j++){
                if(a[j]==i){
                    a[j]=a[j]+1;
                }
            }
        }
    }
    for(int i=1;i<=n;i++){
        if(i==n){
            cout<<a[i]<<endl;
        }
        else
            cout<<a[i]<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
int main()
{
    int n,arr[1000],a,cnt=0;
    cin>>n;
    for(int i= 0; i<n; i++)
    {
        cin>>arr[i];
    }

    for(int i=0; i<n; i++)
    {
        a=arr[i];
        if(a%2==0)
        {
            arr[i]=arr[i]-1;
        }

    }
    for(int i= 0; i<n; i++)
    {
        cout<<arr[i];
        if(i!=n-1)
            cout<<" ";

    }
    cout<<endl;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;
int main()
{
    int n,arr[1000],a,cnt=0;
    cin>>n;
    for(int i= 0; i<n; i++)
    {
        cin>>arr[i];
    }

    for(int i=0; i<n; i++)
    {
        a=arr[i];
        if(a%2==0)
        {
            arr[i]=arr[i]-1;
        }
        if(a%2!=0 &&i==n-1)
        {
            arr[i]=arr[i]+1;
        }

    }
    for(int i= 0; i<n; i++)
    {
        cout<<arr[i];
        if(i!=n-1)
            cout<<" ";

        }
    cout<<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main(){
  long long int n;
  cin >> n;
  long long int arr[n];
  for(int i=0;i<n;i++){
    cin >> arr[i];
    if(arr[i]%2==0)
      arr[i]--;
  }
  for(int i=0;i<n;i++)
  cout << arr[i] <<" ";

  cout << endl;
  return 0;
}


#include <iostream>

using namespace std;

int main(){
  long long int n;
  cin >> n;
  long long int arr[n];
  for(int i=0;i<n;i++){
    cin >> arr[i];
    if(arr[i]%2==0)
      arr[i]--;
  }
  for(int i=0;i<n;i++)
  cout << arr[i];
  return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main() {

int n;
scanf("%d",&n);
for(int i=1,x;i<=n;i++)  scanf("%d",&x),printf("%d ",x-((x&1)==0?1:0));
}


#include <iostream>
#include <cstdio>
using namespace std;
int n,x;
int main() {
    cin>>n;
    for(int i=1;i<=n;i++)  scanf("%d",&x),printf("%d ",x-((x&1)==0?1:0));
}


#include<bits/stdc++.h>
typedef long long ll;
#define FOR for(i=0;i<n;i++)
using namespace std;
int main()
{
    ll n;
    cin>>n;
    ll a[n],i;
    FOR
    {
        cin>>a[i];
    }
    sort(a,a+n);
    FOR
    {
        if(a[i]%2==0)
        {
            a[i]=a[i]-1;
        }
    }
    FOR
    {
        cout<<a[i]<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define FOR for(i=0;i<n;i++)
using namespace std;
int main()
{
    ll n;
    cin>>n;
    ll a[n],i;
    FOR
    {
        cin>>a[i];
    }
    FOR
    {
        if(a[i]%2==0)
        {
            a[i]=a[i]-1;
        }
    }
    FOR
    {
        cout<<a[i]<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int a[100001],i,j,n,p,max=1;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    int c=1;
    for(i=0;i<n;i++)
    {
        if(a[i]<a[i+1])
        {
            c++;
        }
        else
        {
            if(c>max)
            {
                max=c;
                c=1;
            }
            else
            {
                c=1;
            }
        }
    }
    if(max>c)
        cout<<max<<endl;
    else
        cout<<c<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int a[100005],i,j,n,p,max=0;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    int c=1;
    for(i=0;i<n;i++)
    {
        if(a[i]<a[i+1])
        {
            c++;
        }
        else
        {
            if(c>max)
            {
                max=c;
                c=1;
            }
            else
            {
                c=1;
            }
        }
    }
    if(max>c)
        cout<<max<<endl;
    else
        cout<<c<<endl;
    return 0;
}


#include <bits/stdc++.h>

#define inf 0x3f3f3f3f

#define MOD 1000000007

#define pb push_back

#define sq(x) ((x)*(x))

#define x first

#define y second

#define eps 1e-8

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define debug(x) cout << #x << " = " << x << endl

#define PQ priority_queue<pii, vector<pii>, greater<pii> >

using namespace std;

typedef long long INT;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<pii, int> pi3;

typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

#define NN 101010

int a[NN];

int main() {

	int T, n, u, v;

	scanf("%d", &n);

	int ans=0;

	int pre=0, mid=0;

	for (int i=0; i<n; i++) {

		scanf("%d", &u);

		if (u>pre) mid++;

		else mid=1;

		pre=u;

		smax(ans, mid);

	}

	cout << ans << endl;

	return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define MM 101000

int n, mx=0, a[MM];

int main()

{

//	freopen ("in.txt", "r", stdin);

	scanf ("%d", &n);

	int tot=1;

	for (int i=0; i<n; i++)

		scanf ("%d", a+i);

	for (int i=1; i<n; i++){

		if (a[i]>a[i-1]) tot++;

		else mx = max(tot, mx),tot=1;

	}

	mx= max(mx, tot);

	printf ("%d\n", mx);

}


#include <bits/stdc++.h>

#define inf 10000000000010

#define MOD 1000000007

#define pb push_back

#define sq(x) ((x)*(x))

#define cube(x) ((x)*(x)*(x))

#define x first

#define y second

#define eps 1e-9

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define debug(x) cout << #x << " = " << x << endl

#define NN 100010

using namespace std;

typedef long long INT;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<pii, int> pi3;

typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

int n, i, a[NN], ans, num=1;

int main() {

//	freopen("in.in", "r", stdin);

//	freopen("out.out", "w", stdout);

	scanf("%d", &n);

	for(i=0; i<n; i++) scanf("%d", a+i);

	for(i=1; i<n; i++){

		if(a[i]>a[i-1]) num++;

		else ans=max(ans, num), num=1;

	}

	ans=max(ans, num);

	printf("%d", ans);

	return 0;

}


#include <bits/stdc++.h>

#define inf 0x3f3f3f3f

#define mod 1000000007

#define pb push_back

#define sq(x) ((x)*(x))

#define x first

#define y second

#define eps 1e-8

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define debug(x) cout << #x << " = " << x << endl

using namespace std;

typedef long long INT;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<pii, int> pi3;

typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

#define NN 100010

int dp[NN], a[NN];

int main() {

	int N;

	cin>>N;

	for(int i=0; i<N; i++) scanf("%d", a+i);

	dp[0]=1;

	int ans=1;

	for(int i=1; i<N; i++){

		if(a[i]>a[i-1]) dp[i]=dp[i-1]+1;

		else dp[i]=1;

		ans=max(ans, dp[i]);

	}

	cout<<ans<<endl;

	return 0;

}


#include<bits/stdc++.h>

using namespace std;

int main(){

//	freopen("in.txt","r",stdin);

	int n,k,kk,num=1;

	cin>>n;

	int ans=0;

	cin>>kk;

	for(int i=1;i<n;i++){

		scanf("%d",&k);

		if(kk<k) num++;

		else ans=max(num,ans), num=1;

		kk=k;

	}

	ans=max(ans,num);

	cout<<ans<<endl;

	return 0;

}


#include <bits/stdc++.h>

#define inf 10000000000010

#define MOD 1000000007

#define pb push_back

#define sq(x) ((x)*(x))

#define cube(x) ((x)*(x)*(x))

#define x first

#define y second

#define eps 1e-9

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define debug(x) cout << #x << " = " << x << endl

#define NN 100010

using namespace std;

typedef long long INT;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<pii, int> pi3;

typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

int n, i, a[NN], ans, num=1;

int main() {

//	freopen("in.in", "r", stdin);

//	freopen("out.out", "w", stdout);

	scanf("%d", &n);

	for(i=0; i<n; i++) scanf("%d", a+i);

	for(i=1; i<n; i++){

		if(a[i]>a[i-1]) num++, ans=max(ans, num);

		else num=1;

	}

	printf("%d", ans);

	return 0;

}


#include<bits/stdc++.h>

using namespace std;

int a;

int main() {

	int n, pre = 0, tot = 0, ans = 0;

	cin >> n;

	for( int i = 0; i < n; i ++ ) {

		cin >> a;

		if( a <= pre ) {

			ans = max( ans, tot );

			tot = 1;

		}

		else tot ++;

		pre = a;

	}

	ans = max( ans, tot );

	cout << ans <<endl;

	return 0;

}


#include <bits/stdc++.h>

#define inf 0x3f3f3f3f

#define MOD 1000000007

#define pb push_back

#define sq(x) ((x)*(x))

#define cube(x) ((x)*(x)*(x))

#define x first

#define y second

#define eps 1e-8

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define debug(x) cout << #x << " = " << x << endl

using namespace std;

typedef long long INT;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<pii, int> pi3;

typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

#define NN 100100

int a[NN];

int main() {

	int n;

	cin >> n;

	int cnt=0, ans=1;

	for(int i=0; i<n; i++){

		scanf("%d", a+i);

		if(!i) cnt++;

		else if(a[i]>a[i-1]) cnt++;

		else smax(ans, cnt), cnt=1;

	}

	cout << max(ans, cnt) << endl;

	return 0;

}


#include <bits/stdc++.h>

#define NN 100011

#define eprintf(...) fprintf(stderr, __VA_ARGS__)

using namespace std;

typedef long long INT;

typedef pair<int, int> pii;

int a[NN];

int main() {

	int n;

	cin>>n;

	for(int i=0; i<n; i++) scanf("%d", a+i);

	int ans=0;

	for(int i=0; i<n; ){

		int cnt=1;

		while(a[i]<a[i+1]) cnt++, i++;

		ans=max(ans, cnt);

		if(cnt==1) i++;

	}

	cout<<ans<<endl;

	return 0;

}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int pre,temp;
    cin>>pre;
    int len = 1,ans = 1;
    for(int i=1;i<n;i++)
    {
        cin>>temp;
        if(pre < temp)
        {
            len++;
        }
        else
        {

            if(len > ans)
                ans = len;

            len = 1;

        }
        pre = temp;
    }
    if(len < ans)
    cout<<ans<<endl;
    else
    cout<<len<<endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int pre,temp;
    cin>>pre;
    int len = 1,ans = 1;
    for(int i=1;i<n;i++)
    {
        cin>>temp;
        if(pre < temp)
        {
            len++;
        }
        else
        {
            if(len > ans)
                ans = len;
            len = 1;

        }

        pre = temp;
    }
    cout<<ans<<endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int pre,temp;
    cin>>pre;
    int len = 1,ans = 1;
    for(int i=1;i<n;i++)
    {
        cin>>temp;
        if(pre < temp)
        {
            len++;
        }
        else
        {
            if(pre != temp)
            len++;
            if(len > ans)
                ans = len;
            len = 1;

        }
        pre = temp;
    }
    if(len < ans)
    cout<<ans<<endl;
    else
    cout<<len<<endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int pre,temp;
    cin>>pre;
    int len = 1,ans = 1;
    for(int i=1;i<n;i++)
    {
        cin>>temp;
        if(pre < temp)
        {
            len++;
        }
        else
        {
            len++;
            if(len > ans)
                ans = len;
            len = 1;

        }
        pre = temp;
    }
    cout<<ans<<endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int pre,temp;
    cin>>pre;
    int len = 1,ans = 1;
    for(int i=1;i<n;i++)
    {
        cin>>temp;
        if(pre < temp)
        {
            len++;
        }
        else
        {
            if(pre != temp)
            len++;
            if(len > ans)
                ans = len;
            len = 1;

        }
        pre = temp;
    }
    cout<<ans<<endl;
    return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main ()
{
	int n,sum = 1,old = 1;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 1; i < n; i++)
	{
		sum = 1;
		while (a[i] > a[i-1])
		{
			i++;
			sum++;
			if (sum > old)
				old = sum;
			if (i == n)
				break;
		}
	}
	cout << old;
	return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main ()
{
	int n,s,sum = 1,old = 0;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 1; i < n; i++)
	{
		if ((a[i] > a[i-1]))
		{
			sum++;
			if (sum > old)
				old = sum;
		}
		else
			sum = 1;
	}
	cout << old;
	return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main ()
{
	int n,s,sum = 0;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 1; i <= n; i++)
	{
		sum = 1;
		if ((a[i] > a[i-1]))
		{
			s = i;
			while (a[s] > a[s-1])
			{
				s++;
				sum++;
				if (s == n)
					break;
			}
			i = s;
		}

	}

	cout << sum;
	return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main ()
{
	int n,s,sum = 0;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 1; i <= n; i++)
	{
		sum = 1;
		if ((a[i] > a[i-1]))
		{
			s = i;
			while (a[s] > a[s-1])
			{
				s++;
				sum++;
				if (s == n)
					break;
			}
			i = s;
		}

	}
	cout << sum;
	return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main ()
{
	int n,s,sum = 0;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 1; i < n; i++)
	{
		sum = 1;
		if ((a[i] > a[i-1]))
		{
			s = i;
			while (a[s] > a[s-1])
			{
				s++;
				sum++;
				if (s == n)
					break;
			}
			i = s;
		}
	}
	cout << sum;
	return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main ()
{
	int n,s,sum = 0;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 1; i < n; i++)
	{
		sum = 1;
		if ((a[i] > a[i-1]))
		{
			s = i;
			while (a[s] > a[s-1])
			{
				s++;
				sum++;
				if (s == n)
					break;
			}
			i = s;
		}
	}
	if (n == 1)
		cout << '1';
	else
		cout << sum;
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{ int n;
cin>>n;
long int a[n];int i;int size1=0;
for( i=0;i<n;i++)
cin>>a[i];
i=1;
 int j=0;
for(i=1;i<n;i++)
{   j=0;
    while(a[i-1]<a[i])
    {
        j++;
        i++;
    }

    //cout<<j<<" ";
    size1=max(size1,j);
    //cout<<size1;

}

cout<<size1;

    return 0;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{ int n;
cin>>n;
long int a[n];int i;int size1=0;int temp=0;
for( i=0;i<n;i++)

{cin>>a[i];if(i!=0){if(a[i-1]==a[i]) temp++;}}
i=1;
 int j=0;
 if(temp==n)
    cout<<1;
 else
{for(i=1;i<n;i++)
{   j=0;
    while(a[i-1]<a[i])
    {
        j++;
        i++;
    }

    //cout<<j<<" ";
    size1=max(size1,j);
    //cout<<size1;

}

cout<<size1;}

    return 0;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{ int n;
cin>>n;
long int a[n];int i;int size1=0;
for( i=0;i<n;i++)
cin>>a[i];
i=1;
 int j=0;
for(i=1;i<n;i++)
{   j=0;
    while(a[i-1]<a[i])
    {
        j++;
        i++;
    }

    //cout<<j<<" ";
    size1=max(size1,j+1);
    //cout<<size1;

}

cout<<size1;

    return 0;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{ int n;
cin>>n;
long int a[n];int i;int size1=0;int temp=0;
for( i=0;i<n;i++)

{cin>>a[i];if(i!=0){if(a[i-1]==a[i]) temp++;}}
i=1;
 int j=0;
 temp++;
 //cout<<temp;
 if(temp==n)
    cout<<1;
 else
{for(i=1;i<n;i++)
{   j=0;
    while(a[i-1]<a[i])
    {
        j++;
        i++;
    }

    //cout<<j<<" ";
    size1=max(size1,j);
    //cout<<size1;

}

cout<<size1;}

    return 0;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{ int n;
cin>>n;
long int a[n];int i;int size1=0;int temp=0;
for( i=0;i<n;i++)

{cin>>a[i];}
i=0;
 int j=0;
 //temp++;
 int curr=0;
 long int prev=0;
 //cout<<temp;

while(n--)
{
    if(prev<a[i])
    {
        ++curr;size1=max(size1,curr);
    }
    else
    { curr=1;}
    prev=a[i];

i++;

}

cout<<size1;

    return 0;
}


#include<iostream>
using namespace std;

int main(){
	long long int n;
	long long arr[100009];
	cin>>n;

	cin>>arr[0];
	long long int cc=1;
	long long int ma=1;
	for(int i=1; i<n ; i++){
		cin>>arr[i];
		if(arr[i]>arr[i-1])
		{
			cc++ ;
			if(cc>ma)
			ma=cc;
		}
		else cc=1;
		}

		cout<<ma;

return 0;

}


#include<iostream>
using namespace std;

int main(){

long long 	int n;
	long long arr[10009];
	cin>>n;

	cin>>arr[0];
	long long int cc=1;
	long long int ma=1;
	for(int i=1; i<n ; i++){
		cin>>arr[i];
		if(arr[i]>arr[i-1])
		{
			cc++ ;
			if(cc>ma)
			ma=cc;
		}
		else cc=1;
		}

		cout<<ma;

return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main(){

	int n;
	long long arr[10009];
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
//	long long  dp[100009];

//	for(int i=0;i<n;i++)
//		dp[i]=1;
	int cc=1;
	int ma=1;
	for(int i=1;i<n;i++)
		if(arr[i]>arr[i-1])
		{
			cc++;
			if(cc>ma)
			ma=cc;
		}
		else cc=1;

	/*long  long ma=-1;
		for(int i=0;i<n;i++)
			{
				if(dp[i]>ma)
					ma=dp[i];

	}
*/
		cout<<ma;

return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main(){

long long 	int n;
	long long arr[10009];
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}

	long long int cc=1;
	long long int ma=1;
	for(int i=1;i<n;i++)
		if(arr[i]>arr[i-1])
		{
			cc++;
			if(cc>ma)
			ma=cc;
		}
		else cc=1;

		cout<<ma;

return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main(){

	int n;
	long long arr[10009];
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	int dp[100009];

	//memset(dp,1,sizeof(dp));
	/*int ma=-1;
		for(int i=0;i<n;i++)
			{ma=max(ma,dp[i]);
			cout<<dp[i]<<ma<<endl;
		}
	*/
	for(int i=0;i<n;i++)
		dp[i]=1;

	for(int i=1;i<n;i++)
		if(arr[i]>arr[i-1])
		{
		dp[i]=dp[i-1]+1;
		}
	int 	ma=-1;
		for(int i=0;i<n;i++)
			{ma=max(ma,dp[i]);
		//	cout<<dp[i]<<ma<<endl;
		}
		cout<<ma;

return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main(){

	int n;
	long long arr[10009];
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	long long  dp[100009];

	//memset(dp,1,sizeof(dp));
	/*int ma=-1;
		for(int i=0;i<n;i++)
			{ma=max(ma,dp[i]);
			cout<<dp[i]<<ma<<endl;
		}
	*/
	for(int i=0;i<n;i++)
		dp[i]=1;

	for(int i=1;i<n;i++)
		if(arr[i]>arr[i-1])
		{
		dp[i]=dp[i-1]+1;
		}

	long  long ma=-1;
		for(int i=0;i<n;i++)
			{
				if(dp[i]>ma)
					ma=dp[i];
		//	cout<<dp[i]<<ma<<endl;
		}
		cout<<ma;

return 0;

}


#include <iostream>
using namespace std;

int main(void)
{
    int n,mi=0,a;

    cin >> n;

    int ara[n];

    for(int i=0;i<n;i++){
        cin >> ara[i];
        if(i>0){
            if(ara[i]>ara[i-1]) mi++;
            else mi=0;
        }
    }

    cout << mi+1 <<endl;

    main();

    return 0;
}


#include <iostream>
using namespace std;

int main(void)
{
    int n;

    cin >> n;

    if(n==1){
        cout << "1" << endl;
        return 0;
    }

    int ara[n];
    int m=1;

    for(int i=0;i<n;i++) cin >> ara[i];
    int c=0;

    for(int i=0;i<n-1;i++){
        if(ara[i]<ara[i+1]) c++;
        else c=0;
        cout << c << endl;
        if(m<c) m=c;
    }

    if(m==1) cout << m << endl;
    else cout << m+1 << endl;

    return 0;
}


#include <iostream>
using namespace std;

int main(void)
{
    int n;

    cin >> n;

    int ara[n];

    for(int i=0;i<n;i++)
    {
        cin >> ara[i];
    }

    int maxLen=0;

    for(int i=0;i<n;i++)
    {
        int len=1;
        int cv=ara[i];

        for(int j=i+1;j<n;j++)
        {
            if(cv<ara[j])
            {
                len++;
                cv=ara[j];
            }
            else break;
            //cout << len << endl;
            if(maxLen<len) maxLen=len;
        }
    }
    if(maxLen==0) maxLen++;
    cout << maxLen << endl;
    main();
    return 0;
}


#include <iostream>
using namespace std;

int main(void)
{
    int n,mi=0,a;

    cin >> n;

    int ara[n];

    for(int i=0;i<n;i++){
        cin >> ara[i];
        if(i>0){
            if(ara[i]>ara[i-1]) mi++;
            else mi=0;
        }
    }

    cout << mi+1 <<endl;

    return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;

int main(void)
{
    int n,k,count=0;

    cin >> n;

    int ara[n];

    for(k=0;k<n;k++) scanf("%d",&ara[k]);

    int a=0,p=0,j;

    for(int i=a;i<n;i++){
        for(j=i+1;j<n;j++){
            if(ara[i]>=ara[j]){
                a=i;
                break;
            }
            else count++;
        }

        if(j!=(n-1)) count=0;
    }

    cout << count <<endl;

    return 0;
}


#include <iostream>
using namespace std;

int main(void)
{
    int n;

    cin >> n;

    if(n==1){
        cout << "1" << endl;
        return 0;
    }

    int ara[n];
    int m=1;

    for(int i=0;i<n;i++) cin >> ara[i];
    int c=0;

    for(int i=0;i<n-1;i++){
        if(ara[i]<ara[i+1]) c++;
        else c=0;
        //cout << c << endl;
        if(m<c) m=c;
    }

    if(m==1) cout << m << endl;
    else cout << m+1 << endl;

    return 0;
}


#include <iostream>
using namespace std;

int main(void)
{
    int n;

    cin >> n;

    if(n==1){
        cout << "1" << endl;
        return 0;
    }

    int ara[n];
    int m=1;

    for(int i=0;i<n;i++){
        cin >> ara[i];
    }

    int flag=0;

    for(int i=0;i<n;i++){
        if(i){
            if(ara[i]==ara[i-1]) flag=1;
            else{
                flag=0;
                break;
            }
        }
    }

    if(flag){
        cout << "1" << endl;
        return 0;
    }

    int c=0;

    for(int i=0;i<n-1;i++){
        if(ara[i]<ara[i+1]) c++;
        else c=0;
        //cout << c << endl;
        if(m<c) m=c;
    }

    //if(m==1) cout << m << endl;
    cout << m+1 << endl;

    return 0;
}


#include <iostream>

using namespace std;

int main(void)
{
    int n;

    cin >> n;

    int ara[n];

    for(int i=0;i<n;i++)
    {
        cin >> ara[i];
    }

    int cv;
    int len=1,maxlen=0;

    for(int i=0;i<n-1;i++)
    {
        cv=ara[i];
        if(cv<ara[i+1]) len++;
        else
        {   //cout << len << endl;
            if(maxlen<len) maxlen=len;
            len=1;
        }
    }

    if(maxlen<len) maxlen=len;

    cout << maxlen << endl;
    //main();

    return 0;
}


#include <iostream>

using namespace std;

int main(void)
{
    int n;

    cin >> n;

    int ara[n];

    for(int i=0;i<n;i++)
    {
        cin >> ara[i];
    }

    int cv;
    int len=1,maxlen=0;

    for(int i=0;i<n-1;i++)
    {
        cv=ara[i];
        if(cv<ara[i+1]) len++;
        else
        {   //cout << len << endl;
            if(maxlen<len) maxlen=len;
            len=1;
        }
    }

    if(maxlen<len) maxlen=len;

    cout << maxlen << endl;
    main();

    return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;

int main(void)
{
    int n,k;

    cin >> n;

    int ara[n];

    for(k=0;k<n;k++) scanf("%d",&ara[k]);

    int a=0,p,j;

    for(int i=a;i<n;i++){
        for(j=i+1;j<n;j++){
            if(ara[i]>=ara[j]){
                a=i;
                break;
            }
        }
        if(j==n){
            p=i;
        }
    }

    cout << "Final position" << p<<endl;

    return 0;
}


#include <iostream>
using namespace std;

int main(void)
{
    int n;

    cin >> n;

    if(n==1){
        cout << "1" << endl;
        return 0;
    }

    int ara[n];
    int m=1;

    for(int i=0;i<n;i++){
        cin >> ara[i];
    }

    int flag=0;

    for(int i=0;i<n;i++){
        if(i){
            if(ara[i]==ara[i-1]) flag=1;
            else{
                flag=0;
                break;
            }
        }
    }

    if(flag){
        cout << "1" << endl;
        return 0;
    }

    int c=0;

    for(int i=0;i<n-1;i++){
        if(ara[i]<=ara[i+1]) c++;
        else c=0;
        //cout << c << endl;
        if(m<c) m=c;
    }

    //if(m==1) cout << m << endl;
    cout << m+1 << endl;

    return 0;
}


#include <iostream>
using namespace std;

int main(void)
{
    int n;

    cin >> n;

    int ara[n];

    for(int i=0;i<n;i++)
    {
        cin >> ara[i];
    }

    int maxLen=0;

    for(int i=0;i<n;i++)
    {
        int len=1;
        int cv=ara[i];

        for(int j=i+1;j<n;j++)
        {
            if(cv<ara[j])
            {
                len++;
                cv=ara[j];
            }
            else break;
            //cout << len << endl;
            if(maxLen<len) maxLen=len;
        }
    }
    if(maxLen==0) maxLen++;
    cout << maxLen << endl;
    //main();
    return 0;
}


#include <iostream>
using namespace std;

int main(void)
{
    int n;

    cin >> n;

    int ara[n];

    for(int i=0;i<n;i++) cin >> n[i];

    int a=0,p;

    for(int i=a;i<n;i++){
        for(j=i+1;j<n;j++){
            if(ara[i]>=ara[j]){
                a=i;
                break;
            }
        }
        if(j==n){
            p=i;
        }
    }

    cout << "Final position" << p<<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main(void)
{
    int n;

    cin >> n;

    int ara[n];

    for(int i=0;i<n;i++)
    {
        cin >> ara[i];
    }

    int len,maxlen=0;

    for(int i=0;i<n;i++)
    {
        len=1;
        for(int j=i;j<n-1;j++)
        {
            if(ara[j]<ara[j+1]) len++;
            else break;
        }
        //cout << len << endl;
        if(maxlen<len) maxlen=len;
    }

    cout << maxlen << endl;
    //main();

    return 0;
}


#include <iostream>
using namespace std;

int main(void)
{
    int n;

    cin >> n;

    if(n==1){
        cout << "1" << endl;
        return 0;
    }

    int ara[n];
    int m=1;

    for(int i=0;i<n;i++){
        cin >> ara[i];
    }

    int flag=0;

    for(int i=0;i<n;i++){
        if(i){
            if(ara[i]==ara[i-1]) flag=1;
            else{
                flag=0;
                break;
            }
        }
    }

    if(flag){
        cout << "1" << endl;
        return 0;
    }

    int c=0;

    for(int i=0;i<n-1;i++){
        if(ara[i]<ara[i+1]) c++;
        else c=0;
        //cout << c << endl;
        if(m<c) m=c;
    }

    if(m==1) cout << m << endl;
    else cout << m+1 << endl;

    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    int A[100000], n, x, y=0, count=0;
    for (int i=0; i<n; i++)
        scanf("%i", &A[i]);
    for (int j=0; j<n; j++){
        x=y;
        y=A[j];
        if (x<y)
            count++;
        else
            count=1;
    }
    printf("%i", count);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    long long A[100000], n, count=1, max;
    scanf("%lld", &n);
    for (int i=0; i<n; i++)
        scanf("%lld", &A[i]);
    for (int j=0; j<(n-1); j++){
        if (A[j]<A[j+1]){
            count++;
            if (count>max)
            max=count; }
        else
            count=1;
    }
    if (count>max)
        printf("%lld", count);
    else
        printf("%lld", max);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    long long A[100000], n, count=1;
    scanf("%lld", &n);
    for (int i=0; i<n; i++)
        scanf("%lld", &A[i]);
    for (int j=0; j<n; j++){
        if (A[j]<A[j+1])
            count++;
        else
            count=1;
    }
    printf("%lld", count);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    long long A[100000], n, count=0;
    scanf("%lld", &n);
    for (int i=0; i<n; i++)
        scanf("%lld", &A[i]);
    for (int j=0; j<n; j++){
        if (A[j]<A[j+1])
            count++;
        else
            count=1;
    }
    printf("%lld", count);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    long long A[100000], n, count=1;
    scanf("%lld", &n);
    for (int i=0; i<n; i++)
        scanf("%lld", &A[i]);
    for (int j=0; j<(n-1); j++){
        if (A[j]<A[j+1])
            count++;
        else
            count=1;
    }
    printf("%lld", count);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    long long A[100000], n, count=1, max;
    scanf("%lld", &n);
    for (int i=0; i<n; i++)
        scanf("%lld", &A[i]);
    for (int j=0; j<(n-1); j++){
        if (A[j]<A[j+1]){
            count++;
            if (count>max)
            max=count; }
        else
            count=1;
    }
    printf("%lld", count);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    int A[100000], n, x, y=0, count=0;
    scanf("%i", &n);
    for (int i=0; i<n; i++)
        scanf("%i", &A[i]);
    for (int j=0; j<n; j++){
        x=y;
        y=A[j];
        if (x<y)
            count++;
        else
            count=1;
    }
    printf("%i", count);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    long long A[100000], n, count=1, max=0;
    scanf("%lld", &n);
    for (int i=0; i<n; i++)
        scanf("%lld", &A[i]);
    for (int j=0; j<(n-1); j++){
        if (A[j]<A[j+1]){
            count++;
            if (count>max)
            max=count; }
        else
            count=1;
    }
    printf("%lld", max);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    long long A[100000], n, x, y=0, count=0;
    scanf("%lld", &n);
    for (int i=0; i<n; i++)
        scanf("%lld", &A[i]);
    for (int j=0; j<n; j++){
        x=y;
        y=A[j];
        if (x<=y)
            count++;
        else
            count=1;
    }
    printf("%lld", count);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    long long A[100000], n, count=1;
    scanf("%lld", &n);
    for (int i=0; i<n; i++)
        scanf("%lld", &A[i]);
    for (int j=0; j<(n-1); j++){
        if (A[j]<A[j+1])
            count++;
        else
            count=1;
    }
    printf("%lld", count+1);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main() {
    long long A[100000], n, x, y=0, count=0;
    scanf("%lld", &n);
    for (int i=0; i<n; i++)
        scanf("%lld", &A[i]);
    for (int j=0; j<n; j++){
        x=y;
        y=A[j];
        if (x<y)
            count++;
        else
            count=1;
    }
    printf("%lld", count);
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long int n,k=1;
    long long int a,b;
    cin>>n;
    cin>>a;
    for(long int i=0;i<n-1;i++){
        cin>>b;
        if (a<b){
            k++;
        }else{
        k=1;}
        a=b;
    }
    cout<<k;
}


#include <iostream>

using namespace std;

int main()
{
    long int n,k=1,m=1;
    long long int a,b;
    cin>>n;
    cin>>a;
    for(long int i=0;i<n-1;i++){
        cin>>b;
        if (a<b){
            k++;
        }else{
           if(k>m) {m=k;}
           k=1;
        }
        a=b;
    }
    if(k>m) {m=k;}
    cout<<m;
}


#include <iostream>

using namespace std;

int main()
{
    long int n,k=1,m=1;
    long long int a,b;
    cin>>n;
    cin>>a;
    for(long int i=0;i<n-1;i++){
        cin>>b;
        if (a<b){
            k++;
        }else{
           if(k>m) {m=k;}
           k=1;
        }
        a=b;
    }
    cout<<k;
}


#include <iostream>

using namespace std;

int main()
{
    long int n,k=1;
    long long int a,b;
    cin>>n;
    cin>>a;
    for(long int i=0;i<n-1;i++){
        cin>>b;
        if (a<=b){
            k++;
        }else{
        k=1;}
        a=b;
    }
    cout<<k;
}


#include <iostream>

using namespace std;

int main()
{
    long int n,k=1,m=1;
    long long int a,b;
    cin>>n;
    cin>>a;
    for(long int i=0;i<n-1;i++){
        cin>>b;
        if (a<b){
            k++;
        }else{
           if(k>m) {m=k;}
           k=1;
        }
        a=b;
    }
    cout<<m;
}


#include <iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<set>
#include<cstdio>
using namespace std;

int main()

{
    int n , maxi=-1 ;
    cin >> n ;

    long long arr[n] ;
    for(int i=0 ; i<n ; i++)
    {
        cin >> arr[i] ;
    }
    int c=0 ;
    for(int i=0 ; i<n ; i++)
    {
        if ( arr[i] < arr[i+1] )
        {
            c++;
            if( c > maxi)
                maxi=c ;
        }
        else
            c=0  ;
    }
    if ( n ==1 )
        cout << 1 << endl;
    else
        cout << maxi << endl;
   return 0 ;
}


#include <iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<set>
#include<cstdio>
using namespace std;

int main()

{
    int n , maxi=-1 ;
    cin >> n ;

    long long arr[n] ;
    for(int i=0 ; i<n ; i++)
    {
        cin >> arr[i] ;
    }
    int c=0 ;
    for(int i=0 ; i<n ; i++)
    {
        if ( arr[i+1] > arr[i])
        {
            c++;
            if( c > maxi)
                maxi=c ;
        }
        else
            c=0  ;
    }
    if ( n == 1)
        cout << 1 << endl;
    else
   {printf("%d",c);
   cout << endl;
   }
   return 0 ;
}


#include <iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<set>
#include<cstdio>
using namespace std;

int main()

{
    int n , maxi=-1 ;
    cin >> n ;

    long long arr[n] ;
    for(int i=0 ; i<n ; i++)
    {
        cin >> arr[i] ;
    }
    int c=0 ;
    for(int i=0 ; i<n ; i++)
    {
        if ( arr[i+1] > arr[i])
        {
            c++;
            if( c > maxi)
                maxi=c ;
        }
        else
            c=0  ;
    }
   printf("%d",c);
   cout << endl;
   return 0 ;
}


#include <iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<set>
#include<cstdio>
using namespace std;

int main()

{
    int n , maxi=-1 ;
    cin >> n ;

    long long arr[n] ;
    for(int i=0 ; i<n ; i++)
    {
        cin >> arr[i] ;
    }
    int c=0 ;
    for(int i=0 ; i<n ; i++)
    {
        if ( arr[i+1] > arr[i])
        {
            c++;
            if( c > maxi)
                maxi=c ;
        }
        else
            c=0 ;
    }
   printf("%d",c);
   cout << endl;
   return 0 ;
}


#include <iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<set>
#include<cstdio>
using namespace std;

int main()

{
    int n , maxi=-1 ;
    cin >> n ;

    long long arr[n] ;
    for(int i=0 ; i<n ; i++)
    {
        cin >> arr[i] ;
    }
    int c=0 ;
    for(int i=0 ; i<n ; i++)
    {
        if ( arr[i] < arr[i+1] )
        {
            c++;
            if( c > maxi)
                maxi=c ;
        }
        else
            c=0  ;
    }

   printf("%d",maxi);
   cout << endl;

   return 0 ;
}


#include <iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<set>
#include<cstdio>
using namespace std;

int main()

{
    int n , maxi=1 ;
    cin >> n ;

    long long arr[n] ;
    for(int i=0 ; i<n ; i++)
    {
        cin >> arr[i] ;
    }
    int c=1 ;
    for(int i=0 ; i<n ; i++)
    {
        if ( arr[i] < arr[i+1] && i!=n-1)
        {
            c++;
            if( c > maxi)
                maxi=c ;
        }
        else
            c=1  ;
    }

  cout << maxi << endl;
   return 0 ;
}


#include <bits/stdc++.h>

using namespace std;
int main() {
	long long int n,i,j,cnt,mx;
	scanf("%lld",&n);
	long long int a[n];
	for(i=0;i<n;i++)
	{
	    scanf("%lld",&a[i]);
	}
	cnt=1;
	mx=1;
	for(i=0;i<n-1;i++)
	{
	    if(a[i]<a[i+1])
	    {
	        cnt++;
	    }
	    else if(a[i]>=a[i+1]){
	        cnt=1;
	    }
	    if(mx<cnt)mx=cnt;
	}
	printf("%lld\n",mx);
	return 0;
}