#include <bits/stdc++.h>
using namespace std;
#define sf              scanf
#define pf              printf
#define cases           ll T;cin>>T;for(int TC=1;TC<=T;TC++)
#define pi              3.1415926535897932384626433832795l
#define ignore          cin.ignore();
#define mem(n,i)        memset(n,i,sizeof n);
#define precision(n)    cout<<fixed<<setprecision(n);
#define bug()           cerr<<"**********\n";
#define pb              push_back
#define MOD             1000000007
#define cout(x)         cout<<"Case "<<TC<<": "<<x<<endl
#define EPS             1e-9
#define mp              make_pair
typedef unsigned long long ull;
typedef long long ll;
vector <pair <int,int > > pos;
char draw[1000][1000];
int r1[1001][1001];
int r2[1001][1001];
int c1[1001][1001];
int c2[1001][1001];
int m,n,LEFT,RIGHT,UP,DOWN;

struct FX {
int x,y,s;
};
vector <FX> store;
int check(int x, int y)
{

    LEFT=r1[x][y]-1;
    RIGHT=r2[x][y]-1;
    UP=c1[x][y]-1;
    DOWN=c2[x][y]-1;
    int SIZE= min(min(min(UP,DOWN),LEFT),RIGHT);
    return SIZE;
}
int main()
{

    sf("%d %d",&n,&m);
    for(int i=0;i<n;i++)
        sf("%s",draw[i]);

    int x,y;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                pos.pb({i,j});

                r1[i][j]=1;
                r2[i][j]=1;
                c1[i][j]=1;
                c2[i][j]=1;

            }
        }
    }

    for(int i=0;i<n;i++)
    {
        for(int j=1;j<m;j++)
        {
            if(r1[i][j]!=0)
                r1[i][j]+=r1[i][j-1];
        }
    }
    for(int i=0;i<n;i++)
    {
        for(int j=m-2;j>=0;j--)
        {
            if(r2[i][j]!=0)
                r2[i][j]+=r2[i][j+1];
        }
    }

    for(int i=0;i<m;i++)
    {
        for(int j=1;j<n;j++)
        {
            if(c1[j][i]!=0)
                c1[j][i]+=c1[j-1][i];
        }
    }
    for(int i=0;i<m;i++)
    {
        for(int j=n-2;j>=0;j--)
        {
            if(c2[j][i]!=0)
                c2[j][i]+=c2[j+1][i];
        }
    }

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                int SIZE=check(i,j);
                if(SIZE)
                {
                    store.push_back({i,j,SIZE});
                }

            }
        }
    }

    bool flag=true;
    for(int i=0;i<pos.size();i++)
    {

        int count=0;
        for(int j=0;j<store.size();j++)
        {

            int SIZE=store[j].s;
            int X=store[j].x;
            int Y=store[j].y;
            if  ((pos[i].first==X && pos[i].second>= (Y-SIZE) && pos[i].second<=(Y+SIZE)) ||
                 (pos[i].second==Y && pos[i].first>= (X-SIZE) && pos[i].first<=(X+SIZE)))
            {

            }
            else
                count++;
        }
        if(count==store.size())
        {
            flag=false;
            break;
        }
    }
    if(flag)
    {
        pf("%d\n",store.size());
        for(int i=0;i<store.size();i++)
            pf("%d %d %d\n",store[i].x+1,store[i].y+1,store[i].s);
    }
    else
        pf("-1\n");
}


#include <bits/stdc++.h>
using namespace std;
#define sf              scanf
#define pf              printf
#define cases           ll T;cin>>T;for(int TC=1;TC<=T;TC++)
#define pi              3.1415926535897932384626433832795l
#define ignore          cin.ignore();
#define mem(n,i)        memset(n,i,sizeof n);
#define precision(n)    cout<<fixed<<setprecision(n);
#define bug()           cerr<<"**********\n";
#define pb              push_back
#define MOD             1000000007
#define cout(x)         cout<<"Case "<<TC<<": "<<x<<endl
#define EPS             1e-9
#define mp              make_pair
typedef unsigned long long ull;
typedef long long ll;
vector <pair <int,int > > pos;
char draw[1000][1000];
int r1[1001][1001];
int r2[1001][1001];
int c1[1001][1001];
int c2[1001][1001];
int m,n,LEFT,RIGHT,UP,DOWN;
struct FX {
int x,y,s;
};
vector <FX> store;
int check(int x, int y)
{

    LEFT=r1[x][y]-1;
    RIGHT=r2[x][y]-1;
    UP=c1[x][y]-1;
    DOWN=c2[x][y]-1;
    int SIZE= min(min(min(UP,DOWN),LEFT),RIGHT);
    return SIZE;
}
int main()
{

    sf("%d %d",&n,&m);
    for(int i=0;i<n;i++)
        sf("%s",draw[i]);

    int x,y;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                pos.pb({i,j});
                r1[i][j]=1;
                r2[i][j]=1;
                c1[i][j]=1;
                c2[i][j]=1;
            }
        }
    }
    for(int i=0,k=0;i<n;i++,k++)
    {
        for(int j=1,l=m-2;j<m;j++,l--)
        {
            if(r1[i][j]!=0)
                r1[i][j]+=r1[i][j-1];
            if(r2[k][l]!=0)
                r2[k][l]+=r2[k][l+1];
        }
    }

    for(int i=0,k=0;i<m;i++,k++)
    {
        for(int j=1,l=n-2;j<n;j++,l--)
        {
            if(c1[j][i]!=0)
                c1[j][i]+=c1[j-1][i];
            if(c2[l][k]!=0)
                c2[l][k]+=c2[l+1][k];
        }
    }

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                int SIZE=check(i,j);
                if(SIZE)
                {
                    store.push_back({i,j,SIZE});
                }
            }
        }
    }

    bool flag=true;
    int StoreSize=store.size();
    int posSIZE=pos.size();
    for(int i=0;i<posSIZE;i++)
    {

        int count=0;
        for(int j=0;j<StoreSize;j++)
        {

            int SIZE=store[j].s;
            int X=store[j].x;
            int Y=store[j].y;
            if  ((pos[i].first==X && pos[i].second>= (Y-SIZE) && pos[i].second<=(Y+SIZE)) ||
                 (pos[i].second==Y && pos[i].first>= (X-SIZE) && pos[i].first<=(X+SIZE)))
            {

            }
            else
                count++;
        }
        if(count==StoreSize)
        {
            flag=false;
            break;
        }
    }
    if(flag)
    {
        pf("%d\n",StoreSize);
        for(int i=0;i<StoreSize;i++)
            pf("%d %d %d\n",store[i].x+1,store[i].y+1,store[i].s);
    }
    else
        pf("-1\n");
}


#include <bits/stdc++.h>
using namespace std;
#define sf              scanf
#define pf              printf
#define cases           ll T;cin>>T;for(int TC=1;TC<=T;TC++)
#define pi              3.1415926535897932384626433832795l
#define ignore          cin.ignore();
#define mem(n,i)        memset(n,i,sizeof n);
#define precision(n)    cout<<fixed<<setprecision(n);
#define bug()           cerr<<"**********\n";
#define pb              push_back
#define MOD             1000000007
#define cout(x)         cout<<"Case "<<TC<<": "<<x<<endl
#define EPS             1e-9
#define mp              make_pair
typedef unsigned long long ull;
typedef long long ll;
vector <pair <int,int > > pos;
char draw[1000][1000];
int r1[1001][1001];
int r2[1001][1001];
int c1[1001][1001];
int c2[1001][1001];
int stars[1001][1001];
int m,n,LEFT,RIGHT,UP,DOWN;
vector <pair<int ,int >> store;

int main()
{

    sf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        sf("%s",draw+i);

    int x,y;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                pos.pb({i,j});
                r1[i][j]=1;
                r2[i][j]=1;
                c1[i][j]=1;
                c2[i][j]=1;
            }
        }
    }
    for(int i=0,k=0;i<n;i++,k++)
    {
        for(int j=1,l=m-2;j<m;j++,l--)
        {
            if(r1[i][j]!=0)
                r1[i][j]+=r1[i][j-1];
            if(r2[k][l]!=0)
                r2[k][l]+=r2[k][l+1];
        }
    }
    for(int i=0,k=0;i<m;i++,k++)
    {
        for(int j=1,l=n-2;j<n;j++,l--)
        {
            if(c1[j][i]!=0)
                c1[j][i]+=c1[j-1][i];
            if(c2[l][k]!=0)
                c2[l][k]+=c2[l+1][k];
        }
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                LEFT=r1[i][j]-1;
                RIGHT=r2[i][j]-1;
                UP=c1[i][j]-1;
                DOWN=c2[i][j]-1;
                int SIZE= min(min(min(UP,DOWN),LEFT),RIGHT);
                if(SIZE)
                {
                    store.pb({i,j});
                    stars[i][j]=SIZE;
                }
            }
        }
    }
    int StoreSize=store.size();
    int posSIZE=pos.size();

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

        int count=0;
        for(int j=0;j<StoreSize;j++)
        {

            int X=store[j].first;
            int Y=store[j].second;
            int SIZE=stars[X][Y];

            if  ((pos[i].first==X && pos[i].second>= (Y-SIZE) && pos[i].second<=(Y+SIZE)) ||
                 (pos[i].second==Y && pos[i].first>= (X-SIZE) && pos[i].first<=(X+SIZE)))
            {

            }
            else
                count++;
        }
        if(count==StoreSize)
        {
            puts("-1");
            return 0;

        }
    }
    pf("%d\n",StoreSize);
    for(int i=0;i<StoreSize;i++)
        pf("%d %d %d\n",store[i].first+1,store[i].second+1,stars[store[i].first][store[i].second]);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define sf              scanf
#define pf              printf
#define cases           ll T;cin>>T;for(int TC=1;TC<=T;TC++)
#define pi              3.1415926535897932384626433832795l
#define ignore          cin.ignore();
#define mem(n,i)        memset(n,i,sizeof n);
#define precision(n)    cout<<fixed<<setprecision(n);
#define bug()           cerr<<"**********\n";
#define pb              push_back
#define MOD             1000000007
#define cout(x)         cout<<"Case "<<TC<<": "<<x<<endl
#define EPS             1e-9
#define mp              make_pair
typedef unsigned long long ull;
typedef long long ll;
vector <pair <int,int > > pos;
char draw[1000][1000];
int r1[1001][1001];
int r2[1001][1001];
int c1[1001][1001];
int c2[1001][1001];
int m,n,LEFT,RIGHT,UP,DOWN;

struct FX {
int x,y,s;
};
vector <FX> store;
int check(int x, int y)
{

    LEFT=r1[x][y]-1;
    RIGHT=r2[x][y]-1;
    UP=c1[x][y]-1;
    DOWN=c2[x][y]-1;
    int SIZE= min(min(min(UP,DOWN),LEFT),RIGHT);
    return SIZE;
}
int main()
{

    sf("%d %d",&n,&m);
    for(int i=0;i<n;i++)
        sf("%s",draw[i]);

    int x,y;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                pos.pb({i,j});

                r1[i][j]=1;
                r2[i][j]=1;
                c1[i][j]=1;
                c2[i][j]=1;

            }
        }
    }

    for(int i=0;i<n;i++)
    {
        for(int j=1;j<m;j++)
        {
            if(r1[i][j]!=0)
                r1[i][j]+=r1[i][j-1];
        }
    }
    for(int i=0;i<n;i++)
    {
        for(int j=m-2;j>=0;j--)
        {
            if(r2[i][j]!=0)
                r2[i][j]+=r2[i][j+1];
        }
    }

    for(int i=0;i<m;i++)
    {
        for(int j=1;j<n;j++)
        {
            if(c1[j][i]!=0)
                c1[j][i]+=c1[j-1][i];
        }
    }
    for(int i=0;i<m;i++)
    {
        for(int j=n-2;j>=0;j--)
        {
            if(c2[j][i]!=0)
                c2[j][i]+=c2[j+1][i];
        }
    }

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                int SIZE=check(i,j);
                if(SIZE)
                {
                    store.push_back({i,j,SIZE});
                }

            }
        }
    }

    bool flag=true;
    for(int i=0;i<pos.size();i++)
    {

        int count=0;
        for(int j=0;j<store.size();j++)
        {

            int SIZE=store[j].s;
            int X=store[j].x;
            int Y=store[j].y;
            if  ((pos[i].first==X && pos[i].second>= (Y-SIZE) && pos[i].second<=(Y+SIZE)) ||
                 (pos[i].second==Y && pos[i].first>= (X-SIZE) && pos[i].first<=(X+SIZE)))
            {

            }
            else
                count++;
        }
        if(count==store.size())
        {
            flag=false;
            break;
        }
    }
    if(flag)
    {
        cout<<store.size()<<endl;
        for(int i=0;i<store.size();i++)
        cout<<store[i].x+1<<" "<<store[i].y+1<<" "<<store[i].s<<endl;
    }
    else
        cout<<"-1"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define sf              scanf
#define pf              printf
#define cases           ll T;cin>>T;for(int TC=1;TC<=T;TC++)
#define pi              3.1415926535897932384626433832795l
#define ignore          cin.ignore();
#define mem(n,i)        memset(n,i,sizeof n);
#define precision(n)    cout<<fixed<<setprecision(n);
#define bug()           cerr<<"**********\n";
#define pb              push_back
#define MOD             1000000007
#define cout(x)         cout<<"Case "<<TC<<": "<<x<<endl
#define EPS             1e-9
#define mp              make_pair
typedef unsigned long long ull;
typedef long long ll;
vector <pair <int,int > > pos;
char draw[1000][1000];
int r1[1001][1001];
int r2[1001][1001];
int c1[1001][1001];
int c2[1001][1001];
int stars[1001][1001];
int m,n,LEFT,RIGHT,UP,DOWN;
vector <pair<int ,int >> store;
inline int check(int x, int y)
{

    LEFT=r1[x][y]-1;
    RIGHT=r2[x][y]-1;
    UP=c1[x][y]-1;
    DOWN=c2[x][y]-1;
    int SIZE= min(min(min(UP,DOWN),LEFT),RIGHT);
    return SIZE;
}
int main()
{

    sf("%d %d",&n,&m);
    for(int i=0;i<n;i++)
        sf("%s",draw[i]);

    int x,y;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                pos.pb({i,j});
                r1[i][j]=1;
                r2[i][j]=1;
                c1[i][j]=1;
                c2[i][j]=1;
            }
        }
    }
    for(int i=0,k=0;i<n;i++,k++)
    {
        for(int j=1,l=m-2;j<m;j++,l--)
        {
            if(r1[i][j]!=0)
                r1[i][j]+=r1[i][j-1];
            if(r2[k][l]!=0)
                r2[k][l]+=r2[k][l+1];
        }
    }
    for(int i=0,k=0;i<m;i++,k++)
    {
        for(int j=1,l=n-2;j<n;j++,l--)
        {
            if(c1[j][i]!=0)
                c1[j][i]+=c1[j-1][i];
            if(c2[l][k]!=0)
                c2[l][k]+=c2[l+1][k];
        }
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                int SIZE=check(i,j);
                if(SIZE)
                {
                    store.pb({i,j});
                    stars[i][j]=SIZE;
                }
            }
        }
    }
    bool flag=true;
    int StoreSize=store.size();
    int posSIZE=pos.size();

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

        int count=0;
        for(int j=0;j<StoreSize;j++)
        {

            int X=store[j].first;
            int Y=store[j].second;
            int SIZE=stars[X][Y];

            if  ((pos[i].first==X && pos[i].second>= (Y-SIZE) && pos[i].second<=(Y+SIZE)) ||
                 (pos[i].second==Y && pos[i].first>= (X-SIZE) && pos[i].first<=(X+SIZE)))
            {

            }
            else
                count++;
        }
        if(count==StoreSize)
        {
            flag=false;
            break;
        }
    }
    if(flag)
    {
        pf("%d\n",StoreSize);
        for(int i=0;i<StoreSize;i++)
            pf("%d %d %d\n",store[i].first+1,store[i].second+1,stars[store[i].first][store[i].second]);
    }
    else
        pf("-1\n");
}


#include <bits/stdc++.h>
using namespace std;
#define sf              scanf
#define pf              printf
#define cases           ll T;cin>>T;for(int TC=1;TC<=T;TC++)
#define pi              3.1415926535897932384626433832795l
#define ignore          cin.ignore();
#define mem(n,i)        memset(n,i,sizeof n);
#define precision(n)    cout<<fixed<<setprecision(n);
#define bug()           cerr<<"**********\n";
#define pb              push_back
#define MOD             1000000007
#define cout(x)         cout<<"Case "<<TC<<": "<<x<<endl
#define EPS             1e-9
#define mp              make_pair
typedef unsigned long long ull;
typedef long long ll;
vector <pair <int,int > > pos;
char draw[1000][1000];
int r1[1001][1001];
int r2[1001][1001];
int c1[1001][1001];
int c2[1001][1001];
int stars[1001][1001];
int horizontal[1001][1001];
int vertical[1001][1001];
int m,n,LEFT,RIGHT,UP,DOWN;
vector <pair<int ,int >> store;

int main()
{

    sf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        sf("%s",draw+i);

    int x,y;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                pos.pb({i,j});
                r1[i][j]=1;
                r2[i][j]=1;
                c1[i][j]=1;
                c2[i][j]=1;
            }
        }
    }
    for(int i=0,k=0;i<n;i++,k++)
    {
        for(int j=1,l=m-2;j<m;j++,l--)
        {
            if(r1[i][j]!=0)
                r1[i][j]+=r1[i][j-1];
            if(r2[k][l]!=0)
                r2[k][l]+=r2[k][l+1];
        }
    }
    for(int i=0,k=0;i<m;i++,k++)
    {
        for(int j=1,l=n-2;j<n;j++,l--)
        {
            if(c1[j][i]!=0)
                c1[j][i]+=c1[j-1][i];
            if(c2[l][k]!=0)
                c2[l][k]+=c2[l+1][k];
        }
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(draw[i][j]=='*')
            {
                LEFT=r1[i][j]-1;
                RIGHT=r2[i][j]-1;
                UP=c1[i][j]-1;
                DOWN=c2[i][j]-1;
                int SIZE= min(min(min(UP,DOWN),LEFT),RIGHT);
                if(SIZE)
                {
                    store.pb({i,j});
                    stars[i][j]=SIZE;
                    horizontal[i][j-SIZE]++;
                    horizontal[i][j+SIZE+1]--;
                    vertical[i-SIZE][j]++;
                    vertical[i+SIZE+1][j]--;
                }
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        for(int j=1;j<m;j++)
        {
                horizontal[i][j]+=horizontal[i][j-1];
        }
    }
    for(int i=0;i<m;i++)
    {
        for(int j=1;j<n;j++)
        {
                vertical[j][i]+=vertical[j-1][i];
        }
    }
    int StoreSize=store.size();
    int posSIZE=pos.size();
    for(int i=0;i<pos.size();i++)
    {
        int X=pos[i].first;
        int Y=pos[i].second;
        if(horizontal[X][Y]<=0 && vertical[X][Y]<=0)
        {
            pf("-1\n");
            return 0;
        }
    }
    pf("%d\n",StoreSize);
    for(int i=0;i<StoreSize;i++)
        pf("%d %d %d\n",store[i].first+1,store[i].second+1,stars[store[i].first][store[i].second]);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=100010;
char s[N];

int main(){
	scanf("%s",s);
	int cnt=0;
	bool flag=0;
	bool flag2=0;
	int l=strlen(s);

	for(int i=0;i<l;i++){
		if(s[i]=='a'){
			cnt++;
			if(flag2){
				break;
			}
			if(flag){
				flag=0;
				continue;
			}
			flag=1;
				continue;
		}
		if(!flag||cnt==1){
			s[i]--;
			flag2=1;
		}
		if(cnt==2&&flag){
			break;
		}

	}

	if(cnt==l){
		s[l-1]='z';
	}

	printf("%s\n",s);
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=100010;
char s[N];
int p[N];
int main(){
	scanf("%s",s);
	int cnt=0;
	int l=strlen(s);
	p[0]=-1;p[1]=l;
	for(int i=0;i<l;i++){
		if(s[i]=='a'){
			p[cnt++]=i;
			continue;
		}
	}
	if(cnt==l){
		s[l-1]='z';
	}
	else{
		for(int i=p[0]+1;i<p[1];i++){
			s[i]--;
		}
	}

	printf("%s\n",s);
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=100010;
char s[N];

int main(){
	scanf("%s",s);
	int cnt=0;
	bool flag2=0;
	int l=strlen(s);
	for(int i=0;i<l;i++){
		if(s[i]=='a'){
			if(flag2) break;

		}
		else{
			s[i]--;
			flag2=1;
		}
	}

	printf("%s\n",s);
}


#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
using namespace std;

int main()
{
    char s[100000];
    gets(s);
    int i,j,l;
    l=strlen(s);
    for(i=0;i<l;i++){
		if(s[i]!='a'){
			for(j=i;j<l;j++){
				if(s[j]=='a') break;
				s[j]--;
			}
			break;
		}
	}
	cout<<s<<endl;
    return 0;
}


#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
using namespace std;

int main()
{
    char s[100000];
    gets(s);
    int i,l;
    l=strlen(s);
    for(i=0;i<l;i++){
        if(s[i]=='a') s[i]='z';
        else s[i]=s[i]-1;
    }
    printf("%s\n",s);
    return 0;
}


#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
using namespace std;

int main()
{
    char s[100000];
    gets(s);
    int i,j,l;
    l=strlen(s);
    for(i=0;i<l;i++){
        if(s[i]!='a'){
            for(j=i;j<l;j++){
                if(s[j]=='a'){
                    break;
                }
                s[j]--;
            }
        }
    }
    printf("%s\n",s);
    return 0;
}


#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
using namespace std;

int main()
{
    char s[100000];
    gets(s);
    int i,j,l;
    l=strlen(s);
    for(i=0;i<l;i++){
		if(s[i]!='a'){
			for(j=i;j<l;j++){
				if(s[j]=='a') break;
				s[j]--;
			}
			break;
		}
		if(i==l-1) s[i]='z';
	}
	cout<<s<<endl;
    return 0;
}


#include<cstdio>
char num[100010];
int main()
{
	scanf("%s",num);
	int be=0;
	int done=0;
	if(num[1]=='\0')
		if(num[0]>'a')
		printf("%c",num[0]-1);
		else
		printf("z");
		else
	for(int i=0;num[i];i++){
		if(num[i]=='a'){
			printf("a");
			if(be)
				done=1;
		}else{
			if(done){
				printf("%c",num[i]);
			}else{
				if(!be){
					be=1;
					printf("%c",num[i]-1);
				}else{
					printf("%c",num[i]-1);
				}
			}
		}
	}
	puts("");
	return 0;
}


#include<cstdio>
char num[100010];
int main()
{
	scanf("%s",num);
	int be=0;
	int done=0;
	for(int i=0;num[i];i++){
		if(num[i]=='a'){
			printf("a");
			if(be)
				done=1;
		}else{
			if(done){
				printf("%c",num[i]);
			}else{
				if(!be){
					be=1;
					printf("%c",num[i]-1);
				}else{
					printf("%c",num[i]-1);
				}
			}
		}
	}
	puts("");
	return 0;
}


#include<cstdio>
#include<cstring>
char num[100010];
int main()
{
	scanf("%s",num);
	int be=0;
	int done=0;
	int len=strlen(num);
	for(int i=0;i<len-1;i++){
		if(num[i]=='a'){
			printf("a");
			if(be)
				done=1;
		}else{
			if(done){
				printf("%c",num[i]);
			}else{
				if(!be){
					be=1;
					printf("%c",num[i]-1);
				}else{
					printf("%c",num[i]-1);
				}
			}
		}
	}
	if(be==0){
		if(num[len-1]=='a')
			printf("z");
		else
			printf("%c",num[len-1]-1);
	}else{
		if(done==1)
			printf("%c",num[len-1]);
		else
		if(num[len-1]!='a')
			printf("%c",num[len-1]-1);
			else
				printf("z");
	}
	puts("");
	return 0;
}


#include<cstdio>
#include<cstring>
char num[100010];
int main()
{
	scanf("%s",num);
	int be=0;
	int done=0;
	int len=strlen(num);
	for(int i=0;i<len-1;i++){
		if(num[i]=='a'){
			printf("a");
			if(be)
				done=1;
		}else{
			if(done){
				printf("%c",num[i]);
			}else{
				if(!be){
					be=1;
					printf("%c",num[i]-1);
				}else{
					printf("%c",num[i]-1);
				}
			}
		}
	}
	if(be==0){
		if(num[len-1]=='a')
			printf("z");
		else
			printf("%c",num[len-1]-1);
	}else{
		if(done==1)
			printf("%c",num[len-1]);
		else
		if(num[len-1]!='a')
			printf("%c",num[len-1]-1);
			else
				printf("a");
	}
	puts("");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
   string s;
   cin>>s;
   ll n;
   n=s.length();
  int f=-1,e;
   for(int i=0;i<n;i++)
   {
    if(s[i]=='a')
      {
        f=i;break;}
   }
   e=-1;
   if(f==0)
   {
   for(int j=f+1;j<n;j++)
   {
    if(s[j]=='a')
      {e=j;break;}
   }
   }
   //cout<<f<<endl;
   if(f==-1)
   {
     for(int i=0;i<n;i++)
     {
      s[i]=s[i]-1;
     }
     cout<<s<<endl;
   }
   else
    if(f==0)
   {
      for(int i=f+1;i<e;i++)
        s[i]=s[i]-1;
      cout<<s<<endl;
   }
   else
   {
    for(int i=0;i<f;i++)
      s[i]=s[i]-1;
    cout<<s<<endl;
   }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
   string s;
   cin>>s;
   ll n,cnt=0;
   n=s.length();
  int f=-1,e;
  for(int i=0;i<n;i++)
  {
    if(s[i]=='a')
      cnt++;
  }
  if(cnt==n)
  {
    s[n-1]='z';
    cout<<s<<endl;
  }
  else
   {for(int i=0;i<n;i++)
   {
    if(s[i]=='a')
      {
        f=i;break;}
   }
   e=-1;
   if(f==0)
   {
   for(int j=f+1;j<n;j++)
   {
    if(s[j]=='a')
      {e=j;break;}
   }
  }
   cout<<f<<" "<<e<<endl;
   if(f==-1)
   {
     for(int i=0;i<n;i++)
     {
      s[i]=s[i]-1;
     }
     cout<<s<<endl;
   }
   else
  if(f==0&&e>0)
   {
      for(int i=f+1;i<e;i++)
        s[i]=s[i]-1;
      cout<<s<<endl;
   }
   else
    if(f==0&&e==-1)
    {
      for(int i=f+1;i<n;i++)
      {
        s[i]=s[i]-1;
      }
      cout<<s<<endl;
    }
    else
   {
    for(int i=0;i<f;i++)
      s[i]=s[i]-1;
    cout<<s<<endl;
   }
 }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
   string s;
   cin>>s;
   ll n,cnt=0;
   n=s.length();
  int f=-1,e;
  for(int i=0;i<n;i++)
  {
    if(s[i]=='a')
      cnt++;
  }
  if(cnt==n)
  {
    s[n-1]='z';
    cout<<s<<endl;
  }
  else
   {for(int i=0;i<n;i++)
   {
    if(s[i]=='a')
      {
        f=i;break;}
   }
   e=-1;
   if(f==0)
   {
   for(int j=f+1;j<n;j++)
   {
    if(s[j]=='a')
      {e=j;break;}
   }
  }
   //cout<<f<<" "<<e<<endl;
   if(f==-1)
   {
     for(int i=0;i<n;i++)
     {
      s[i]=s[i]-1;
     }
     cout<<s<<endl;
   }
   else
  if(f==0&&e>0)
   {
      for(int i=f+1;i<e;i++)
        s[i]=s[i]-1;
      cout<<s<<endl;
   }
   else
    if(f==0&&e==-1)
    {
      for(int i=f+1;i<n;i++)
      {
        s[i]=s[i]-1;
      }
      cout<<s<<endl;
    }
    else
   {
    for(int i=0;i<f;i++)
      s[i]=s[i]-1;
    cout<<s<<endl;
   }
 }
return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
   string s;
   cin>>s;
   ll n,cnt=0,f,e;
   n=s.length();
   vector<int> v;
   for(int i=0;i<n;i++)
   {
    if(s[i]=='a')
      v.push_back(i);
   }
   if(v.size()==n)
   {
    s[n-1]='z';
    cout<<s<<endl;
  }
  else
  if(v.empty())
  {
    for(int i=0;i<n;i++)
      s[i]=s[i]-1;
    cout<<s<<endl;
  }
  else
   if(v[0]!=0)
  {
    for(int i=0;i<v[0];i++)
      s[i]=s[i]-1;
    cout<<s<<endl;
  }
  else
    if(v[0]==0)
  {
             f=-1;e=-1;
    for(int i=1;i<v.size();i++)
    {
         if(v[i]-v[i-1]>1)
            {
              f=v[i-1];
              e=v[i];
              break;
            }

    }
    if(f!=-1&&e!=-1)
    {for(int i=f+1;i<e;i++)
      s[i]=s[i]-1;
    cout<<s<<endl;}
    else
    {
      for(int i=v[v.size()-1]+1;i<n;i++)
        s[i]=s[i]-1;
      cout<<s<<endl;
    }
  }
  return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <stack>
#include <cctype>
#include <cmath>
#include <vector>
#include <sstream>
#include <bitset>
#include <deque>
#include <iomanip>
using namespace std;
#define pr(x) cout << "x = " << x << endl;
#define bug cout << "bugbug" << endl;
#define ppr(x, y) printf("(%d, %d)\n", x, y);
#define pfun(a, b) printf("x = %d   f(x) = %d\n", a, b);

typedef long long ll;
typedef pair<int, int> P;
typedef unsigned int uint;
const int MOD = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e5 + 4;
const int maxm = 1e3 + 4;
char s[maxn];
int main(){
//�����������ܽ�
	ios::sync_with_stdio(false);
	int ik, i, j, k, kase;
	cin >> s+1;
	bool flag1 = false, flag2 = false;
	int len = strlen(s+1);
	for (i = 1; s[i]; ++i){
		if (i == len && flag1 = false) cout << 'z';
		else if (flag2) cout << s[i];
		else if (flag1){
			if (s[i] == 'a'){
				cout << 'a';
				flag2 = true;
			}else cout << char(s[i] - 1);
		}else if (s[i] == 'a') cout << 'a';
		else{
			flag1 = true;
			cout << char(s[i] - 1);
		}
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <stack>
#include <cctype>
#include <cmath>
#include <vector>
#include <sstream>
#include <bitset>
#include <deque>
#include <iomanip>
using namespace std;
#define pr(x) cout << "x = " << x << endl;
#define bug cout << "bugbug" << endl;
#define ppr(x, y) printf("(%d, %d)\n", x, y);
#define pfun(a, b) printf("x = %d   f(x) = %d\n", a, b);

typedef long long ll;
typedef pair<int, int> P;
typedef unsigned int uint;
const int MOD = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e5 + 4;
const int maxm = 1e3 + 4;
char s[maxn];
int main(){
//�����������ܽ�
	ios::sync_with_stdio(false);
	int ik, i, j, k, kase;
	cin >> s+1;
	bool flag1 = false, flag2 = false;
	int len = strlen(s+1);
	for (i = 1; s[i]; ++i){
		if (i == len && flag1 == false && s[i] == 'a') cout << 'z';
		else if (flag2) cout << s[i];
		else if (flag1){
			if (s[i] == 'a'){
				cout << 'a';
				flag2 = true;
			}else cout << char(s[i] - 1);
		}else if (s[i] == 'a') cout << 'a';
		else{
			flag1 = true;
			cout << char(s[i] - 1);
		}
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <stack>
#include <cctype>
#include <cmath>
#include <vector>
#include <sstream>
#include <bitset>
#include <deque>
#include <iomanip>
using namespace std;
#define pr(x) cout << "x = " << x << endl;
#define bug cout << "bugbug" << endl;
#define ppr(x, y) printf("(%d, %d)\n", x, y);
#define pfun(a, b) printf("x = %d   f(x) = %d\n", a, b);

typedef long long ll;
typedef pair<int, int> P;
typedef unsigned int uint;
const int MOD = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e5 + 4;
const int maxm = 1e3 + 4;
char s[maxn];
int main(){
//�����������ܽ�
	ios::sync_with_stdio(false);
	int ik, i, j, k, kase;
	cin >> s+1;
	for (i = 1; s[i]; ++i){
		if (s[i] == 'a') cout << 'a';
		else cout << char(s[i] - 1);
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <stack>
#include <cctype>
#include <cmath>
#include <vector>
#include <sstream>
#include <bitset>
#include <deque>
#include <iomanip>
using namespace std;
#define pr(x) cout << "x = " << x << endl;
#define bug cout << "bugbug" << endl;
#define ppr(x, y) printf("(%d, %d)\n", x, y);
#define pfun(a, b) printf("x = %d   f(x) = %d\n", a, b);

typedef long long ll;
typedef pair<int, int> P;
typedef unsigned int uint;
const int MOD = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e5 + 4;
const int maxm = 1e3 + 4;
char s[maxn];
int main(){
//�����������ܽ�
	ios::sync_with_stdio(false);
	int ik, i, j, k, kase;
	cin >> s+1;
	bool flag1 = false, flag2 = false;
	for (i = 1; s[i]; ++i){
		if (flag2) cout << s[i];
		else if (flag1){
			if (s[i] == 'a'){
				cout << 'a';
				flag2 = true;
			}else cout << char(s[i] - 1);
		}else if (s[i] == 'a') cout << 'a';
		else{
			flag1 = true;
			cout << char(s[i] - 1);
		}
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <stack>
#include <cctype>
#include <cmath>
#include <vector>
#include <sstream>
#include <bitset>
#include <deque>
#include <iomanip>
using namespace std;
#define pr(x) cout << "x = " << x << endl;
#define bug cout << "bugbug" << endl;
#define ppr(x, y) printf("(%d, %d)\n", x, y);
#define pfun(a, b) printf("x = %d   f(x) = %d\n", a, b);

typedef long long ll;
typedef pair<int, int> P;
typedef unsigned int uint;
const int MOD = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e5 + 4;
const int maxm = 1e3 + 4;
char s[maxn];
int main(){
//�����������ܽ�
	ios::sync_with_stdio(false);
	int ik, i, j, k, kase;
	cin >> s+1;
	bool flag1 = false, flag2 = false;
	int len = strlen(s+1);
	for (i = 1; s[i]; ++i){
		if (i == len && flag1 == false && a[i] == 'a') cout << 'z';
		else if (flag2) cout << s[i];
		else if (flag1){
			if (s[i] == 'a'){
				cout << 'a';
				flag2 = true;
			}else cout << char(s[i] - 1);
		}else if (s[i] == 'a') cout << 'a';
		else{
			flag1 = true;
			cout << char(s[i] - 1);
		}
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <stack>
#include <cctype>
#include <cmath>
#include <vector>
#include <sstream>
#include <bitset>
#include <deque>
#include <iomanip>
using namespace std;
#define pr(x) cout << "x = " << x << endl;
#define bug cout << "bugbug" << endl;
#define ppr(x, y) printf("(%d, %d)\n", x, y);
#define pfun(a, b) printf("x = %d   f(x) = %d\n", a, b);

typedef long long ll;
typedef pair<int, int> P;
typedef unsigned int uint;
const int MOD = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e5 + 4;
const int maxm = 1e3 + 4;
char s[maxn];
int main(){
//�����������ܽ�
	ios::sync_with_stdio(false);
	int ik, i, j, k, kase;
	cin >> s+1;
	bool flag1 = false, flag2 = false;
	int len = strlen(s+1);
	for (i = 1; s[i]; ++i){
		if (i == len && flag1 == false) cout << 'z';
		else if (flag2) cout << s[i];
		else if (flag1){
			if (s[i] == 'a'){
				cout << 'a';
				flag2 = true;
			}else cout << char(s[i] - 1);
		}else if (s[i] == 'a') cout << 'a';
		else{
			flag1 = true;
			cout << char(s[i] - 1);
		}
	}
	cout << endl;
	return 0;
}


#include<bits/stdc++.h>
#define f(i,l,r) for(i=l;i<r;i++)
#define fr(i,r,l) for(i=r;i>l;i--)
#define s(n) scanf("%lld",&n)
#define pl(n) printf("%lld\n",n)
#define ss(s) scanf("%s",s);
#define sz size()
#define ll long long int
#define pb push_back
#define mp make_pair
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector< pll >
#define F first
#define S second
#define mod 1000000007
#define maxa 1000005
#define maxv 100000000000000009
#define pi 3.14159265358979323846
#define all(v) v.begin() , v.end()
using namespace std;
#include "debug.h"
#define PLD(vale) cout << fixed; cout.precision(20); cout << vale <<"\n"
ll prod(ll a,ll b){ ll x,d;if(b==0)return 1;
    else{d=prod(a,b/2);x=(d*d)%mod;if(b%2==0)return x;
        else return (x*(a%mod))%mod;}
}
int main(){
    char s[100005],k;
    ll j,i,l,left,right;
    ss(s);
    l = strlen(s);
    left  =-1;
    right = -1;
   ll ans = -1;
   ll ansl;
   ll ansr;
   ll cnt = 0;
    f(i,0,l){
        if(s[i] != 'a'){
            if(left == -1)
               left  = i;
        }
        else{
            if(left != -1){
                right = i;
                break;
            }
        }
    }
    if(cnt > ans){
        ansl = left;
        ansr = i;
        ans = cnt;
    }
    f(i,0,ansl){
        cout << s[i];
    }
    f(i,ansl,ansr)
    {
        j  =s[i] - 'a';
        j--;
        k = j + 'a';
        printf("%c",k);
    }
    f(i,ansr,l)
        cout << s[i];
    cout << endl;
    return 0;
}


#include<bits/stdc++.h>
#define f(i,l,r) for(i=l;i<r;i++)
#define fr(i,r,l) for(i=r;i>l;i--)
#define s(n) scanf("%lld",&n)
#define pl(n) printf("%lld\n",n)
#define ss(s) scanf("%s",s);
#define sz size()
#define ll long long int
#define pb push_back
#define mp make_pair
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector< pll >
#define F first
#define S second
#define mod 1000000007
#define maxa 1000005
#define maxv 100000000000000009
#define pi 3.14159265358979323846
#define all(v) v.begin() , v.end()
using namespace std;
#include "debug.h"
#define PLD(vale) cout << fixed; cout.precision(20); cout << vale <<"\n"
ll prod(ll a,ll b){ ll x,d;if(b==0)return 1;
    else{d=prod(a,b/2);x=(d*d)%mod;if(b%2==0)return x;
        else return (x*(a%mod))%mod;}
}
int main(){
    char s[100005],k;
    ll j,i,l,left,right;
    ss(s);
    l = strlen(s);
    left  =-1;
    right = -1;
   ll ans = -1;
   ll ansl;
   ll ansr;
   ll cnt = 0;
    f(i,0,l){
        if(s[i] != 'a'){
            if(left == -1)
               left  = i;
        }
        else{
            if(left != -1){
                right = i;
                break;
            }
        }
    }
    if(right == -1 && left != -1)
        right = l;
    if(left == -1){
        f(i,0,l-1)
            cout << "a";
        cout << "z\n";
        return 0;
    }
    f(i,0,left){
        cout << s[i];
    }
    f(i,left,right)
    {
        j  =s[i] - 'a';
        j--;
        k = j + 'a';
        printf("%c",k);
    }
    f(i,right,l)
        cout << s[i];
    cout << endl;
    return 0;
}


#include<bits/stdc++.h>
#define f(i,l,r) for(i=l;i<r;i++)
#define fr(i,r,l) for(i=r;i>l;i--)
#define s(n) scanf("%lld",&n)
#define pl(n) printf("%lld\n",n)
#define ss(s) scanf("%s",s);
#define sz size()
#define ll long long int
#define pb push_back
#define mp make_pair
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector< pll >
#define F first
#define S second
#define mod 1000000007
#define maxa 1000005
#define maxv 100000000000000009
#define pi 3.14159265358979323846
#define all(v) v.begin() , v.end()
using namespace std;
//#include "debug.h"
#define PLD(vale) cout << fixed; cout.precision(20); cout << vale <<"\n"
ll prod(ll a,ll b){ ll x,d;if(b==0)return 1;
    else{d=prod(a,b/2);x=(d*d)%mod;if(b%2==0)return x;
        else return (x*(a%mod))%mod;}
}
int main(){
    char s[100005],k;
    ll j,i,l,left,right;
    ss(s);
    l = strlen(s);
    left  =-1;
    right = -1;
   ll ans = -1;
   ll ansl;
   ll ansr;
   ll cnt = 0;
    f(i,0,l){
        if(s[i] != 'a'){
            if(left == -1)
               left  = i;
        }
        else{
            if(left != -1){
                right = i;
                break;
            }
        }
    }
    if(cnt > ans){
        ansl = left;
        ansr = i;
        ans = cnt;
    }
    f(i,0,ansl){
        cout << s[i];
    }
    f(i,ansl,ansr)
    {
        j  =s[i] - 'a';
        j--;
        k = j + 'a';
        printf("%c",k);
    }
    f(i,ansr,l)
        cout << s[i];
    cout << endl;
    return 0;
}


#include<bits/stdc++.h>
#define f(i,l,r) for(i=l;i<r;i++)
#define fr(i,r,l) for(i=r;i>l;i--)
#define s(n) scanf("%lld",&n)
#define pl(n) printf("%lld\n",n)
#define ss(s) scanf("%s",s);
#define sz size()
#define ll long long int
#define pb push_back
#define mp make_pair
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector< pll >
#define F first
#define S second
#define mod 1000000007
#define maxa 1000005
#define maxv 100000000000000009
#define pi 3.14159265358979323846
#define all(v) v.begin() , v.end()
using namespace std;
//#include "debug.h"
#define PLD(vale) cout << fixed; cout.precision(20); cout << vale <<"\n"
ll prod(ll a,ll b){ ll x,d;if(b==0)return 1;
    else{d=prod(a,b/2);x=(d*d)%mod;if(b%2==0)return x;
        else return (x*(a%mod))%mod;}
}
int main(){
    char s[100005],k;
    ll j,i,l,left,right;
    ss(s);
    l = strlen(s);
    left  =-1;
    right = -1;
   ll ans = -1;
   ll ansl;
   ll ansr;
   ll cnt = 0;
    f(i,0,l){
        if(s[i] != 'a'){
            if(left == -1)
               left  = i;
        }
        else{
            if(left != -1){
                right = i;
                break;
            }
        }
    }
    if(left == -1){
        printf("%s\n",s);
        return 0;
    }
    if(cnt > ans){
        ansl = left;
        ansr = i;
        ans = cnt;
    }
    f(i,0,ansl){
        cout << s[i];
    }
    f(i,ansl,ansr)
    {
        j  =s[i] - 'a';
        j--;
        k = j + 'a';
        printf("%c",k);
    }
    f(i,ansr,l)
        cout << s[i];
    cout << endl;
    return 0;
}


#include<bits/stdc++.h>
#define f(i,l,r) for(i=l;i<r;i++)
#define fr(i,r,l) for(i=r;i>l;i--)
#define s(n) scanf("%lld",&n)
#define pl(n) printf("%lld\n",n)
#define ss(s) scanf("%s",s);
#define sz size()
#define ll long long int
#define pb push_back
#define mp make_pair
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector< pll >
#define F first
#define S second
#define mod 1000000007
#define maxa 1000005
#define maxv 100000000000000009
#define pi 3.14159265358979323846
#define all(v) v.begin() , v.end()
using namespace std;
//#include "debug.h"
#define PLD(vale) cout << fixed; cout.precision(20); cout << vale <<"\n"
ll prod(ll a,ll b){ ll x,d;if(b==0)return 1;
    else{d=prod(a,b/2);x=(d*d)%mod;if(b%2==0)return x;
        else return (x*(a%mod))%mod;}
}
int main(){
    char s[100005],k;
    ll j,i,l,left,right;
    ss(s);
    l = strlen(s);
    left  =-1;
    right = -1;
   ll ans = -1;
   ll ansl;
   ll ansr;
   ll cnt = 0;
    f(i,0,l){
        if(s[i] != 'a'){
            if(left == -1)
               left  = i;
        }
        else{
            if(left != -1){
                right = i;
                break;
            }
        }
    }
    if(right == -1 && left != -1)
        right = l;
    if(left == -1){
        f(i,0,l-1)
            cout << "a";
        cout << "z\n";
        return 0;
    }
    f(i,0,left){
        cout << s[i];
    }
    f(i,left,right)
    {
        j  =s[i] - 'a';
        j--;
        k = j + 'a';
        printf("%c",k);
    }
    f(i,right,l)
        cout << s[i];
    cout << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define max 1000005
#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(inti=1;i<n;i++)
ll dp[max]={},a[max]={};

int main() {
	// your code goes here
string s;
cin>>s;
int l=s.length();
int f=s[0],r=0;
int d=-1;
if(f!=97)
{
	f--;
	s[0]=f;
	r++;
}
for(int i=1;i<l;i++)
{
	int p=s[i];
	p--;
	if(r>0)
	{
		if(p==96)
		break;
		else
		{
			r++;
			s[i]=p;
		}
	}
	else
	{
		if(p==96)
		{
			d=i;
		}
		else
		{r++;
		s[i]=p;
		}
	}
}
if(r<=0)
{
	int p=s[d];
	p=122;
	s[d]=p;
}
cout<<s<<endl;

//cout<<s<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define max 1000005
#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(inti=1;i<n;i++)
ll dp[max]={},a[max]={};

int main() {
	// your code goes here
string s;
cin>>s;
int l=s.length();
int f=s[0],r=0;
int d=-1;
if(f!=97)
{
	f--;
	s[0]=f;
	r++;
}
for(int i=1;i<l;i++)
{
	int p=s[i];
	p--;
	if(p==96)
	{
		if(r>0)
		break;
		else
		d=i;

	}
	else
		{
			r++;
			s[i]=p;
		}

}
if(r<=0)
{
	int p=s[d];
	p=122;
	s[d]=p;
}
cout<<s<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define max 1000005
#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(inti=1;i<n;i++)
ll dp[max]={},a[max]={};

int main() {
	// your code goes here
string s;
cin>>s;
int l=s.length();
int f=s[0],r=0;
int d=-1;
if(f!=97)
{
	f--;
	s[0]=f;
	r++;
}
for(int i=1;i<l;i++)
{
	int p=s[i];
	p--;
	if(p==96)
	{
		if(r>0)
		break;
		else
		d=i;

	}
	else
		{
			r++;
			s[i]=p;
		}

}
if(r<=0)
{  if(d>=0)
	{int p=s[d];
	p=122;
	s[d]=p;}
}
cout<<s<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define max 1000005
#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(inti=1;i<n;i++)
ll dp[max]={},a[max]={};

int main() {
	// your code goes here
string s;
cin>>s;
int l=s.length();
int f=s[0],r=0;
int d=-1;
if(f!=97)
{
	f--;
	s[0]=f;
	r++;
}
else
d=0;
for(int i=1;i<l;i++)
{
	int p=s[i];
	p--;
	if(p==96)
	{
		if(r>0)
		break;
		else
		d=i;

	}
	else
		{
			r++;
			s[i]=p;
		}

}
if(r<=0)
{  if(d>=0)
	{int p=s[d];
	p=122;
	s[d]=p;}
}
cout<<s<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define max 1000005
#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(inti=1;i<n;i++)
ll dp[max]={},a[max]={};

int main() {
	// your code goes here
string s;
cin>>s;
int l=s.length();
for(int i=0;i<l;i++)
{
	int p=s[i];
	p--;
	if(p==96)
	p=122;
	s[i]=p;
}
cout<<s<<endl;

	return 0;
}


#include <iostream>
#include <vector>
#include <utility>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <algorithm>
#include <map>
#include <unordered_map>

using namespace std;

#define mp make_pair
#define pb push_back

int main(){
	string zbor;
	int n;
	bool run = true;

	cin>>zbor;

	n = zbor.size();
	for (int i=0; i<n; i++){
		if ((zbor[i] == 'a') && (run == false)){
			break;
		}
		else if ((zbor[i] != 'a')){
			run = false;
			int broj = zbor[i];
			zbor[i] = broj - 1;
		}
	}
	cout<<zbor;
    return 0;
}


#include <iostream>
#include <vector>
#include <utility>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <algorithm>
#include <map>
//#include <unordered_map>

using namespace std;

#define mp make_pair
#define pb push_back

int main(){
	string zbor;
	int n;
	bool run = true;

	cin>>zbor;

	n = zbor.size();
	for (int i=0; i<n; i++){
		if ((zbor[i] == 'a') && (run == false)){
			break;
		}
		else if ((zbor[i] != 'a')){
			run = false;
			int broj = zbor[i];
			zbor[i] = broj - 1;
		}
	}
	cout<<zbor;
    return 0;
}


#include <iostream>
#include <vector>
#include <utility>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <algorithm>
#include <map>
//#include <unordered_map>

using namespace std;

#define mp make_pair
#define pb push_back

int main(){
	string zbor;
	int n;
	bool run = true;

	cin>>zbor;

	n = zbor.size();
	for (int i=0; i<n; i++){
		if ((zbor[i] == 'a') && (run == false)){
			break;
		}
		else if ((zbor[i] != 'a')){
			run = false;
			int broj = zbor[i];
			zbor[i] = broj - 1;
		}
	}
	if (run == true){
        zbor[0] = 'z';
	}
	cout<<zbor;
    return 0;
}


#include <iostream>
#include <vector>
#include <utility>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <algorithm>
#include <map>
//#include <unordered_map>

using namespace std;

#define mp make_pair
#define pb push_back

int main(){
	string zbor;
	int n;
	bool run = true;

	cin>>zbor;

	n = zbor.size();
	for (int i=0; i<n; i++){
		if ((zbor[i] == 'a') && (run == false)){
			break;
		}
		else if ((zbor[i] != 'a')){
			run = false;
			int broj = zbor[i];
			zbor[i] = broj - 1;
		}
	}
	if (run == true){
        zbor[n-1] = 'z';
	}
	cout<<zbor;
    return 0;
}


#include <iostream>
using namespace std;
char s[100100];
char q[100100];
int main() {
	cin >> s;
	int i = 0;
	bool flag = true;
	while(s[i] && s[i] == 'a') {
		cout << s[i++];
	}
	while(s[i] && s[i] != 'a') {
		q[i] = (char)(s[i++] - 1);
		flag = false;
	}
	while(s[i])
		q[i] = s[i++];
	if(flag) {
		q[i-1] = 'z';
	}
	q[i] = 0;
	cout << q;
}


#include <iostream>
using namespace std;
char s[100100];
int main() {
	cin >> s;
	int i = 0;
	while(s[i] && s[i] == 'a')
		cout << s[i++];
	while(s[i] && s[i] != 'a')
		cout << (char)(s[i++] - 1);
	while(s[i])
		cout << s[i++];
}


#include <iostream>
using namespace std;
char s[100100];
int main() {
	cin >> s;
	for(int i = 0; s[i]; i ++) {
		cout << (char)('a' + (s[i] - 'a' + 1)%26);
	}
}


#include <iostream>
using namespace std;
char s[100100];
char q[100100];
int main() {
	cin >> s;
	int i = 0;
	while(s[i] && s[i] == 'a') {
		cout << s[i++];
	}
	while(s[i] && s[i] != 'a') {
		q[i] = (char)(s[i++] - 1);
		flag = false;
	}
	while(s[i])
		q[i] = s[i++];
	if(flag) {
		q[i-1] = 'z';
	}
	q[i] = 0;
	cout << q;
}


#include <iostream>
using namespace std;
char s[100100];
char q[100100];
int main() {
	cin >> s;
	int i = 0;
	bool flag = true;
	while(s[i] && s[i] == 'a') {
		q[i] = s[i++];
	}
	while(s[i] && s[i] != 'a') {
		q[i] = (char)(s[i++] - 1);
		flag = false;
	}
	while(s[i])
		q[i] = s[i++];
	if(flag) {
		q[i-1] = 'z';
	}
	q[i] = 0;
	cout << q;
}


#include <iostream>
using namespace std;
char s[100100];
int main() {
	cin >> s;
	for(int i = 0; s[i]; i ++) {
		cout << (char)('a' + (s[i] - 'a' - 1 + 26)%26);
	}
}


#include <iostream>
using namespace std;
char s[100100];
char q[100100];
int main() {
	cin >> s;
	int i = 0;
	bool flag = true;
	while(s[i] && s[i] == 'a') {
		q[i] = s[i];
		i ++;
	}
	while(s[i] && s[i] != 'a') {
		q[i] = (char)(s[i] - 1);
		i ++;
		flag = false;
	}
	while(s[i]) {
		q[i] = s[i];
		i ++;
	}
	if(flag) {
		q[i-1] = 'z';
	}
	q[i] = 0;
	cout << q;
}


#include<iostream>
#include<sstream>
#include<fstream>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<string.h>
#include<math.h>
#include<cassert>
#include<iomanip>
#include<utility>
#include<bitset>
#include<set>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<vector>
#include<functional>
#include<algorithm>
//#include<memory.h>
#include<assert.h>
#include<numeric>
#include<limits.h>
using namespace std;
int main()
{
	string s,ss;
	cin>>s;
	if(s=="a")
	{
		cout<<"z"<<endl;
		return 0;
	}
	int pos1=s.find('a');
	if(pos1==-1)
	{
		ss=s;
		for(int i=0;i<ss.length();i++)ss[i]--;
	}
	else if(pos1==0)
	{
		while(s[pos1]=='a')pos1++;
		int pos2=s.find('a',pos1);
		if(pos2==-1)pos2=s.length();
		ss=s;
		for(int i=pos1;i<pos2;i++)ss[i]--;
	}
	else
	{
		ss=s;
		for(int i=0;i<pos1;i++)ss[i]--;
	}
	cout<<ss<<endl;
	return 0;
}


#include<iostream>
#include<sstream>
#include<fstream>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<string.h>
#include<math.h>
#include<cassert>
#include<iomanip>
#include<utility>
#include<bitset>
#include<set>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<vector>
#include<functional>
#include<algorithm>
//#include<memory.h>
#include<assert.h>
#include<numeric>
#include<limits.h>
using namespace std;
int main()
{
	string s,ss;
	cin>>s;
	int pos1=s.find('a');
	if(pos1==-1)
	{
		ss=s;
		for(int i=0;i<ss.length();i++)ss[i]--;
	}
	else if(pos1==0)
	{
		int pos2=s.find('a',pos1+1);
		if(pos2==-1)pos2=s.length();
		ss=s;
		for(int i=pos1+1;i<pos2;i++)ss[i]--;
	}
	else
	{
		ss=s;
		for(int i=0;i<pos1;i++)ss[i]--;
	}
	cout<<ss<<endl;
	return 0;
}


#include<iostream>
#include<sstream>
#include<fstream>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<string.h>
#include<math.h>
#include<cassert>
#include<iomanip>
#include<utility>
#include<bitset>
#include<set>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<vector>
#include<functional>
#include<algorithm>
//#include<memory.h>
#include<assert.h>
#include<numeric>
#include<limits.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int len=s.length();
	int i=0;
	while(i<=len&&s[i]=='a')i++;
	if(i==len+1)
	{
		s[len]='z';
	}
	else
	{
		while(i<=len&&s[i]!='a')
		{
			s[i]--;
			i++;
		}
	}
	cout<<s<<endl;
	return 0;
}


#include<iostream>
#include<sstream>
#include<fstream>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<string.h>
#include<math.h>
#include<cassert>
#include<iomanip>
#include<utility>
#include<bitset>
#include<set>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<vector>
#include<functional>
#include<algorithm>
//#include<memory.h>
#include<assert.h>
#include<numeric>
#include<limits.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int len=s.length();
	int i=0;
	while(i<len&&s[i]=='a')i++;
	if(i==len)
	{
		s[len-1]='z';
	}
	else
	{
		while(i<len&&s[i]!='a')
		{
			s[i]--;
			i++;
		}
	}
	cout<<s<<endl;
	return 0;
}


#include<iostream>
#include<sstream>
#include<fstream>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<string.h>
#include<math.h>
#include<cassert>
#include<iomanip>
#include<utility>
#include<bitset>
#include<set>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<vector>
#include<functional>
#include<algorithm>
//#include<memory.h>
#include<assert.h>
#include<numeric>
#include<limits.h>
using namespace std;
int main()
{
	string s,ss;
	cin>>s;
	if(s=="a")
	{
		cout<<"z"<<endl;
		return 0;
	}
	int pos1=s.find('a');
	if(pos1==-1)
	{
		ss=s;
		for(int i=0;i<ss.length();i++)ss[i]--;
	}
	else if(pos1==0)
	{
		int pos2=s.find('a',pos1+1);
		if(pos2==-1)pos2=s.length();
		ss=s;
		for(int i=pos1+1;i<pos2;i++)ss[i]--;
	}
	else
	{
		ss=s;
		for(int i=0;i<pos1;i++)ss[i]--;
	}
	cout<<ss<<endl;
	return 0;
}


#include<iostream>
#include<math.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<sstream>

using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair

typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;

typedef vector<int> vint;

int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

int main (){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	tint a, b, n;
	string s;
	cin>>s;
	string dic="zabcdefghijklmnopqrstuvwxy";
	string res="";
	bool empece=false, termine=false;
	tint cantA=0;
	string otro="";
	forn(i, s.size()){
		if(i<s.size()-1)otro+="a";
		if(s[i]=='a'){
			cantA++;
		}
		if(termine){
			res=res+s[i];
			continue;
		}else{
			if (s[i]=='a' && empece){
				res=res+"a";
				termine=true;
			}else{
				if(s[i]!='a'){
					res=res+dic[(s[i]-'a')];
					empece=true;
				}else{
					res=res+"a";
				}
			}
		}
	}
	otro+="z";
	if(cantA==s.size()){
		cout<<otro<<endl;
		return 0;
	}else{
		cout<<res<<endl;
	}
}


#include<iostream>
#include<math.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<sstream>

using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair

typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;

typedef vector<int> vint;

int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

int main (){
	tint a, b, n;
	string s;
	cin>>s;
	string dic="zabcdefghijklmnopqrstuvwxy";
	string res="";
	bool empece=false, termine=false;
	forn(i, s.size()){
		if(termine){
			res=res+s[i];
			continue;
		}else{
			if (s[i]=='a' && empece){
				res=res+"a";
				termine=true;
			}else{
				if(s[i]!='a'){
					res=res+dic[(s[i]-'a')];
					empece=true;
				}else{
					res=res+"a";
				}
			}
		}
	}
	cout<<res<<endl;
}


#include<iostream>
#include<math.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<sstream>

using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair

typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;

typedef vector<int> vint;

int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

int main (){
	tint a, b, n;
	string s;
	cin>>s;
	string dic="zabcdefghijklmnopqrstuvwxy";
	string res="";
	bool empece=false, termine=false;
	tint cantA=0;
	string otro="";
	forn(i, s.size()){
		if(i<s.size()-1)otro+="a";
		if(s[i]=='a'){
			cantA++;
		}
		if(termine){
			res=res+s[i];
			continue;
		}else{
			if (s[i]=='a' && empece){
				res=res+"a";
				termine=true;
			}else{
				if(s[i]!='a'){
					res=res+dic[(s[i]-'a')];
					empece=true;
				}else{
					res=res+"a";
				}
			}
		}
	}
	otro+="z";
	if(cantA==s.size()){
		cout<<otro<<endl;
		return 0;
	}else{
		cout<<res<<endl;
	}
}


#include<iostream>
#include<math.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<sstream>

using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair

typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;

typedef vector<int> vint;

int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

int main (){
	tint a, b, n;
	string s;
	cin>>s;
	string dic="zabcdefghijklmnopqrstuvwxy";
	string res="";
	bool empece=false, termine=false;
	tint cantA=0;
	forn(i, s.size()){
		if(s[i]=='a'){
			cantA++;
		}
		if(termine){
			res=res+s[i];
			continue;
		}else{
			if (s[i]=='a' && empece){
				res=res+"a";
				termine=true;
			}else{
				if(s[i]!='a'){
					res=res+dic[(s[i]-'a')];
					empece=true;
				}else{
					res=res+"a";
				}
			}
		}
	}
	if(cantA==s.size()){
		string aaa="";
		forn(i, s.size()-1){
			aaa=aaa+"a";
		}
		aaa=aaa+"z";
		cout<<aaa<<endl;
		return 0;
	}else{
		cout<<res<<endl;
	}
}


#include<iostream>
#include<math.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<sstream>

using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair

typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;

typedef vector<int> vint;

int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

int main (){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	tint a, b, n;
	string s;
	cin>>s;
	string dic="zabcdefghijklmnopqrstuvwxy";
	string res="";
	bool empece=false, termine=false;
	tint cantA=0;
	string otro="";
	forn(i, s.size()){
		if(i<s.size()-1)otro+="a";
		if(s[i]=='a'){
			cantA++;
		}
		if(termine){
			break;
			//continue;
		}else{
			if (s[i]=='a' && empece){
				termine=true;
			}else{
				if(s[i]!='a'){
					s[i]=s[i]-1;
					empece=true;
				}
			}
		}
	}
	otro+="z";
	if(cantA==s.size()){
		cout<<otro<<endl;
		return 0;
	}else{
		cout<<s<<endl;
	}
}


#include<iostream>
#include<math.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<sstream>

using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair

typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;

typedef vector<int> vint;

int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

int main (){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	tint a, b, n;
	string s;
	cin>>s;
	string dic="zabcdefghijklmnopqrstuvwxy";
	string res="";
	bool empece=false, termine=false;
	tint cantA=0;
	string otro="";
	forn(i, s.size()){
		if(i<s.size()-1)otro+="a";
		if(s[i]=='a'){
			cantA++;
		}
		if(termine){
			//break;
			continue;
		}else{
			if (s[i]=='a' && empece){
				termine=true;
			}else{
				if(s[i]!='a'){
					s[i]=dic[s[i]-'a'];
					empece=true;
				}
			}
		}
	}
	otro+="z";
	if(cantA==s.size()){
		cout<<otro<<endl;
		return 0;
	}else{
		cout<<s<<endl;
	}
}


#include<iostream>
#include<math.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<sstream>

using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair

typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;

typedef vector<int> vint;

int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

int main (){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	tint a, b, n;
	string s;
	cin>>s;
	string dic="zabcdefghijklmnopqrstuvwxy";
	string res="";
	bool empece=false, termine=false;
	tint cantA=0;
	string otro="";
	forn(i, s.size()){
		if(i<s.size()-1)otro+="a";
		if(s[i]=='a'){
			cantA++;
		}
		if(termine){
			break;
			//continue;
		}else{
			if (s[i]=='a' && empece){
				termine=true;
			}else{
				if(s[i]!='a'){
					s[i]=dic[s[i]-'a'];
					empece=true;
				}
			}
		}
	}
	otro+="z";
	if(cantA==s.size()){
		cout<<otro<<endl;
		return 0;
	}else{
		cout<<s<<endl;
	}
}


#include<iostream>
#include<math.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<sstream>

using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair

typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;

typedef vector<int> vint;

int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

int main (){
	tint a, b, n;
	string s;
	cin>>s;
	string dic="zabcdefghijklmnopqrstuvwxy";
	string res="";
	bool empece=false;
	forn(i, s.size()){
		if (s[i]=='a' && empece){
			break;
		}else{
			if(s[i]!='a'){
				res=res+dic[(s[i]-'a')];
				empece=true;
			}else{
				res=res+"a";
			}
		}
	}
	res=res+s.substr(res.size(), s.size()-res.size());
	cout<<res<<endl;
}


#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>

using namespace std;

int main(void){
    string ch;
    cin >>ch;
    int x=0;
    while (x<ch.size() && ch[x]=='a'){
          printf("a");x++;
    }
    int flag=0;
    for (int i=x;i<=ch.size();i++){
        char c;
        c=ch[i]-1;
        if ('a'<ch[i] && ch[i]<='z') {
                      if (flag==0) cout << c; else cout <<ch[i];
        }
        if (ch[i]=='a') {
                        printf("a");flag++;
        }
    }
    printf("\n");
  //  system("pause");
}


#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>

using namespace std;

int main(void){
    string ch;
    cin >>ch;
    int x=0;
    while (x<ch.size()-1 && ch[x]=='a'){
          printf("a");x++;
    }
    int flag=0;
    if (x!=0) flag++;
    for (int i=x;i<=ch.size();i++){
        char c;
        c=ch[i]-1;
      //  printf("%d %d %d\n",flag,i,ch.size());
        if (flag==1 && i+1==ch.size()){
                    if ('a'<ch[i] && ch[i]<='z') cout <<c;
                    if (ch[i]=='a') printf("z\n");
                    return 0;
        }
        if ('a'<ch[i] && ch[i]<='z') {
                      if (flag<=2) {cout << c; flag=2;}else cout <<ch[i];
        }
        if (ch[i]=='a') {
                        printf("a");flag=3;
        }
    }
    printf("\n");
//    system("pause");
}


#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>

using namespace std;

int main(void){
    string ch;
    ch.clear();
    cin >>ch;
    int x=0;
    while (x<ch.size()-1 && ch[x]=='a'){
          printf("a");x++;
    }
    int flag=0;
    if (x!=0) flag++;
    for (int i=x;i<=ch.size();i++){
        char c;
        c=ch[i]-1;
      //  printf("%d %d %d\n",flag,i,ch.size());
        if (flag<=1 && i+1==ch.size()){
                    if ('a'<ch[i] && ch[i]<='z') cout <<c;
                    if (ch[i]=='a') printf("z\n");
                    return 0;
        }
        if ('a'<ch[i] && ch[i]<='z') {
                      if (flag<=2) {cout << c; flag=2;}else cout <<ch[i];
        }
        if (ch[i]=='a') {
                        printf("a");flag=3;
        }
    }
    printf("\n");
//    system("pause");
}


#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>

using namespace std;

int main(void){
    string ch;
    cin >>ch;
    int x=0;
    while (x<ch.size()-1 && ch[x]=='a'){
          printf("a");x++;
    }
    int flag=0;
    if (x!=0) flag++;
    for (int i=x;i<=ch.size();i++){
        char c;
        c=ch[i]-1;
      //  printf("%d %d %d\n",flag,i,ch.size());
        if (flag==1 && i+1==ch.size()){
                    if ('a'<ch[i] && ch[i]<='z') cout <<c;
                    if (ch[i]=='a') printf("z\n");
                    return 0;
        }
        if ('a'<ch[i] && ch[i]<='z') {
                      if (flag==1) cout << c; else cout <<ch[i];
        }
        if (ch[i]=='a') {
                        printf("a");flag++;
        }
    }
    printf("\n");
    //system("pause");
}


#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>

using namespace std;

int main(void){
    string ch;
    cin >>ch;
    int x=0;
    while (x<ch.size()-1 && ch[x]=='a'){
          printf("a");x++;
    }
    int flag=0;
    if (x!=0) flag++;
    for (int i=x;i<=ch.size();i++){
        char c;
        c=ch[i]-1;
      //  printf("%d %d %d\n",flag,i,ch.size());
        if (flag==1 && i+1==ch.size()){
                    if ('a'<ch[i] && ch[i]<='z') cout <<c;
                    if (ch[i]=='a') printf("z\n");
                    return 0;
        }
        if ('a'<ch[i] && ch[i]<='z') {
                      if (flag<=1) {cout << c; flag=1;}else cout <<ch[i];
        }
        if (ch[i]=='a') {
                        printf("a");flag=2;
        }
    }
    printf("\n");
    //system("pause");
}


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

char ch[100010];

int main()
{
	scanf("%s", ch);
	int len = strlen(ch);

	int start = 0;
	int end = 0;

	int flag1 = 0;
	int flag2 = 0;

	for (int i = 0;i < len;i++)
	{
		if (flag1==0&&ch[i] != 'a')
		{
			start = i;
			flag1 = 1;
		}

		if (flag2 == 0 &&flag1==1&& ch[i] == 'a')
		{
			end = i;
			flag2 = 1;
		}

	}

	if (flag1 == 0)
	{
		printf("%s\n", ch);
		return 0;
	}

	if (flag2 == 0)
	{
		for (int i = 0;i < len;i++)
			printf("%c", ch[i] - 1);
		printf("\n");
		return 0;
	}

	for(int i=0;i<start;i++)
		printf("%c", ch[i]);
	for (int i = start;i < end;i++)
		printf("%c", ch[i] - 1);

	for (int i = end;i<len;i++)
		printf("%c", ch[i]);

	printf("\n");

	return 0;
}


#include <cstdio>
char a[100005];
int main(int argc, char const *argv[])
{
	scanf("%s",a);
	int i=0,flag=0;
	while(a[i]!='\0')
	{
		if(a[i]>'a'){
			a[i]=a[i]-1;
			flag=1;
		}
		if(flag&&a[i]=='a') break;
		i++;
	}
	if(!flag&&i>1)
		a[i-1]='z';
	printf("%s\n",a);
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	char str[100000];
	int i;
	gets(str);
	for(i=0;i<strlen(str);i++)
	{
		if(str[i]!='a')
	    break;
    }
    for(int j=i;j<strlen(str);j++)
    {
    	if(str[j]=='a')
    	break;
    	str[j]--;
	}
	if(i==strlen(str))str[strlen(str)]='z';
	puts(str);
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	char str[100000];
	int i;
	gets(str);
	int len=strlen(str);
	for(i=0;i<len;i++)
	{
		if(str[i]!='a')
	    break;
    }
    for(int j=i;j<len;j++)
    {
    	if(str[j]=='a')
    	break;
    	str[j]--;
	}
	if(i==len)str[len-1]='z';
	puts(str);
	return 0;
}


#include<stdio.h>
#include<string.h>
#define Max 100005

int main(){
	char s[Max];
	scanf("%s",s);
	int n=strlen(s);
	int r=0,t=n,flag=0;
	for(int i=0;i<n;i++){
		if(s[i]!='a'&&flag==0){
			flag=1;
			r=i;
			//break;
		}
		if(s[i]=='a'&&flag){
			t=i;
			break;
		}
	}
	for(int j=r;j<t;j++){
		s[j]=s[j]-1;
	}
	printf("%s\n",s);
	return 0;
}


#include<stdio.h>
#include<string.h>
#define Max 100005

int main(){
	char s[Max];
	scanf("%s",s);
	int n=strlen(s);
	int flag=0;
	for(int i=0;i<n;i++){
		if(s[i]!='a'){
			flag=1;
			s[i]=s[i]-1;
		}
		if(s[i+1]=='a'&&flag==1){
			break;
		}
	}
	if(!flag)s[n-1]='z';
	printf("%s\n",s);
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	char str[100000];
	int flag=0;
	gets(str);
	for(int i=0;i<strlen(str);i++)
	{
		if(str[i]!='a')
	    {
		str[i]=str[i]-1,flag=1;
	    }
	    if(flag==1&&str[i]=='a')
	    break;
    }
    if(flag==0)
    {
    if(str[strlen(str)-1]!='a')
    str[strlen(str)-1]--;
    else
    str[strlen(str)-1]='z';

    }
	puts(str);
	return 0;
}


#include <cstdio>
char a[100005];
int main(int argc, char const *argv[])
{
	scanf("%s",a);
	int i=0,flag=0;
	while(a[i]!='\0')
	{
		if(a[i]>'a'){
			a[i]=a[i]-1;
			flag=1;
		}
		if(flag&&a[i]=='a') break;
		i++;
	}
	printf("%s\n",a);
	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
char s[100010];
int main(int argc, const char * argv[]) {
    cin>>s;
    int len=strlen(s),flag=0;
    for(int i=0;i<len;i++)
        if(s[i]!='a'){
            s[i]=s[i]-1;
            flag=1;
            continue;
        }
        else{
            if(flag==0)continue;
            else break;
        }
    if(flag==0)
        s[len-1]='z';
    for(int i=0;i<len;i++) printf("%c",s[i]);

    return 0;
}


#include<stdio.h>
int main()
{
    int i,len=0;
    char str[1000];
    gets(str);
   	for(i=0;str[i]!='\0';i++)
	{
		length++;
	}
    for(i=0;str[i]!='\0';i++)
        if(str[i]!='a')
            break;
    for(i=0;str[i]!='\0';i++)
    {
        if(str[i]=='a')
            break;
        str[i]--;
        len++;
    }
    if(len==0)
        str[len-1]='z';
    puts(str);
    return 0;
}


#include <cstdio>
char a[100005];
int main(int argc, char const *argv[])
{
	scanf("%s",a);
	int i=0,flag=0;
	while(a[i]!='\0')
	{
		if(a[i]>'a'){
			a[i]--;
			flag=1;
		}
		else if(flag&&a[i]=='a') break;
		i++;
	}
	if(!flag)
		a[i-1]='z';
	printf("%s\n",a);
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	char str[100000];
	int i;
	gets(str);
	for(i=0;i<strlen(str);i++)
	{
		if(str[i]!='a')
	    break;
    }
    for(int j=i;j<strlen(str);j++)
    {
    	if(str[j]=='a')
    	break;
    	str[j]--;
	}
	if(i==strlen(str))str[strlen(str)-1]='z';
	puts(str);
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	char str[100000];
	int flag=0;
	gets(str);
	for(int i=0;i<strlen(str);i++)
	{
		if(str[i]!='a')
	    {
		str[i]=str[i]-1,flag=1;
	    }
	    if(flag==1&&str[i]=='a')
	    break;
    }
    if(flag==0)
    {
    if(str[strlen(str)-1]!='a')
    str[strlen(str)-1]--;
    }
	puts(str);
	return 0;
}


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

char ch[100010];

int main()
{
	scanf("%s", ch);
	int len = strlen(ch);

	int start = 0;
	int end = 0;

	int flag1 = 0;
	int flag2 = 0;

	for (int i = 0;i < len;i++)
	{
		if (flag1==0&&ch[i] != 'a')
		{
			start = i;
			flag1 = 1;
		}

		if (flag2 == 0 &&flag1==1&& ch[i] == 'a')
		{
			end = i;
			flag2 = 1;
		}

	}

	if (flag1 == 0)
	{
		for (int i = 0;i < len-1;i++)
			printf("%c", ch[i]);
		printf("z");
		printf("\n");

		return 0;
	}

	if (flag2 == 0)
	{
		for (int i = 0;i < start;i++)
			printf("%c", ch[i]);
		for (int i = start;i < len;i++)
			printf("%c", ch[i] - 1);

		printf("\n");
		return 0;
	}

	for(int i=0;i<start;i++)
		printf("%c", ch[i]);
	for (int i = start;i < end;i++)
		printf("%c", ch[i] - 1);

	for (int i = end;i<len;i++)
		printf("%c", ch[i]);

	printf("\n");

	return 0;
}


#include<stdio.h>
int main()
{
    int i,len=0;
    char str[1000];
    gets(str);
   	for(i=0;str[i]!='\0';i++)
	{
		length++;
	}
    for(i=0;str[i]!='\0';i++)
        if(str[i]!='a')
            break;
    for(i=0;str[i]!='\0';i++)
    {
        if(str[i]=='a')
            break;
        str[i]--;
        len++;
    }
    if(len==0)
        str[length-1]='z';
    puts(str);
    return 0;
}


#include<stdio.h>
int main()
{
	int len=0,length=0,i;
	char str[1000];
	gets(str);
	for(i=0;str[i]!='\0';i++)
	{
		length++;
	}
	for(i=0;str[i]!='\0';i++)
	{
		if(str[i]=='a')
		{
			len++;
		}
	}
	if(len==length)
	{
		str[len-1]='z';
	}
	else
	{
		for(i=0;str[i]!='\0';i++)
		{
			if(str[i]!='a')
			str[i]--;
		}
	}
	puts(str);
}


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

char ch[100010];

int main()
{
	scanf("%s", ch);
	int len = strlen(ch);

	int start = 0;
	int end = 0;

	int flag1 = 0;
	int flag2 = 0;

	for (int i = 0;i < len;i++)
	{
		if (flag1==0&&ch[i] != 'a')
		{
			start = i;
			flag1 = 1;
		}

		if (flag2 == 0 &&flag1==1&& ch[i] == 'a')
		{
			end = i;
			flag2 = 1;
		}

	}

	if (flag1 == 0)
	{
		for (int i = 0;i < len-1;i++)
			printf("%c", ch[i]);
		printf("z");

		return 0;
	}

	if (flag2 == 0)
	{
		for (int i = 0;i < len;i++)
			printf("%c", ch[i] - 1);
		printf("\n");
		return 0;
	}

	for(int i=0;i<start;i++)
		printf("%c", ch[i]);
	for (int i = start;i < end;i++)
		printf("%c", ch[i] - 1);

	for (int i = end;i<len;i++)
		printf("%c", ch[i]);

	printf("\n");

	return 0;
}


#include<stdio.h>
#include<string.h>
#define Max 100005

int main(){
	char s[Max];
	scanf("%s",s);
	int n=strlen(s);
	int flag=0;
	for(int i=0;i<n;i++){
		if(s[i]!='a'){
			flag=1;
			s[i]=s[i]-1;
		}
		if(s[i+1]=='a'&&flag==1){
			break;
		}
	}
	printf("%s\n",s);
	return 0;
}


#include <cstdio>
char a[100005];
int main(int argc, char const *argv[])
{
	scanf("%s",a);
	int i=0,flag=0;
	while(a[i]!='\0')
	{
		if(a[i]>'a'){
			a[i]=a[i]-1;
			flag=1;
		}
		if(flag&&a[i]=='a') break;
		i++;
	}
	if(!flag)
		a[i-1]='z';
	printf("%s\n",a);
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	char str[100000];
	int i;
	gets(str);
	for(i=0;i<strlen(str);i++)
	{
		if(str[i]!='a')
	    break;
    }
    for(int j=i;j<strlen(str);j++)
    {
    	if(str[j]=='a')
    	break;
    	str[j]--;
	}
	if(i==strlen(str))str[strlen(str)]='z';
	puts(str);
	return 0;
}


#include <cstdio>
#include <cstring>
char a[100010];
int main(){
    scanf("%s",a);
    int flag=0;
    int len=strlen(a);
    for(int i=0;i<len;i++){
        if(flag==0 && a[i]!='a')flag=1;
        if(flag==1){
            if(a[i]!='a')a[i]--;
            else flag=2;
        }
    }
    printf("%s",a);
    scanf("%d",&len);
    return 0;
}


#include<iostream>
using namespace std;
int main(){
	string s;
	cin>>s;
	int i=0;
	if(s[0]=='a'){
		i++;
	}
	while(s[i]!='a'&&s[i]!='\0'){
		int ch=s[i];
		ch--;
		s[i]=ch;
		i++;
	}
	cout<<s;
	return 0;
}


#include<iostream>
using namespace std;
int main(){
	string s;
	cin>>s;
	int i=0;
	int flag=0;
	while(s[i]!='\0'){
		if(s[i]!='a'){
			flag=1;
			int ch=s[i];
			ch--;
			s[i]=ch;
			i++;
		}
		if(s[i]=='a'){
			if(flag==0){
				i++;
			}
			else{
				break;
			}
		}
	}
	cout<<s;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int x1[n],y1[n],x2[n],y2[n];
	for (int i=0;i<n;i++)
	{
		cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
	}

	cout<<"YES"<<endl;
	for (int i=0;i<n;i++)
	{
		int ans=0;
		if (x2[i]%2)
			ans+=1;
		if (y1[i]%2)
			ans+=2;
		cout<<ans+1<<"\n";
	}

    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int x1[n],y1[n],x2[n],y2[n];
	for (int i=0;i<n;i++)
	{
		cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
	}

	cout<<"YES"<<endl;
	for (int i=0;i<n;i++)
	{
		int ans=0;
		if (x1[i]%2)
			ans+=1;
		if (y1[i]%2)
			ans+=2;
		cout<<ans+1<<"\n";
	}

    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int x1[n],y1[n],x2[n],y2[n];
	for (int i=0;i<n;i++)
	{
		cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
	}

	cout<<"YES"<<endl;
	for (int i=0;i<n;i++)
	{
		int ans=0;
		if (x2[i]%2)
			ans+=1;
		if (y2[i]%2)
			ans+=2;
		cout<<ans+1<<"\n";
	}

    return 0;
}


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

int main()
{
    puts("YES");
    int n, x1, y1, x2, y2;
    scanf("%d", &n);
    while(n--)
    {
        scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
        printf("%d\n", (x1 % 2 + 2) % 2 + 2 * ((y1 % 2 + 2) % 2) + 1);
    }
    return 0;
}


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

int main() {
    int n;
    printf("YES\n");
    scanf("%d", &n);
    for(int i = 0; i < n; i++) {
        int x1, y1, x2, y2;
        scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
        printf("%d\n", ((12 + 2 * (x1 % 2) + (y1 % 2)) % 4) + 1);
    }
    return 0;
}


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

int main(){
	int n;
	cin >> n;
	for(int i = 0;i < n;++i){
		int x1,y1,x2,y2;
		cin >> x1 >> y1 >> x2 >> y2;
		cout << abs(x1 % 2) * 2 + abs(y1 % 2) + 1 << endl;
	}
	return 0;
}


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

int main(){
	int n;
	cin >> n;
	cout << "YES\n";
	for(int i = 0;i < n;++i){
		int x1,y1,x2,y2;
		cin >> x1 >> y1 >> x2 >> y2;
		cout << abs(x1 % 2) * 2 + abs(y1 % 2) + 1 << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,x1,y1,x2,y2;
    scanf("%d",&n);
    printf("YES\n");
    for(int i=1;i<=n;i++)
    {
        scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
        if((x1&1)&&(y1&1)) printf("1\n");
        else if(!(x1&1)&&!(y1&1)) printf("2\n");
        else if(!(x1&1)&&(y1&1)) printf("3\n");
        else printf("4\n");
    }
    return 0;
}


#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long int64;

struct IO_Tp
{
	inline bool is_digit(const char ch)
	{
		return '0' <= ch && ch <= '9';
	}

	inline IO_Tp& operator>>(int& res)
	{
		res = 0;
		static char ch;
		bool neg(false);
		while (ch = getchar(), !is_digit(ch))
			neg = ch == '-';
		do
			(res *= 10) += ch & 15;
		while (ch = getchar(), is_digit(ch));
		neg ? res = -res : res;
		return *this;
	}
} IO;

int N;

int main(int argc, char** argv)
{
	puts("Yes");
	IO >> N;
	while (N--)
	{
		int x, y;
		IO >> x >> y >> x >> y;
		putchar(('0' | (x & 1) << 1 | (y & 1)) + 1), putchar('\n');
	}

	return 0;
}


#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long int64;

struct IO_Tp
{
	inline bool is_digit(const char ch)
	{
		return '0' <= ch && ch <= '9';
	}

	inline IO_Tp& operator>>(int& res)
	{
		res = 0;
		static char ch;
		bool neg(false);
		while (ch = getchar(), !is_digit(ch))
			neg = ch == '-';
		do
			(res *= 10) += ch & 15;
		while (ch = getchar(), is_digit(ch));
		neg ? res = -res : res;
		return *this;
	}
} IO;

int N;

int main(int argc, char** argv)
{
	puts("Yes");
	IO >> N;
	while (N--)
	{
		int x, y;
		IO >> x >> y >> x >> y;
		putchar('1' + ((x & 1) << 1) + (y & 1)), putchar('\n');
	}

	return 0;
}


#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long int64;

struct IO_Tp
{
	inline bool is_digit(const char ch)
	{
		return '0' <= ch && ch <= '9';
	}

	inline IO_Tp& operator>>(int& res)
	{
		res = 0;
		static char ch;
		bool neg(false);
		while (ch = getchar(), !is_digit(ch))
			neg = ch == '-';
		do
			(res *= 10) += ch & 15;
		while (ch = getchar(), is_digit(ch));
		neg ? res = -res : res;
		return *this;
	}
} IO;

int N;

int main(int argc, char** argv)
{
	puts("YES");
	IO >> N;
	while (N--)
	{
		int x, y;
		IO >> x >> y >> x >> y;
		putchar('1' + ((x & 1) << 1) + (y & 1)), putchar('\n');
	}

	return 0;
}


/* DHUOJ solution #359806 @ 2018-08-05 20:05:27.795 */

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>

typedef long long ll;
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 10;
const int maxm = 1e5 + 10;
//////////
//////////
int n;
int x1, y1, x2, y2;
int main()
{
	std::scanf("%d", &n);
	std::printf("YES\n");
	for (int i = 0; i < n; i++)
	{
		std::scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
		if (x1 % 2 && y1 % 2 )
		{
			std::printf("1\n");
		}
		else if (x1 % 2 == 0 && y1 % 2)
		{
			std::printf("2\n");
		}
		else if (x1 % 2 && y1 % 2 == 0)
		{
			std::printf("3\n");
		}
		else
		{
			std::printf("4\n");
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
int main()
{
    int n;
    cin>>n;
    cout<<"YES"<<endl;
    for(int i=0;i<n;i++){
        int x1,x2,y1,y2,x,y;
        cin>>x1>>y1>>x2>>y2;
        x=abs(min(x1,x2));
        y=abs(min(y1,y2));
        if(x%2&&y%2)cout<<"4"<<endl;
        else if(x%2==0&&y%2==1)cout<<"3"<<endl;
        else if(x%2==1&&y%2==0)cout<<"2"<<endl;
        else if(x%2==0&&y%2==0)cout<<"1"<<endl;

    }

    return 0;
}


//���������������ڵľ��Σ������(x1��x2)��(y1��y2)����ż�Բ�һ�£���Ϊ���о��α߳���Ϊ������
//����������4��Ⱦɫ��������Ϊ1 2 3 4����������ǿ��Թ�����Ⱦɫ���Ϊ[(x%2+2*(y%2))+4]%4+1������x��y��ʾ�þ������½����꣩�����ɱ�֤���ڵľ�����û��ͬɫ���������Ϊ��Ⱦɫ�����ͬɫ���ҽ���x��y����ż��һ�£���
#include <bits/stdc++.h>
using namespace std;

#define MAXN 500005

struct Rectangle
{
    int a;
    int b;
    int c;
    int d;
} rec[MAXN];

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1; i<=n; i++)
        scanf("%d%d%d%d",&rec[i].a,&rec[i].b,&rec[i].c,&rec[i].d);
    puts("YES");    //������Զ����YES����Ϊ1976�꣬������������ѧ��Appel��Haken����֤������ɫ���룬��Ȼ�󲿷���ѧ�Ҷ����֤����������...
    for(int i=1; i<=n; i++) //���ж��������Ƿ��й����ߡ��й����ߵ������������ζ�Ӧ�Ķ��㣨Ҫô��Ϊ���½ǵĶ��㣬Ҫô��Ϊ���ϽǵĶ��㣩x��y����һ����ż����ͬ
    {
        if(rec[i].a%2 && rec[i].b%2)
            puts("1");
        else if(rec[i].a%2 && !(rec[i].b%2))
            puts("2");
        else if(!(rec[i].a%2) && rec[i].b%2)
            puts("3");
        else
            puts("4");
    }
    return 0;
}


#include <iostream>
#include <cstdio>

using namespace std;

int n;
long long x1, x2, y1, y2;

int main()
{
    ios_base::sync_with_stdio(false);

    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);

    cin >> n;
    cout << "YES" << endl;
    for(int i = 1; i <= n; ++i)
    {
        cin >> x1 >> y1 >> x2 >> y2;
        cout << ((4 + 2*(x1%2) + (y1%2))% 4 + 1) << endl;
    }

    return 0;
}


#include <iostream>
#include <cstdio>

using namespace std;

int n;
long long x1, x2, y1, y2;

int main()
{
    ios_base::sync_with_stdio(false);

    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);

    cin >> n;
    cout << "YES";
    for(int i = 1; i <= n; ++i)
    {
        cin >> x1 >> y1 >> x2 >> y2;
        cout << ((4 + 2*(x1%2) + (y1%2))% 4 + 1) << endl;
    }

    return 0;
}


#include <iostream>
#include <cstdio>

using namespace std;

int n;
long long x1, x2, y1, y2;

int main()
{
    ios_base::sync_with_stdio(false);

    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);

    cin >> n;

    for(int i = 1; i <= n; ++i)
    {
        cin >> x1 >> y1 >> x2 >> y2;
        cout << ((4 + 2*(x2%2) + (y2%2))% 4 + 1) << endl;
    }

    return 0;
}


#include <iostream>
#include <cstdio>

using namespace std;

int n;
long long x1, x2, y1, y2;

int main()
{
    ios_base::sync_with_stdio(false);

    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);

    cin >> n;

    for(int i = 1; i <= n; ++i)
    {
        cin >> x1 >> y1 >> x2 >> y2;
        cout << ((4 + 2*(x1%2) + (y1%2))% 4 + 1) << endl;
    }

    return 0;
}


#include<cstdio>
#include<algorithm>
using namespace std;
int x,y,x1,y1,n;
int main()
{
	scanf("%d",&n); printf("YES");
	while (n--)
	{
		scanf("%d%d%d%d",&x,&y,&x1,&y1);
		if (!(x&1)&&!(y&1)) printf("1\n");
		if (!(x&1)&&(y&1)) printf("2\n");
		if ((x&1)&&!(y&1)) printf("3\n");
		if ((x&1)&&(y&1)) printf("4\n");
	}
	return 0;
}


#include<cstdio>
#include<algorithm>
using namespace std;
int x,y,x1,y1,n;
int main()
{
	scanf("%d",&n); printf("YES\n");
	while (n--)
	{
		scanf("%d%d%d%d",&x,&y,&x1,&y1);
		if (!(x&1)&&!(y&1)) printf("1\n");
		if (!(x&1)&&(y&1)) printf("2\n");
		if ((x&1)&&!(y&1)) printf("3\n");
		if ((x&1)&&(y&1)) printf("4\n");
	}
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
const int N = 5e5+5;
int x1[N],y1[N],x2[N],y2[N],x[N],y[N];
const int base = 1e9+2;
int main()
{
	int n;
	scanf("%d",&n);
	for(int i = 1;i<= n;i++)
	{
		scanf("%d%d%d%d",&x1[i],&y1[i],&x2[i],&y2[i]);
		x1[i]+=base,y1[i]+=base;
		x2[i]+=base,y2[i]+=base;
		x[i] = min(x1[i],x2[i]);
		y[i] = min(y1[i],y2[i]);
	}
	printf("YES\n");
	for(int i = 1;i<= n;i++)
	{

		if(x[i]%2&&y[i]%2)printf("1\n");
		else if(x[i]%2&&y[i]%2==0)printf("2\n");
		else if(x[i]%2==0&&y[i]%2)printf("3\n");
		else printf("4\n");
	}
	return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;
const int maxn=500010;
int x[maxn];
int y[maxn];
int main()
{
    int n,a,b;
    while(scanf("%d",&n)!=EOF)
    {
        for(int i=1; i<=n; i++)
        {
            scanf("%d%d%d%d",&x[i],&y[i],&a,&b);
        }
        cout<<"YES"<<endl;
        for(int i=1; i<=n; i++)
        {
            if(x[i]%2&&y[i]%2)
                printf("1\n");
            else if(x[i]%2&&y[i]%2==0)
                printf("2\n");
            else if(x[i]%2==0&&y[i]%2)
                printf("3\n");
            else
                printf("4\n");
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
const int maxn=500010;
int x[maxn];
int y[maxn];
int main()
{
    int n,a,b;
    while(scanf("%d",&n)!=EOF)
    {
        for(int i=1; i<=n; i++)
        {
            scanf("%d%d%d%d",&x[i],&y[i],&a,&b);
        }
        cout<<"YES"<<endl;
        for(int i=1; i<=n; i++)
        {
            if(x[i]%2&&y[i]%2)
                printf("1\n");
            else if(x[i]%2&&y[i]%2==0)
                printf("2\n");
            else if(x[i]%2==0&&y[i]%2)
                printf("3\n");
            else
                printf("4\n");
        }
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

const int MaxN = 5e5, MaxM = 5e6;
struct Rec {
	int l, r, u, d, pos;
}a[MaxN + 5], b[MaxN + 5];
int n, all, ans[MaxN + 5];
int pre[MaxM + 5], last[MaxN + 5], other[MaxM + 5];
bool vis[MaxN + 5];

void Build(int x, int y)
{
	//printf("%d %d\n", x, y);
	pre[++all] = last[x];
	last[x] = all;
	other[all] = y;
}

bool cmpl(Rec A, Rec B) {
	if (A.l == B.l) return A.d < B.d;
	return A.l < B.l;
}

bool cmpr(Rec A, Rec B) {
	if (A.r == B.r) return A.d < B.d;
	return A.r < B.r;
}

void Init()
{
	for (int i = 1; i <= n; i++) {
		scanf("%d%d%d%d", &a[i].l, &a[i].d, &a[i].r, &a[i].u);
		a[i].pos = i;
		b[i] = a[i];
	}
	sort(b + 1, b + n + 1, cmpl);
	sort(a + 1, a + n + 1, cmpr);
}

bool Judge(int x, int y)
{
	if (a[x].r != b[y].l) return false;
	if (a[x].u <= b[y].d) return false;
	return true;
}

void Make(int pos, int Rline)
{
	int L = 0, R = n;
	while (L < R - 1) {
		int mid = (L + R) >> 1;
		if (b[mid].l < Rline || ((b[mid].l == Rline) && (b[mid].u <= a[pos].d))) L = mid;
			else R = mid;
	}
	//printf("%d %d\n", pos, R);
	for (int i = R; i <= n && Judge(pos, i); i++) {
		//printf("** %d %d %d %d\n", b[i].l, b[i].r, b[i].d, b[i].u);
		Build(a[pos].pos, b[i].pos);
		Build(b[i].pos, a[pos].pos);
	}
}

void Dfs(int x)
{
	vis[x] = true;
	int ed = last[x], dr;
	bool flag[5];
	memset(flag, 0, sizeof(flag));
	while (ed != -1) {
		dr = other[ed];
		if (ans[dr] == 1) flag[1] = true;
		if (ans[dr] == 2) flag[2] = true;
		if (ans[dr] == 3) flag[3] = true;
		if (ans[dr] == 4) flag[4] = true;
		ed = pre[ed];
	}
	for (int i = 1; i <= 4; i++)
		if (!flag[i]) {
			ans[x] = i;
			break;
		}
	ed = last[x];
	while (ed != -1) {
		dr = other[ed];
		if (!vis[dr]) Dfs(dr);
		ed = pre[ed];
	}
}

void Solve()
{
	all = -1; memset(last, -1, sizeof(last));
	for (int i = 1; i <= n; i++) {
		//printf("%d %d %d %d\n", a[i].l, a[i].r, a[i].d, a[i].u);
		Make(i, a[i].r);
	}
	for (int i = 1; i <= n; i++) {
		swap(a[i].l, a[i].d);
		swap(a[i].r, a[i].u);
		swap(b[i].l, b[i].d);
		swap(b[i].r, b[i].u);
	}
	sort(b + 1, b + n + 1, cmpl);
	sort(a + 1, a + n + 1, cmpr);
	for (int i = 1; i <= n; i++) Make(i, a[i].r);
	memset(vis, 0, sizeof(vis));
	Dfs(1);
	printf("YES\n");
	for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
}

int main()
{
	while (~scanf("%d", &n)) {
		Init();
		Solve();
	}
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

const int MaxN = 5e5, MaxM = 1e7;
struct Rec {
	int l, r, u, d, pos;
}a[MaxN + 5], b[MaxN + 5];
int n, all, ans[MaxN + 5];
int pre[MaxM + 5], last[MaxN + 5], other[MaxM + 5];
bool vis[MaxN + 5];

void Build(int x, int y)
{
	//printf("%d %d\n", x, y);
	pre[++all] = last[x];
	last[x] = all;
	other[all] = y;
}

bool cmpl(Rec A, Rec B) {
	if (A.l == B.l) return A.d < B.d;
	return A.l < B.l;
}

bool cmpr(Rec A, Rec B) {
	if (A.r == B.r) return A.d < B.d;
	return A.r < B.r;
}

void Init()
{
	for (int i = 1; i <= n; i++) {
		scanf("%d%d%d%d", &a[i].l, &a[i].d, &a[i].r, &a[i].u);
		a[i].pos = i;
		b[i] = a[i];
	}
	sort(b + 1, b + n + 1, cmpl);
	sort(a + 1, a + n + 1, cmpr);
}

bool Judge(int x, int y)
{
	if (a[x].r != b[y].l) return false;
	if (a[x].u <= b[y].d) return false;
	return true;
}

void Make(int pos, int Rline)
{
	int L = 0, R = n;
	while (L < R - 1) {
		int mid = (L + R) >> 1;
		if (b[mid].l < Rline || ((b[mid].l == Rline) && (b[mid].u <= a[pos].d))) L = mid;
			else R = mid;
	}
	//printf("%d %d\n", pos, R);
	for (int i = R; i <= n && Judge(pos, i); i++) {
		//printf("** %d %d %d %d\n", b[i].l, b[i].r, b[i].d, b[i].u);
		Build(a[pos].pos, b[i].pos);
		Build(b[i].pos, a[pos].pos);
	}
}

void Dfs(int x)
{
	vis[x] = true;
	int ed = last[x], dr;
	bool flag[5];
	memset(flag, 0, sizeof(flag));
	while (ed != -1) {
		dr = other[ed];
		if (ans[dr] == 1) flag[1] = true;
		if (ans[dr] == 2) flag[2] = true;
		if (ans[dr] == 3) flag[3] = true;
		if (ans[dr] == 4) flag[4] = true;
		ed = pre[ed];
	}
	for (int i = 1; i <= 4; i++)
		if (!flag[i]) {
			ans[x] = i;
			break;
		}
	ed = last[x];
	while (ed != -1) {
		dr = other[ed];
		if (!vis[dr]) Dfs(dr);
		ed = pre[ed];
	}
}

void Solve()
{
	all = -1; memset(last, -1, sizeof(last));
	for (int i = 1; i <= n; i++) {
		//printf("%d %d %d %d\n", a[i].l, a[i].r, a[i].d, a[i].u);
		Make(i, a[i].r);
	}
	for (int i = 1; i <= n; i++) {
		swap(a[i].l, a[i].d);
		swap(a[i].r, a[i].u);
		swap(b[i].l, b[i].d);
		swap(b[i].r, b[i].u);
	}
	sort(b + 1, b + n + 1, cmpl);
	sort(a + 1, a + n + 1, cmpr);
	for (int i = 1; i <= n; i++) Make(i, a[i].r);
	memset(vis, 0, sizeof(vis));
	for (int i = 1; i <= n; i++)
		if (!vis[i]) Dfs(i);
	printf("YES\n");
	for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
}

int main()
{
	while (~scanf("%d", &n)) {
		Init();
		Solve();
	}
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

int X1, Y1, X2, Y2, n;

int main()
{
	while (~scanf("%d", &n)) {
		printf("YES\n");
		for (int i = 1; i <= n; i++) {
			scanf("%d%d%d%d", &X1, &Y1, &X2, &Y2);
			printf("%d\n", ((X1 & 1) * 2 + (Y1 & 1)) + 1);
		}
	}
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

const int MaxN = 5e5, MaxM = 5e6;
struct Rec {
	int l, r, u, d, pos;
}a[MaxN + 5], b[MaxN + 5];
int n, all, ans[MaxN + 5];
int pre[MaxM + 5], last[MaxN + 5], other[MaxM + 5];
bool vis[MaxN + 5];

void Build(int x, int y)
{
	//printf("%d %d\n", x, y);
	pre[++all] = last[x];
	last[x] = all;
	other[all] = y;
}

bool cmpl(Rec A, Rec B) {
	if (A.l == B.l) return A.d < B.d;
	return A.l < B.l;
}

bool cmpr(Rec A, Rec B) {
	if (A.r == B.r) return A.d < B.d;
	return A.r < B.r;
}

void Init()
{
	for (int i = 1; i <= n; i++) {
		scanf("%d%d%d%d", &a[i].l, &a[i].d, &a[i].r, &a[i].u);
		a[i].pos = i;
		b[i] = a[i];
	}
	sort(b + 1, b + n + 1, cmpl);
	sort(a + 1, a + n + 1, cmpr);
}

bool Judge(int x, int y)
{
	if (a[x].r != b[y].l) return false;
	if (a[x].u <= b[y].d) return false;
	return true;
}

void Make(int pos, int Rline)
{
	int L = 0, R = n;
	while (L < R - 1) {
		int mid = (L + R) >> 1;
		if (b[mid].l < Rline || ((b[mid].l == Rline) && (b[mid].u <= a[pos].d))) L = mid;
			else R = mid;
	}
	//printf("%d %d\n", pos, R);
	for (int i = R; i <= n && Judge(pos, i); i++) {
		//printf("** %d %d %d %d\n", b[i].l, b[i].r, b[i].d, b[i].u);
		Build(a[pos].pos, b[i].pos);
		Build(b[i].pos, a[pos].pos);
	}
}

void Dfs(int x)
{
	vis[x] = true;
	int ed = last[x], dr;
	bool flag[5];
	memset(flag, 0, sizeof(flag));
	while (ed != -1) {
		dr = other[ed];
		if (ans[dr] == 1) flag[1] = true;
		if (ans[dr] == 2) flag[2] = true;
		if (ans[dr] == 3) flag[3] = true;
		if (ans[dr] == 4) flag[4] = true;
		ed = pre[ed];
	}
	for (int i = 1; i <= 4; i++)
		if (!flag[i]) {
			ans[x] = i;
			break;
		}
	ed = last[x];
	while (ed != -1) {
		dr = other[ed];
		if (!vis[dr]) Dfs(dr);
		ed = pre[ed];
	}
}

void Solve()
{
	all = -1; memset(last, -1, sizeof(last));
	for (int i = 1; i <= n; i++) {
		//printf("%d %d %d %d\n", a[i].l, a[i].r, a[i].d, a[i].u);
		Make(i, a[i].r);
	}
	for (int i = 1; i <= n; i++) {
		swap(a[i].l, a[i].d);
		swap(a[i].r, a[i].u);
		swap(b[i].l, b[i].d);
		swap(b[i].r, b[i].u);
	}
	sort(b + 1, b + n + 1, cmpl);
	sort(a + 1, a + n + 1, cmpr);
	for (int i = 1; i <= n; i++) Make(i, a[i].r);
	memset(vis, 0, sizeof(vis));
	for (int i = 1; i <= n; i++)
		if (!vis[i]) Dfs(i);
	printf("YES\n");
	for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
}

int main()
{
	while (~scanf("%d", &n)) {
		Init();
		Solve();
	}
}


#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<queue>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
#include<map>
#include<cstdlib>
#define lson l,mid,o<<1
#define rson mid + 1,r,o<<1|1
#define sc(x) scanf("%d",&x);
#define For(i,a,b)  for(i = a; i <= b; i++)
typedef long long LL;
typedef unsigned long long uLL;
const int INF = 0x3f3f3f3f;
const LL MAX_N = 2e5 + 10;
const LL mod = 1e9 + 7;
const double PI = acos(-1);
using namespace std;

int main()
{
    int n,x1,x2,y1,y2,ans;
    sc(n);
    printf("YES\n");
    for(int i=1;i<=n;i++){
        scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
        printf("%d\n",(x1&1)*2+(y1&1)+1);
    }
    return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n,i,x,y;
	scanf("%d",&n);
	printf("YES\n");
	for(i=1;i<=n;i++)
	{
	  scanf("%d%d",&x,&y);
	  scanf("%d%d",&x,&y);
	  printf("%d\n",2*(x%2)+y%2+1);
	}
	return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n,i,x,y;
	scanf("%d",&n);
	printf("YES\n");
	for(i=1;i<=n;i++)
	{
	  scanf("%d%d",&x,&y);
	  scanf("%d%d",&x,&y);
	  printf("%d\n",2*abs(x%2)+abs(y%2)+1);
	}
	return 0;
}


/* DHUOJ solution #359741 @ 2018-08-05 18:46:05.626 */

#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e3+5;
typedef long long ll;
const ll mod=1e9+7;
inline ll read(){
    ll ans=0,flag=1;
    char c;
    c=getchar();
    while(c<'0' || c>'9'){
        if(c=='-')
            flag=-1;
        c=getchar();
    }
    while(c>='0' && c<='9'){
        ans=ans*10+(ll)(c-'0');
        c=getchar();
    }
    return ans*flag;
}
ll quickpow(ll x,ll y,ll mod)
{
    ll ans=x%mod;
    while(y)
    {
        if(y&1)
            ans=ans*x%mod;
        x=x*x%mod;
        y>>=1;
    }
    return ans;
}

int main()
{
    int n;
    while(cin>>n)
    {
        cout<<"YES"<<endl;
        for(int i=0;i<n;i++)
        {
            int x1,x2,y1,y2;
            cin>>x1>>y1>>x2>>y2;
            if(x1%2&&y1%2)
                cout<<1<<endl;
            else if(x1%2&&y1%2==0)
                cout<<2<<endl;
            else if(x1%2==0&&y1%2)
                cout<<3<<endl;
            else cout<<4<<endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define N 500005
#define ll long long
#define p(t) cout<<t;
#define f(i,n) for(i=0;i<n;i++)
#define g(i,n) for(i=1;i<=n;i++)
#define s(x) scanf("%I64d",&x);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

ll m,n,r,u,xc,yc,a[N],b[N],c[N];
pair<pair<ll,ll> ,pair<ll,ll> > p[N];
map<pair<pair<ll,ll> ,pair<ll,ll> > ,ll> in;
vector<ll> v[N];
void dfs(ll x, set<ll> tp){
    if(c[x]==1 || r==-1)return;
    c[x]=1;
    ll i,j,k,l;
    ll co[]= {0,0,0,0,0};
    set<ll> sp =tp;
   // cout<<sp.size();
    for(i=0;i<v[x].size();i++){
        j=v[x][i];
        dfs(j,tp);
        l=a[j];
        if(l==0)continue;
        tp.insert(l);
        co[l]++;
    }
    set<ll> :: iterator it;
    for(it= sp.begin(); it !=sp.end(); it++){
        k =*it;
        if(co[k]==0)a[x]=k; return;
    }
    g(i,4)if(co[i]==0){a[x]=i; break;}
    if(i==5)r=-1;

}

int main()
{
ios_base::sync_with_stdio(0);
ll k=0,x,sum=1,q=0,z=0,y=0,l=0,i,t,j;
cin>>n;
f(i,n){
    cin>>p[i].ff.ff>>p[i].ff.ss>>p[i].ss.ff>>p[i].ss.ss;
    in[mp(mp(p[i].ff.ff,p[i].ff.ss),mp(p[i].ss.ff,p[i].ss.ss) )]=i+1;
}
sort(p,p+n);
f(i,n){
    for(j=i+1;j<n;j++){
        if(p[j].ff.ff>p[i].ss.ff)break;
          if(p[i].ss.ff == p[j].ff.ff && p[i].ss.ss==p[j].ff.ss)break;
          if(p[i].ss.ff == p[j].ff.ff && p[i].ff.ss==p[j].ss.ss)continue;
        if((p[j].ff.ss >=p[i].ff.ss && p[j].ff.ss <= p[i].ss.ss) || (p[j].ss.ss >=p[i].ff.ss && p[j].ss.ss <= p[i].ss.ss)){
          v[i].pb(j); v[j].pb(i);
        } else if ((p[i].ff.ss >=p[j].ff.ss && p[i].ff.ss <= p[j].ss.ss) || (p[i].ss.ss >=p[j].ff.ss && p[j].ss.ss >= p[i].ss.ss)){
            v[i].pb(j); v[j].pb(i);
        }
    }
}
set<ll>mk;
f(i,n){if(c[i]==0)dfs(i,mk);}
if(r==-1)cout<<"NO";
else {
    cout<<"YES\n";
    f(i,n){
        t=a[i];
        l =in[mp(mp(p[i].ff.ff,p[i].ff.ss),mp(p[i].ss.ff,p[i].ss.ss) )];
        b[l]=t;
        //cout<<l<<" "<<t;
    }
    g(i,n){
        cout<<b[i]<<endl;
    }
}
return 0;
}