#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_SIZE = 10000;

void solve(){
    int n;
    cin >> n;

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

    for(int i = 0; i < 4; i++){
        if(n%2==0){
            if(i == 0){
                for(int j = 0; j < n/2; j++){
                    if(j %2){
                        cout << "aa" << flush;
                    }
                    else{
                        cout << "bb" << flush;
                    }
                }
                cout << endl;
            }
            else if(i == 1){
                cout << "h" << flush;
                for(int j = 0; j < (n-2)/2; j++){
                    if(j % 2){
                        cout << "dd" << flush;
                    }
                    else
                        cout << "ee" << flush;
                }
                cout << "g" << flush;
                cout << endl;
            }
            else if(i == 2){
                cout << "h" << flush;
                for(int j = 0; j < (n-2)/2; j++){
                    if(j % 2){
                        cout << "ee" << flush;
                    }
                    else
                        cout << "dd" << flush;
                }
                cout << "g" << flush;
                cout << endl;
            }
            else if(i == 3){
                for(int j = 0; j < n/2; j++){
                    if(j %2){
                        cout << "aa" << flush;
                    }
                    else{
                        cout << "bb" << flush;
                    }
                }
                cout << endl;
            }
        }
        else{
            if(i == 0){
                for(int j = 0; j<n/2; j++){
                    if(j%2)
                        cout << "aa" << flush;
                    else
                        cout << "bb" << flush;
                }
                cout << "c" << flush;
                cout << endl;
            }
            else if(i == 1){
                for(int j = 0; j<n/2; j++){
                    if(j%2)
                        cout << "bb" << flush;
                    else
                        cout << "aa" << flush;
                }
                cout << "c" << flush;
                cout << endl;
            }
            else if(i == 2){
                cout << "c" << flush;
                for(int j = 0; j<n/2; j++){
                    if(j%2)
                        cout << "dd" << flush;
                    else
                        cout << "ee" << flush;
                }
                cout << endl;
            }
            else if(i == 3){
                cout << "c" << flush;
                for(int j = 0; j<n/2; j++){
                    if(j%2)
                        cout << "ee" << flush;
                    else
                        cout << "dd" << flush;
                }
                cout << endl;
            }
        }
    }

}

int main(){

    solve();

    return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_SIZE = 10000;

void solve(){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        if(i % 2)
            cout << "aabb" << endl;
        else
            cout << "ccdd" << endl;
    }
}

int main(){

    solve();

    return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_SIZE = 10000;

void solve(){
    int n;
    cin >> n;

    for(int i = 0; i < 4; i++){
        for(int j = 0; j < n/2; j++){
            if(i % 2){
                if(j % 2){
                    cout << "aa" << flush;
                }
                else
                    cout << "bb" << flush;
            }
            else{
                if(j % 2){
                    cout << "bb" << flush;
                }
                else
                    cout << "aa" << flush;
            }
        }
        if(n % 2){
            if(i <=1){
                cout << "c" << flush;
            }
            else
                cout << "d" << flush;
        }
        cout << endl;
    }

}
int main(){

    solve();

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <map>
using namespace std;
int main(){
//#ifndef ONLINE_JUDGE
    int n;
    cin>>n;
    //char ans[4][100];
    for( int j = 0; j < (n/2)*2; j+=2){
        char ch = 'a' + j%4;
        cout << ch << ch ;
    }
    if( n%2 != 0 )
        cout << 'y';
    cout<<endl;
    for( int j = 1; j <= (n/2)*2; j+=2){
        char ch = 'c' + j%4;
        cout << ch << ch ;
    }
    if( n%2 != 0 )
        cout << 'y';
    cout<<endl;

    if( n%2 == 0 ){
        cout<<'z';
        for( int j = 0; j < n-2; j+=2){
            char ch = 'e' + j%4;
            cout << ch << ch ;
        }
        cout<<'z';
        cout<<endl;

        cout<<'z';
        for( int j = 0; j < n-2; j+=2){
            char ch = 'g' + j%4;
            cout << ch << ch ;
        }
        cout<<'z';
    }
    if( n%2 == 1 ){
        cout<<'z';
        for( int j = 0; j < (n/2)*2; j+=2){
            char ch = 'e' + j%4;
            cout << ch << ch ;
        }
        cout<<endl;

        cout<<'z';
        for( int j = 0; j < (n/2)*2; j+=2){
            char ch = 'g' + j%4;
            cout << ch << ch ;
        }
    }

}


#include <iostream>
#include <vector>
#include <string>
#include <map>
using namespace std;
int main(){
//#ifndef ONLINE_JUDGE
    int n;
    cin>>n;
    //char ans[4][100];
    for( int j = 0; j < (n/2)*2; j+=2){
        char ch = 'a' + j%4;
        cout << ch << ch ;
    }
    if( n%2 != 0 )
        cout << 'y';
    cout<<endl;
    for( int j = 1; j <= (n/2)*2; j+=2){
        char ch = 'c' + j%4;
        cout << ch << ch ;
    }
    if( n%2 != 0 )
        cout << 'y';
    cout<<endl;

    if( n%2 == 0 ){
        cout<<'z';
        for( int j = 0; j < n-2; j+=2){
            char ch = 'e' + j%4;
            cout << ch << ch ;
        }
        cout<<'x';
        cout<<endl;

        cout<<'z';
        for( int j = 0; j < n-2; j+=2){
            char ch = 'g' + j%4;
            cout << ch << ch ;
        }
        cout<<'x';
    }
    if( n%2 == 1 ){
        cout<<'z';
        for( int j = 0; j < (n/2)*2; j+=2){
            char ch = 'e' + j%4;
            cout << ch << ch ;
        }
        cout<<endl;

        cout<<'z';
        for( int j = 0; j < (n/2)*2; j+=2){
            char ch = 'g' + j%4;
            cout << ch << ch ;
        }
    }
   // system("pause");
}


#include <vector>
#include <list>
#include <map>
#include <math.h>
#include <set>
#include <string>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <strstream>
using namespace std;
#define max(a,b)    (((a) > (b)) ? (a) : (b))
#define min(a,b)    (((a) < (b)) ? (a) : (b))
#define sqr(a)    ((a)*(a))

void main()
{
  int n;
  cin >>n;

  for (int i=0;i<2;++i)
  {
    for (int j=0;j<n;++j)
    {
      if (n&1)
      {
        int c;
        if (j==n-1)
          c=21;
        else
          c = i*5+(j/2)%2;
        cout << char('a'+c);
      }
      else
      {
        int c = i*5+(j/2)%2;
        cout << char('a'+c);
      }
    }
    cout<<"\n";
  }

  for (int i=0;i<2;++i)
  {
    for (int j=0;j<n;++j)
    {
      if (n&1)
      {
        int c;
        if (j==0)
          c=22;
        else
          c = 10+i*5+((j-1)/2)%2;
        cout << char('a'+c);
      }
      else
      {
        int c;
        if (j==0)
          c = 23;
        else if (j==n-1)
          c=24;
        else
          c= 10+i*5+((j-1)/2)%2;
        cout << char('a'+c);
      }
    }
    cout<<"\n";
  }
}


#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <deque>
#include <string>
#include <cmath>
#include <set>
#include <queue>
#include <map>
#include <ctime>
#define pb push_back
#define mp make_pair
using namespace std;
int n, m, c;
int main()
{
	scanf("%d", &n);
	if (n%2)
	{
		for (int i=1; i<n; i+=2, m++) if (m%2) printf("aa"); else printf("bb"); printf("x\n");
		for (int i=1; i<n; i+=2, m++) if (m%2) printf("cc"); else printf("dd"); printf("x\n");
		printf("y"); for (int i=1; i<n; i+=2, m++) if (m%2) printf("aa"); else printf("bb"); printf("\n");
		printf("y"); for (int i=1; i<n; i+=2, m++) if (m%2) printf("cc"); else printf("dd"); printf("\n");
		return 0;
	}
		for (int i=0; i<n; i+=2, m++) if (m%2) printf("aa"); else printf("bb"); m=0; printf("\n");
		printf("x"); for (int i=2; i<n; i+=2, m++) if (m%2) printf("cc"); else printf("dd"); m=0; printf("y\n");
		printf("x"); for (int i=2; i<n; i+=2, m++) if (m%2) printf("aa"); else printf("bb"); m=0; printf("y\n");
		for (int i=0; i<n; i+=2, m++) if (m%2) printf("cc"); else printf("dd"); m=0; printf("\n");
	return 0;
}


#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <deque>
#include <string>
#include <cmath>
#include <set>
#include <queue>
#include <map>
#include <ctime>
#define pb push_back
#define mp make_pair
using namespace std;
int n, m, c;
int main()
{
	scanf("%d", &n);
	if (n%2)
	{
		for (int i=1; i<n; i+=2, m++) if (m%2) printf("aa"); else printf("bb"); printf("x\n");
		for (int i=1; i<n; i+=2, m++) if (m%2) printf("cc"); else printf("dd"); printf("x\n");
		printf("y"); for (int i=1; i<n; i+=2, m++) if (m%2) printf("aa"); else printf("bb"); printf("\n");
		printf("y"); for (int i=1; i<n; i+=2, m++) if (m%2) printf("cc"); else printf("dd"); printf("\n");
		return 0;
	}
		for (int i=0; i<n; i+=2, m++) if (m%2) printf("aa"); else printf("bb"); m=0; printf("\n");
		for (int i=0; i<n; i++) if (i%2) printf("c"); else printf("d"); printf("\n");
		for (int i=0; i<n; i++) if (i%2) printf("c"); else printf("d"); printf("\n");
		for (int i=0; i<n; i+=2, m++) if (m%2) printf("aa"); else printf("bb"); printf("\n");
	return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<string.h>
#pragma comment(linker, "/STACK:167772160")
typedef long long int64;
const int INF = 1000000000;
#define FOR(i,a,b) for(i=a;i<=b;i++)
#define PB push_back
#define MP make_pair
using namespace std;
char a[10][1001];
int k,l,i,j,n;
int f(int k)
{
	return k%25;
}
int main()
{
	//freopen("input.txt","r",stdin);
	cin>>n;
	if(n==1)
	{
	cout<<'a'<<endl;
	cout<<'a'<<endl;
	cout<<'b'<<endl;
	cout<<'b'<<endl;
	return 0;
	}

	if(n==3)
	{
		cout<<"aab"<<endl;
		cout<<"ccb"<<endl;
		cout<<"dee"<<endl;
		cout<<"dzz"<<endl;
		return 0;
	}

	a[1][1]='a';
	a[1][2]='a';
	a[2][1]='b';
	a[3][1]='b';
	a[4][1]='c';
	a[4][2]='c';
	k=3;

	l=int('a');

	for(i=3;i<=n;i+=2)
	{
		if(i==n)
		{
		a[2][i-1]=char(f(k)+l);
		a[3][i-1]=char(f(k)+l);
		k++;

		a[1][i]=char(f(k)+l);
		a[2][i]=char(f(k)+l);
		k++;

		a[3][i]=char(f(k)+l);
		a[4][i]=char(f(k)+l);
		k++;
		}else
		{
		a[2][i-1]=char(f(k)+l);
		a[2][i]=char(f(k)+l);
		k++;

		a[3][i-1]=char(f(k)+l);
		a[3][i]=char(f(k)+l);
		k++;

		a[1][i]=char(f(k)+l);
		a[1][i+1]=char(f(k)+l);
		k++;

		a[4][i]=char(f(k)+l);
		a[4][i+1]=char(f(k)+l);
		k++;
		}
	}

	if(n%2==0)
	{
		a[2][n]=char(f(k)+l);
	    a[3][n]=char(f(k)+l);
	}

	for(i=1;i<=4;i++)
	{
		for(j=1;j<=n;j++)cout<<a[i][j];cout<<endl;
	}
}


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<string.h>
#pragma comment(linker, "/STACK:167772160")
typedef long long int64;
const int INF = 1000000000;
#define FOR(i,a,b) for(i=a;i<=b;i++)
#define PB push_back
#define MP make_pair
using namespace std;
char a[10][1001];
int k,l,i,j,n;
int f(int k)
{
	return k%25;
}
int main()
{
	//freopen("input.txt","r",stdin);
	cin>>n;
	if(n==1)
	{cout<<'a'<<endl;
	cout<<'a'<<endl;
	cout<<'b'<<endl;
	cout<<'b'<<endl;
	return 0;
	}

	if(n==3)
	{
		cout<<"aabb"<<endl;
		cout<<"cddf"<<endl;
		cout<<"ceef"<<endl;
		cout<<"xxzz"<<endl;
		return 0;
	}

	a[1][1]='a';
	a[1][2]='a';
	a[2][1]='b';
	a[3][1]='b';
	a[4][1]='c';
	a[4][2]='c';
	k=3;

	l=int('a');

	for(i=3;i<=n;i+=2)
	{
		if(i==n)
		{
		a[2][i-1]=char(f(k)+l);
		a[3][i-1]=char(f(k)+l);
		k++;

		a[1][i]=char(f(k)+l);
		a[2][i]=char(f(k)+l);
		k++;

		a[3][i]=char(f(k)+l);
		a[4][i]=char(f(k)+l);
		k++;
		}else
		{
		a[2][i-1]=char(f(k)+l);
		a[2][i]=char(f(k)+l);
		k++;

		a[3][i-1]=char(f(k)+l);
		a[3][i]=char(f(k)+l);
		k++;

		a[1][i]=char(f(k)+l);
		a[1][i+1]=char(f(k)+l);
		k++;

		a[4][i]=char(f(k)+l);
		a[4][i+1]=char(f(k)+l);
		k++;
		}
	}

	if(n%2==0)
	{
		a[2][n]=char(f(k)+l);
	    a[3][n]=char(f(k)+l);
	}

	for(i=1;i<=4;i++)
	{
		for(j=1;j<=n;j++)cout<<a[i][j];cout<<endl;
	}
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;
	string s[4];

	for (int i = 0; i < 4; i ++)
		s[i] = "";

	int z = 0;
	for (int i = 0; i < (n >> 1); i ++)
	{
		if (z == 0)
		{
			s[0] += "aa";
			s[3] += "aa";
		} else {
			s[0] += "bb";
			s[3] += "bb";
		}

		s[1] += "cd";
		s[2] += "cd";

		z = 1 - z;
	}
	if (n & 1)
	{
		s[0] += "e";
		s[1] += "e";
		s[2] += "f";
		s[3] += "f";
	}

	for (int i = 0; i < 4; i ++)
		cout << s[i] << endl;
	//system("pause");

	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:16777216")
#ifndef ONLINE_JUDGE
#include <ctime>
#endif
#include <string>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
using namespace std;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef long long ll;
typedef istringstream iss;
#define FOR(i,f,n) for(int i=f; i<n; ++i)
#define sz(a) ((int)a.size())
#define fill(w,v) memset(w,v,sizeof(w))
#define pb push_back
#define all(a) a.begin(),a.end()
#define mp make_pair
#define inf 1000000000
#define X first
#define Y second
template<class T> inline T gcd(T a, T b){T t; while (a && b) t = a, a = b%a, b = t; return a+b; }
template<class T> inline T power(T a, int p) {T r = T(1); while (p) { if (p&1) r = r*a; a = a*a; p >>= 1; } return r; }
template<class T> T extgcd(T a, T b, T& x, T& y) { if (b==0) return x=1, y=0, a; T x1, y1, g; g = extgcd(b, a%b, x1, y1); x = y1; y = x1 - a/b*y1; return g; }
template<class T> inline T Floor(T a, T b) { if (b<0) a=-a, b=-b; if (a<0) return (a-b+1)/b; return a/b; }
template<class T> inline T Ceil(T a, T b) { if (b<0) a=-a, b=-b; if (a<0) return a/b; return (a+b-1)/b; }

int N, M, K;
#define MAX 111
int m[MAX][16];
pair<pii, pii> sol[MAX][32];

int F(int n, int msk)
{
	int& r = m[n][msk];
	if (r != -1)
		return r;

	if (n == N)
	{
		if (msk == 0)
		{
			return r = 1;
		}
		else
		{
			return r = 0;
		}
	}

	if ((msk & 0xF) == 0xF)
	{
		if (F(n+1, msk >> 4))
		{
			sol[n+1][msk >> 4] = mp(mp(n, msk), mp(-1, -1));
			return r = 1;
		}
		return r = 0;
	}

	if (msk == 0 && n > 0)
		return r = 0;

	r = 0;
	FOR(i,0,4)
	{
		if (msk & (1<<i))
			continue;

		int nmsk = msk | (1<<i) | (1<<(i+4));
		if (F(n, nmsk))
		{
			sol[n][nmsk] = mp(mp(n, msk), mp(i, 0));
			return r = 1;
		}

		if (i == 3 || (msk & (1<<(i+1))))
			return r = 0;

		nmsk = msk | (1<<i) | (1<<(i+1));
		if (F(n, nmsk))
		{
			sol[n][nmsk] = mp(mp(n, msk), mp(i, 1));
			return r = 1;
		}
		return r = 0;
	}

	return r;
}

char s[4][MAX];
int gcnt=0;

void rec(int n, int msk)
{
	if (n == 0 && msk == 0)
		return;
	int prevN = sol[n][msk].X.X;
	int prevMsk = sol[n][msk].X.Y;
	int i = sol[n][msk].Y.X;
	int kind = sol[n][msk].Y.Y;

	if (i >= 0)
	{
		if (kind == 0)
		{
			s[i][n] = 'a' + gcnt%26;
			s[i][n+1] = 'a' + gcnt%26;
		}
		else
		{
			s[i][n] = 'a' + gcnt%26;
			s[i+1][n] = 'a' + gcnt%26;
		}
		++gcnt;
	}
	rec(prevN, prevMsk);
}

int main()
{
#ifndef ONLINE_JUDGE
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	clock_t startTime = clock();
#endif

	scanf("%d", &N);
	fill(m,-1);
	fill(s,0);

	if (F(0, 0) == 0)
	{
		printf("-1\n");
		return 0;
	}
	//printf("%d\n", F(N, 0));
	rec(N, 0);
	puts(s[0]);
	puts(s[1]);
	puts(s[2]);
	puts(s[3]);

#ifndef ONLINE_JUDGE
	clock_t endTime = clock();
	printf("\nTime: %.3lf\n", double(endTime-startTime)/CLOCKS_PER_SEC);
#endif
	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:16777216")
#ifndef ONLINE_JUDGE
#include <ctime>
#endif
#include <string>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
using namespace std;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef long long ll;
typedef istringstream iss;
#define FOR(i,f,n) for(int i=f; i<n; ++i)
#define sz(a) ((int)a.size())
#define fill(w,v) memset(w,v,sizeof(w))
#define pb push_back
#define all(a) a.begin(),a.end()
#define mp make_pair
#define inf 1000000000
#define X first
#define Y second
template<class T> inline T gcd(T a, T b){T t; while (a && b) t = a, a = b%a, b = t; return a+b; }
template<class T> inline T power(T a, int p) {T r = T(1); while (p) { if (p&1) r = r*a; a = a*a; p >>= 1; } return r; }
template<class T> T extgcd(T a, T b, T& x, T& y) { if (b==0) return x=1, y=0, a; T x1, y1, g; g = extgcd(b, a%b, x1, y1); x = y1; y = x1 - a/b*y1; return g; }
template<class T> inline T Floor(T a, T b) { if (b<0) a=-a, b=-b; if (a<0) return (a-b+1)/b; return a/b; }
template<class T> inline T Ceil(T a, T b) { if (b<0) a=-a, b=-b; if (a<0) return a/b; return (a+b-1)/b; }

int N, M, K;
#define MAX 111
int m[MAX][300];
pair<pii, pii> sol[MAX][300];

int F(int n, int msk)
{
	int& r = m[n][msk];
	if (r != -1)
		return r;

	if (n == N)
	{
		if (msk == 0)
			return r = 1;
		else
			return r = 0;
	}

	if ((msk & 0xF) == 0xF)
	{
		if (F(n+1, msk >> 4))
		{
			sol[n+1][msk >> 4] = mp(mp(n, msk), mp(-1, -1));
			return r = 1;
		}
		return r = 0;
	}

	if (msk == 0 && n > 0)
		return r = 0;

	r = 0;
	FOR(i,0,4)
	{
		if (msk & (1<<i))
			continue;

		int nmsk = msk | (1<<i) | (1<<(i+4));
		if (F(n, nmsk))
		{
			sol[n][nmsk] = mp(mp(n, msk), mp(i, 0));
			return r = 1;
		}

		if (i == 3 || (msk & (1<<(i+1))))
			return r = 0;

		nmsk = msk | (1<<i) | (1<<(i+1));
		if (F(n, nmsk))
		{
			sol[n][nmsk] = mp(mp(n, msk), mp(i, 1));
			return r = 1;
		}
		return r = 0;
	}

	return r;
}

char s[4][MAX];
int gcnt=0;

void rec(int n, int msk)
{
	if (n == 0 && msk == 0)
		return;
	int prevN = sol[n][msk].X.X;
	int prevMsk = sol[n][msk].X.Y;
	int i = sol[n][msk].Y.X;
	int kind = sol[n][msk].Y.Y;

	if (i >= 0)
	{
		if (kind == 0)
		{
			s[i][n] = 'a' + gcnt%26;
			s[i][n+1] = 'a' + gcnt%26;
		}
		else
		{
			s[i][n] = 'a' + gcnt%26;
			s[i+1][n] = 'a' + gcnt%26;
		}
		++gcnt;
	}
	rec(prevN, prevMsk);
}

int main()
{
#ifndef ONLINE_JUDGE
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	clock_t startTime = clock();
#endif

	scanf("%d", &N);
	fill(m,-1);
	fill(s,0);

	if (F(0, 0) == 0)
	{
		printf("-1\n");
		return 0;
	}
	//printf("%d\n", F(N, 0));
	rec(N, 0);
	puts(s[0]);
	puts(s[1]);
	puts(s[2]);
	puts(s[3]);

#ifndef ONLINE_JUDGE
	clock_t endTime = clock();
	printf("\nTime: %.3lf\n", double(endTime-startTime)/CLOCKS_PER_SEC);
#endif
	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<sstream>
#include<deque>
#include<math.h>
#include<cstring>
#include <bitset>
#include<algorithm>
#include<stdio.h>
#include<stdlib.h>

#define all(v) v.begin(),v.end()
#define mpair make_pair

using namespace std;
typedef long double ld;
const ld epsilon = 1e-9;
typedef long long ll;

int main()
{
	//freopen("bobi.in", "r", stdin);
	int n;
	cin >> n;
	if(n == 1)
	{
		cout << "a\na\nb\nb" << endl;
		return 0;
	}
	vector<string> str(4);
	for(int i = 0; i < 4; i++)
		str[i].resize(n);
	if(n % 2 == 0)
	{
		str[1][0] = str[2][0] = 'e';
		str[1][n - 1] = str[2][n - 1] = 'f';
		for(int i = 0; i < n; i++)
		{
			if(i % 4 < 2)
			{
				str[0][i] = str[3][i] = 'a';
				if(i + 1 < n - 1)
				{
					str[1][i + 1] = 'c';
					str[2][i + 1] = 'r';
				}
			}
			else
			{
				str[0][i] = str[3][i] = 'b';
				if(i + 1 < n - 1)
				{
					str[1][i + 1] = 't';
					str[2][i + 1] = 'u';
				}
			}
		}
	}
	else
	{
		str[0][0] = str[1][0] = 'e';
		str[2][n - 1] = str[3][n - 1] = 'f';
		for(int i = 0; i < n - 1; i++)
		{
			if(i % 4 < 2)
			{
				str[0][i + 1] = str[2][i] = 'a';
				str[1][i + 1] = str[3][i] = 'c';
			}
			else
			{
				str[0][i + 1] = str[2][i] = 'b';
				str[1][i + 1] = str[3][i] = 'd';
			}
		}
	}
	for(int i = 0; i < 4; i++)
		cout << str[i] << endl;
	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<sstream>
#include<deque>
#include<math.h>
#include<cstring>
#include <bitset>
#include<algorithm>
#include<stdio.h>
#include<stdlib.h>

#define all(v) v.begin(),v.end()
#define mpair make_pair

using namespace std;
typedef long double ld;
const ld epsilon = 1e-9;
typedef long long ll;

int main()
{
	//freopen("bobi.in", "r", stdin);
	int n;
	cin >> n;
	if(n == 1)
	{
		cout << -1 << endl;
		return 0;
	}
	vector<string> str(4);
	for(int i = 0; i < 4; i++)
		str[i].resize(n);
	if(n % 2 == 0)
	{
		for(int i = 0; i < n; i++)
		{
			if(i % 4 < 2)
			{
				str[0][i] = str[2][i] = 'a';
				str[1][i] = str[3][i] = 'c';
			}
			else
			{
				str[0][i] = str[2][i] = 'b';
				str[1][i] = str[3][i] = 'd';
			}
		}
	}
	else
	{
		str[0][0] = str[1][0] = 'e';
		str[2][n - 1] = str[3][n - 1] = 'f';
		for(int i = 0; i < n - 1; i++)
		{
			if(i % 4 < 2)
			{
				str[0][i + 1] = str[2][i] = 'a';
				str[1][i + 1] = str[3][i] = 'c';
			}
			else
			{
				str[0][i + 1] = str[2][i] = 'b';
				str[1][i + 1] = str[3][i] = 'd';
			}
		}
	}
	for(int i = 0; i < 4; i++)
		cout << str[i] << endl;
	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<sstream>
#include<deque>
#include<math.h>
#include<cstring>
#include <bitset>
#include<algorithm>
#include<stdio.h>
#include<stdlib.h>

#define all(v) v.begin(),v.end()
#define mpair make_pair

using namespace std;
typedef long double ld;
const ld epsilon = 1e-9;
typedef long long ll;

int main()
{
	//freopen("bobi.in", "r", stdin);
	int n;
	cin >> n;
	if(n == 1)
	{
		cout << -1 << endl;
		return 0;
	}
	vector<string> str(4);
	for(int i = 0; i < 4; i++)
		str[i].resize(n);
	if(n % 2 == 0)
	{
		str[1][0] = str[2][0] = 'e';
		str[1][n - 1] = str[2][n - 1] = 'f';
		for(int i = 0; i < n; i++)
		{
			if(i % 4 < 2)
			{
				str[0][i] = str[3][i] = 'a';
				if(i + 1 < n - 1)
				{
					str[1][i + 1] = 'c';
					str[2][i + 1] = 'r';
				}
			}
			else
			{
				str[0][i] = str[3][i] = 'b';
				if(i + 1 < n - 1)
				{
					str[1][i + 1] = 't';
					str[2][i + 1] = 'u';
				}
			}
		}
	}
	else
	{
		str[0][0] = str[1][0] = 'e';
		str[2][n - 1] = str[3][n - 1] = 'f';
		for(int i = 0; i < n - 1; i++)
		{
			if(i % 4 < 2)
			{
				str[0][i + 1] = str[2][i] = 'a';
				str[1][i + 1] = str[3][i] = 'c';
			}
			else
			{
				str[0][i + 1] = str[2][i] = 'b';
				str[1][i + 1] = str[3][i] = 'd';
			}
		}
	}
	for(int i = 0; i < 4; i++)
		cout << str[i] << endl;
	return 0;
}


//#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORN(i,a,b) for(int i=(a);i<=(b);i++)
#define ALL(v) (v).begin(),(v).end()
#define MP make_pair
#define PB push_back
#define FILL(v) memset(v,0,sizeof(v))
#define SQR(x) (x)*(x)
#define INF 1000*1000*1000
#define PI 3.141592653589793
#define EPS 1e-9

typedef long long int LLI;
typedef vector<int> VI;

void main()
{
		//freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
		int n;
		cin>>n;
		if (n==1)
		{
			cout<<"-1";
		}
		else
		if (n%2)
		{
			string s1,s2,s3,s4;
			s1="x";
			FOR(i,1,n)
				i%4==1 || i%4==2 ? s1+="a" : s1+="b";
			s2="x";
			FOR(i,1,n)
				i%4==1 || i%4==2 ? s2+="b" : s2+="a";
			FOR(i,0,n-1)
				i%4==0 || i%4==1 ? s3+="c" : s3+="d";
			s3+="y";
			FOR(i,0,n-1)
				i%4==0 || i%4==1 ? s4+="d" : s4+="c";
			s4+="y";
			cout<<s1<<endl<<s2<<endl<<s3<<endl<<s4;
		}
		else
		{
			string s1,s2,s3,s4;
			s1="x";
			FOR(i,1,n-1)
				i%4==1 || i%4==2 ? s1+="a" : s1+="b";
			s1+="y";
			s2="x";
			FOR(i,1,n-1)
				i%4==1 || i%4==2 ? s2+="b" : s2+="a";
			s2+="y";
			FOR(i,0,n)
				i%4==0 || i%4==1 ? s3+="c" : s3+="d";
			FOR(i,0,n)
				i%4==0 || i%4==1 ? s4+="d" : s4+="c";
			cout<<s1<<endl<<s2<<endl<<s3<<endl<<s4;
		}
}


//#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORN(i,a,b) for(int i=(a);i<=(b);i++)
#define ALL(v) (v).begin(),(v).end()
#define MP make_pair
#define PB push_back
#define FILL(v) memset(v,0,sizeof(v))
#define SQR(x) (x)*(x)
#define INF 1000*1000*1000
#define PI 3.141592653589793
#define EPS 1e-9

typedef long long int LLI;
typedef vector<int> VI;

void main()
{
		//freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
		int n;
		cin>>n;
		if (n%2)
		{
			string s1,s2,s3,s4;
			s1="x";
			FOR(i,1,n)
				i%4==1 || i%4==2 ? s1+="a" : s1+="b";
			s2="x";
			FOR(i,1,n)
				i%4==1 || i%4==2 ? s2+="b" : s2+="a";
			FOR(i,0,n-1)
				i%4==0 || i%4==1 ? s3+="c" : s3+="d";
			s3+="y";
			FOR(i,0,n-1)
				i%4==0 || i%4==1 ? s4+="d" : s4+="c";
			s4+="y";
			cout<<s1<<endl<<s2<<endl<<s3<<endl<<s4;
		}
		else
		{
			string s1,s2,s3,s4;
			s1="x";
			FOR(i,1,n-1)
				i%4==1 || i%4==2 ? s1+="a" : s1+="b";
			s1+="y";
			s2="x";
			FOR(i,1,n-1)
				i%4==1 || i%4==2 ? s2+="b" : s2+="a";
			s2+="y";
			FOR(i,0,n)
				i%4==0 || i%4==1 ? s3+="c" : s3+="d";
			FOR(i,0,n)
				i%4==0 || i%4==1 ? s4+="d" : s4+="c";
			cout<<s1<<endl<<s2<<endl<<s3<<endl<<s4;
		}
}


#!/usr/bin/env python3
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation

"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy
from typing import Dict, List, Optional, Set, Tuple

def solve(nb: int) -> Tuple[str]:
    if nb == 1:
        return []
    # base pattern
    result = ([0, 0], [1, 1], [2, None], [2, None])
    nb_cols = 2
    next_domino = 2
    for _ in range(nb - 2):
        nb_cols += 1
        next_domino = (next_domino + 1) % 26
        for i in (0, 2):
            if result[i][-1] is None:
                # append an horizontal domino
                result[i][-1] = next_domino
                result[i].append(next_domino)
                next_domino = (next_domino + 1) % 26
                result[i + 1][-1] = next_domino
                result[i + 1].append(next_domino)
            else:
                # leaves room
                result[i].append(None)
                result[i + 1].append(None)
    # complete the last col
    LOG.debug(("\n".join(map(str, result))))
    next_domino = (next_domino + 1) % 26
    for i in (0, 2):
        if result[i][-1] is None:
            result[i][-1] = next_domino
            result[i + 1][-1] = next_domino
    LOG.debug(("\n".join(map(str, result))))
    return ("".join(chr(i + ord("a")) for i in row) for row in result)

def do_job():
    "Do the work"
    LOG.debug("Start working")
    N = int(input())
    result = solve(N)
    if result:
        print("\n".join(result))
    else:
        print(-1)

def print_output(testcase: int, result) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result))
    # 6 digits float precision {:.6f} (6 is the default value)
    # print("Case #{}: {:f}".format(testcase + 1, result))

def configure_log(log_file: Optional[str] = None) -> None:
    "Configure the log output"
    log_formatter = logging.Formatter(
        "%(asctime)s - %(filename)s:%(lineno)d - " "%(levelname)s - %(message)s"
    )
    if log_file:
        handler = logging.FileHandler(filename=log_file)
    else:
        handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)

LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()

def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0

if __name__ == "__main__":
    sys.exit(main())

class memoized:
    """Decorator that caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned, and
    not re-evaluated.
    """

    def __init__(self, func):
        self.func = func
        self.cache = {}

    def __call__(self, *args):
        try:
            return self.cache[args]
        except KeyError:
            value = self.func(*args)
            self.cache[args] = value
            return value
        except TypeError:
            # uncachable -- for instance, passing a list as an argument.
            # Better to not cache than to blow up entirely.
            return self.func(*args)

    def __repr__(self):
        """Return the function's docstring."""
        return self.func.__doc__

    def __get__(self, obj, objtype):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)


#!/usr/bin/env python3
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation

"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy
from typing import Dict, List, Optional, Set, Tuple

def solve(nb: int) -> Tuple[str]:
    if nb == 1:
        return ("a", "a", "b", "b")
    # base pattern
    result = ([0, 0], [1, 1], [2, None], [2, None])
    nb_cols = 2
    next_domino = 2
    for _ in range(nb - 2):
        nb_cols += 1
        next_domino = (next_domino + 1) % 26
        for i in (0, 2):
            if result[i][-1] is None:
                # append an horizontal domino
                result[i][-1] = next_domino
                result[i].append(next_domino)
                next_domino = (next_domino + 1) % 26
                result[i + 1][-1] = next_domino
                result[i + 1].append(next_domino)
            else:
                # leaves room
                result[i].append(None)
                result[i + 1].append(None)
    # complete the last col
    LOG.debug(("\n".join(map(str, result))))
    next_domino = (next_domino + 1) % 26
    for i in (0, 2):
        if result[i][-1] is None:
            result[i][-1] = next_domino
            result[i + 1][-1] = next_domino
    LOG.debug(("\n".join(map(str, result))))
    return ("".join(chr(i + ord("a")) for i in row) for row in result)

def do_job():
    "Do the work"
    LOG.debug("Start working")
    N = int(input())
    result = solve(N)
    if result:
        print("\n".join(result))
    else:
        print(-1)

def print_output(testcase: int, result) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result))
    # 6 digits float precision {:.6f} (6 is the default value)
    # print("Case #{}: {:f}".format(testcase + 1, result))

def configure_log(log_file: Optional[str] = None) -> None:
    "Configure the log output"
    log_formatter = logging.Formatter(
        "%(asctime)s - %(filename)s:%(lineno)d - " "%(levelname)s - %(message)s"
    )
    if log_file:
        handler = logging.FileHandler(filename=log_file)
    else:
        handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)

LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()

def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0

if __name__ == "__main__":
    sys.exit(main())

class memoized:
    """Decorator that caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned, and
    not re-evaluated.
    """

    def __init__(self, func):
        self.func = func
        self.cache = {}

    def __call__(self, *args):
        try:
            return self.cache[args]
        except KeyError:
            value = self.func(*args)
            self.cache[args] = value
            return value
        except TypeError:
            # uncachable -- for instance, passing a list as an argument.
            # Better to not cache than to blow up entirely.
            return self.func(*args)

    def __repr__(self):
        """Return the function's docstring."""
        return self.func.__doc__

    def __get__(self, obj, objtype):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)


#!/usr/bin/env python3
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation

"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy
from typing import Dict, List, Optional, Set, Tuple

def solve(nb: int) -> Tuple[str]:
    if nb == 1:
        return ("a", "a", "b", "b")
    # base pattern
    result = ([0, 0], [1, 1], [2, None], [2, None])
    nb_cols = 2
    next_domino = 2
    for _ in range(nb - 2):
        nb_cols += 1
        next_domino = (next_domino + 1) % 26
        for i in (0, 2):
            if result[i][-1] is None:
                # append an horizontal domino
                result[i][-1] = next_domino
                result[i].append(next_domino)
                next_domino = (next_domino + 1) % 26
                result[i + 1][-1] = next_domino
                result[i + 1].append(next_domino)
            else:
                # leaves room for next domino (or end)
                result[i].append(None)
                result[i + 1].append(None)
    # complete the last col
    LOG.debug(("\n".join(map(str, result))))
    next_domino = (next_domino + 1) % 26
    for i in (0, 2):
        if result[i][-1] is None:
            result[i][-1] = next_domino
            result[i + 1][-1] = next_domino
    LOG.debug(("\n".join(map(str, result))))
    return ("".join(chr(i + ord("a")) for i in row) for row in result)

def do_job():
    "Do the work"
    LOG.debug("Start working")
    N = int(input())
    result = solve(N)
    if result:
        print("\n".join(result))
    else:
        print(-1)

def print_output(testcase: int, result) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result))
    # 6 digits float precision {:.6f} (6 is the default value)
    # print("Case #{}: {:f}".format(testcase + 1, result))

def configure_log(log_file: Optional[str] = None) -> None:
    "Configure the log output"
    log_formatter = logging.Formatter(
        "%(asctime)s - %(filename)s:%(lineno)d - " "%(levelname)s - %(message)s"
    )
    if log_file:
        handler = logging.FileHandler(filename=log_file)
    else:
        handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)

LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()

def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0

if __name__ == "__main__":
    sys.exit(main())

class memoized:
    """Decorator that caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned, and
    not re-evaluated.
    """

    def __init__(self, func):
        self.func = func
        self.cache = {}

    def __call__(self, *args):
        try:
            return self.cache[args]
        except KeyError:
            value = self.func(*args)
            self.cache[args] = value
            return value
        except TypeError:
            # uncachable -- for instance, passing a list as an argument.
            # Better to not cache than to blow up entirely.
            return self.func(*args)

    def __repr__(self):
        """Return the function's docstring."""
        return self.func.__doc__

    def __get__(self, obj, objtype):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)


from sys import stdin

a=int(stdin.readline())

if a%2==0:
    for b in range(0,int(a/2)):
        if b%2==0:
          if b==int(a/2)-1:
              print('aa')
          else:
              print('aa',end='')
        else:
          if b==int(a/2)-1:
            print('bb')
          else:
              print('bb', end='')
    print('c',end='')

    for d in range(0,int(a/2)-1):
        if d%2==0:
              print('dd',end='')
        else:
              print('ee', end='')

    print('f')
    print('c',end='')

    for d in range(0, int(a/2)-1):
        if d % 2 == 0:
            print('hh', end='')
        else:
            print('ii', end='')

    print('f')

    for b in range(0,int(a/2)):
        if b%2==0:
          if b==int(a/2)-1:
              print('aa')
          else:
              print('aa',end='')
        else:
          if b==int(a/2)-1:
            print('bb')
          else:
              print('bb', end='')
else:

    for b in range(0,int((a-1)/2)):
        if b%2==0:
              print('aa',end='')
        else:
              print('bb', end='')

    print('c')

    for b in range(0,int((a-1)/2)):
        if b%2==0:
              print('ee',end='')
        else:
              print('ff', end='')

    print('c')

    if a==1:
        print('d')
    else:
        print('d',end='')

    for b in range(0,int((a-1)/2)):
        if b%2==0:
          if b==int((a-1)/2)-1:
              print('bb')
          else:
              print('bb',end='')
        else:
          if b==int((a-1)/2)-1:
            print('aa')
          else:
              print('aa', end='')

    if a==1:
        print('d')
    else:
        print('d',end='')

    for b in range(0,int((a-1)/2)):
        if b%2==0:
          if b==int((a-1)/2)-1:
              print('ee')
          else:
              print('ee',end='')
        else:
          if b==int((a-1)/2)-1:
            print('ff')
          else:
              print('ff', end='')


from sys import stdin

a=int(stdin.readline())

if a%2==0:
    for b in range(0,int(a/2)):
        if b%2==0:
          if b==int(a/2)-1:
              print('aa')
          else:
              print('aa',end='')
        else:
          if b==int(a/2)-1:
            print('bb')
          else:
              print('bb', end='')
    print('c',end='')

    for d in range(0,int(a/2)-1):
        if d%2==0:
              print('dd',end='')
        else:
              print('ee', end='')

    print('f')
    print('c',end='')

    for d in range(0, int(a/2)-1):
        if d % 2 == 0:
            print('ee', end='')
        else:
            print('dd', end='')

    print('f')

    for b in range(0,int(a/2)):
        if b%2==0:
          if b==int(a/2)-1:
              print('aa')
          else:
              print('aa',end='')
        else:
          if b==int(a/2)-1:
            print('bb')
          else:
              print('bb', end='')
else:

    for b in range(0,int((a-1)/2)):
        if b%2==0:
              print('aa',end='')
        else:
              print('bb', end='')

    print('c')

    for b in range(0,int((a-1)/2)):
        if b%2==0:
              print('bb',end='')
        else:
              print('aa', end='')

    print('c')

    if a==1:
        print('d')
    else:
        print('d',end='')

    for b in range(0,int((a-1)/2)):
        if b%2==0:
          if b==int((a-1)/2)-1:
              print('bb')
          else:
              print('bb',end='')
        else:
          if b==int((a-1)/2)-1:
            print('aa')
          else:
              print('aa', end='')

    if a==1:
        print('d')
    else:
        print('d',end='')

    for b in range(0,int((a-1)/2)):
        if b%2==0:
          if b==int((a-1)/2)-1:
              print('aa')
          else:
              print('aa',end='')
        else:
          if b==int((a-1)/2)-1:
            print('bb')
          else:
              print('bb', end='')


from sys import stdin

a=int(stdin.readline())

if a%2==0:
    for b in range(0,int(a/2)):
        if b%2==0:
          if b==int(a/2)-1:
              print('aa')
          else:
              print('aa',end='')
        else:
          if b==int(a/2)-1:
            print('bb')
          else:
              print('bb', end='')
    print('c',end='')

    for d in range(0,int(a/2)-1):
        if d%2==0:
              print('dd',end='')
        else:
              print('ee', end='')

    print('f')
    print('c',end='')

    for d in range(0, int(a/2)-1):
        if d % 2 == 0:
            print('ee', end='')
        else:
            print('dd', end='')

    print('f')

    for b in range(0,int(a/2)):
        if b%2==0:
          if b==int(a/2)-1:
              print('aa')
          else:
              print('aa',end='')
        else:
          if b==int(a/2)-1:
            print('bb')
          else:
              print('bb', end='')
else:

    for b in range(0,int((a-1)/2)):
        if b%2==0:
          if b==int((a-1)/2)-1:
              print('aa')
          else:
              print('aa',end='')
        else:
          if b==int((a-1)/2)-1:
            print('bb')
          else:
              print('bb', end='')

    print('c')

    for b in range(0,int((a-1)/2)):
        if b%2==0:
          if b==int((a-1)/2)-1:
              print('bb')
          else:
              print('bb',end='')
        else:
          if b==int((a-1)/2)-1:
            print('aa')
          else:
              print('aa', end='')

    print('c')

    if a==1:
        print('d')
    else:
        print('d',end='')

    for b in range(0,int((a-1)/2)):
        if b%2==0:
          if b==int((a-1)/2)-1:
              print('bb')
          else:
              print('bb',end='')
        else:
          if b==int((a-1)/2)-1:
            print('aa')
          else:
              print('aa', end='')

    if a==1:
        print('d')
    else:
        print('d',end='')

    for b in range(0,int((a-1)/2)):
        if b%2==0:
          if b==int((a-1)/2)-1:
              print('aa')
          else:
              print('aa',end='')
        else:
          if b==int((a-1)/2)-1:
            print('bb')
          else:
              print('bb', end='')


n = int(input())

k = n // 4

if n % 2:

    if (n - 1) % 4:

        a = 'aabb' * k + 'aac'

        b = 'bbaa' * k + 'bbc'

        c = 'dee' + 'ffee' * k

        d = 'dff' + 'eeff' * k

    else:

        a = 'aabb' * k + 'c'

        b = 'bbaa' * k + 'c'

        c = 'd' + 'ffee' * k

        d = 'd' + 'eeff' * k

    print('\n'.join((a, b, c, d)))

else:

    if n % 4:

        a = 'aabb' * k + 'aa'

        b = 'c' + 'ddcc' * k + 'd'

        c = 'c' + 'eeff' * k + 'd'

    else:

        a = 'aabb' * k

        b = 'c' + 'ddcc' * (k - 1) + 'ddc'

        c = 'c' + 'eeff' * (k - 1) + 'eec'

    print('\n'.join((a, b, c, a)))


def computeTiling(n):
    printEvenLengthTiling(n) if isEven(n) else printOddLengthTiling(n)

def isEven(n):
    return n%2 == 0

def printEvenLengthTiling(n):
    print(buildRowFromPattern( '', 'nnoo',  '', n))
    print(buildRowFromPattern('l', 'xxzz', 'f', n))
    print(buildRowFromPattern('l', 'zzxx', 'f', n))
    print(buildRowFromPattern( '', 'nnoo',  '', n))

def printOddLengthTiling(n):
    print(buildRowFromPattern('l', 'xxzz',  '', n))
    print(buildRowFromPattern('l', 'zzxx',  '', n))
    print(buildRowFromPattern( '', 'nnoo', 'f', n))
    print(buildRowFromPattern( '', 'oonn', 'f', n))

def buildRowFromPattern(prefix, infix, suffix, n):
    return "".join(applyPattern(prefix, infix, suffix, n))

def applyPattern(prefix, infix, suffix, n):
    n = n - bool(prefix) - bool(suffix)
    yield prefix
    yield from extendInfix(infix, n)
    yield suffix

def extendInfix(infix, n):
    repetitions, reminder = divmod(n, len(infix))
    for rep in range(repetitions):
        yield infix
    yield infix[:reminder]

if __name__ == '__main__':
    n = int(input())
    computeTiling(n)


def computeTiling(n):
    if n == 1:
        print("a\na\nf\nf")
        return

    for tiling in generateRowTilings(n):
        print("".join(tiling))

def generateRowTilings(n):
    for (rowNum, firstTile, pattern) in generateRowTilingPatterns(n):
        yield makeRowTiling(rowNum, firstTile, pattern, n)

def generateRowTilingPatterns(n):
    rows = (1, 2, 3, 4)
    firstTiles = ('a', 'a', 'd', 'e')
    patterns = ('bbcc', 'ccbb', 'deed', 'edde')
    return zip(rows, firstTiles, patterns)

def makeRowTiling(row, prefix, pattern, n):
    yield prefix
    yield from (pattern[i%4] for i in range(n-2))
    yield pattern[(n-2)%4] if (n%2 != (row-1)//2) else 'f'

if __name__ == '__main__':
    n = int(input())
    computeTiling(n)


n = int(input())
k = n // 4
if n % 2:
    if (n - 1) % 4:
        a = 'aabb' * k + 'aac'
        b = 'bbaa' * k + 'bbc'
        c = 'dee' + 'ffee' * k
        d = 'dff' + 'eeff' * k
    else:
        a = 'aabb' * k + 'c'
        b = 'bbaa' * k + 'c'
        c = 'd' + 'ffee' * k
        d = 'd' + 'eeff' * k
    print('\n'.join((a, b, c, d)))
else:
    if n % 4:
        a = 'aabb' * k + 'aa'
        b = 'c' + 'ddcc' * k + 'd'
        c = 'c' + 'eeff' * k + 'd'
    else:
        a = 'aabb' * k
        b = 'c' + 'ddcc' * (k - 1) + 'ddc'
        c = 'c' + 'eeff' * (k - 1) + 'eec'
    print('\n'.join((a, b, c, a)))


N = gets.to_i

#01234567
#aaffaaff
#bbggbbgg
#cddhhcchh
#ceeiiddii

str = []
str[0] = "aaff" * 25
str[1] = "bbgg" * 25
str[2] = "cdd" + "hhcc" * 25
str[3] = "cee" + "iidd" * 25

if N == 1
  print "a\na\nb\nb\n"
elsif N == 2
  puts "aa"
  puts "bb"
  puts "cd"
  puts "cd"
else
  p str
  if (N % 2 == 1)
    str[1][N - 1] = str[0][N - 1]
  else
    str[3][N - 1] = str[2][N - 1]
  end
  4.times do |i|
    puts str[i][0..(N - 1)]
  end
end


N = gets.to_i

#01234567
#aaffaaff
#bbggbbgg
#cddhhcchh
#ceeiiddii

str = []
str[0] = "aaff" * 25
str[1] = "bbgg" * 25
str[2] = "cdd" + "hhcc" * 25
str[3] = "cee" + "iidd" * 25

if N == 1
  print "a\na\nb\nb\n"
elsif N == 2
  puts "aa"
  puts "bb"
  puts "cd"
  puts "cd"
else
#  p str
  if (N % 2 == 1)
    str[1][N - 1] = str[0][N - 1]
  else
    str[3][N - 1] = str[2][N - 1]
  end
  4.times do |i|
    puts str[i][0..(N - 1)]
  end
end


n = gets.to_i

def dig2str(dig)
    p = 'a'
    (dig%26).times { p = p.succ }
    p
end

def solve(n)
    return ['a', 'a', 'b', 'b'] if n == 1
    return ['aa', 'bb', 'cc', 'dd'] if n == 2
    a = Array.new(4) { Array.new(n) }
    dig = 0
    0.step(n-2, 2) do |i|
        a[0][i] = a[0][i+1] = dig2str(dig)
        dig += 1
        a[1][i] = a[1][i+1] = dig2str(dig)
        dig += 1
    end
    dig = 10
    1.step(n-2, 2) do |i|
        a[2][i] = a[2][i+1] = dig2str(dig)
        dig += 1
        a[3][i] = a[3][i+1] = dig2str(dig)
        dig += 1
    end
    if n%2==0
        a[2][-1] = a[3][-1] = dig2str(dig)
    else
        a[0][-1] = a[1][-1] = dig2str(dig)
    end
    a[2][0] = a[3][0] = dig2str(9)
    return a.map(&:join)
end

puts solve(n)


def build_line(s1, s2, len)
  (1..len).map { |i| i.odd? ? s1 : s2 }.join ''
end

def build_odd(n)
  line1 = build_line('aa', 'bb', (n - 1) / 2)
  line2 = build_line('cc', 'dd', (n - 1) / 2)
  puts line1 + 'x'
  puts line2 + 'x'
  puts 'y' + line1
  puts 'y' + line2
end

def build_even(n)
  line1 = build_line('aa', 'bb', n / 2)
  puts line1
  puts 'x' + build_line('cc', 'dd', n / 2 - 1) + 'y'
  puts 'x' + build_line('ee', 'ff', n / 2 - 1) + 'y'
  puts line1
end

n = gets.to_i
if n.odd?
  build_odd(n)
else
  build_even(n)
end


import sys

n=int(sys.stdin.readline().strip())

res = [[False]*n for i in range(4)]

def bestc(r,c):
	for ch in map(chr,range(ord('a'),ord('z')+1)):
		if r>0 and res[r-1][c]==ch: continue
		if r<3 and res[r+1][c]==ch: continue
		if c<n-1 and res[r][c+1]==ch: continue
		if c>0 and res[r][c-1]==ch: continue
		return ch
	return -1

def even_solve(n):
	global res
	r,c=0,0
	while r<4:
		c=0
		while c<n:
			if r==1 and (c==0 or c==n-1):
				cur=bestc(r,c)
				res[r][c]=cur
				res[r+1][c]=cur
			elif r==1 or r==2:
				if c%2==1 and c<n-1:
					cur=bestc(r,c)
					res[r][c]=cur
					res[r][c+1]=cur
			elif r==0 or r==3:
				if c%2==0:
					cur=bestc(r,c)
					res[r][c]=cur
					res[r][c+1]=cur
			c+=1
		r+=1
	return

def odd_solve(n):
	global res
	r,c=0,0
	while r<4:
		c=0
		while c<n:
			if r==0 and c==n-1:
				cur=bestc(r,c)
				res[r][c]=cur
				res[r+1][c]=cur
			elif r==2 and c==0:
				cur=bestc(r,c)
				res[r][c]=cur
				res[r+1][c]=cur
			elif (r==0 or r==1) and c%2==0 and c<n-1:
				cur=bestc(r,c)
				res[r][c]=cur
				res[r][c+1]=cur
			elif (r==2 or r==3) and c%2==1 and c>0:
				cur=bestc(r,c)
				res[r][c]=cur
				res[r][c+1]=cur
			c+=1
		r+=1
	return

if n%2==0:
	even_solve(n)
else:
	odd_solve(n)

for r in res:
	print ''.join(map(str,r))


import sys

n=int(sys.stdin.readline().strip())

res = [[False]*n for i in range(4)]

def bestc(r1,c1,r2,c2):
	for ch in map(chr,range(ord('a'),ord('z')+1)):
		if r1>0 and res[r1-1][c1]==ch: continue
		if r1<3 and res[r1+1][c1]==ch: continue
		if c1<n-1 and res[r1][c1+1]==ch: continue
		if c1>0 and res[r1][c1-1]==ch: continue
		if r2>0 and res[r2-1][c2]==ch: continue
		if r2<3 and res[r2+1][c2]==ch: continue
		if c2>0 and res[r2][c2-1]==ch: continue
		if c2<n-1 and res[r2][c2+1]==ch: continue
		return ch
	return -1

def even_solve(n):
	global res
	r,c=0,0
	while r<4:
		c=0
		while c<n:
			if r==1 and (c==0 or c==n-1):
				cur=bestc(r,c,r+1,c)
				res[r][c]=cur
				res[r+1][c]=cur
			elif r==1 or r==2:
				if c%2==1 and c<n-1:
					cur=bestc(r,c,r,c+1)
					res[r][c]=cur
					res[r][c+1]=cur
			elif r==0 or r==3:
				if c%2==0:
					cur=bestc(r,c,r,c+1)
					res[r][c]=cur
					res[r][c+1]=cur
			c+=1
		r+=1
	return

def odd_solve(n):
	global res
	r,c=0,0
	while r<4:
		c=0
		while c<n:
			if r==0 and c==n-1:
				cur=bestc(r,c,r+1,c)
				res[r][c]=cur
				res[r+1][c]=cur
			elif r==2 and c==0:
				cur=bestc(r,c,r+1,c)
				res[r][c]=cur
				res[r+1][c]=cur
			elif (r==0 or r==1) and c%2==0 and c<n-1:
				cur=bestc(r,c,r,c+1)
				res[r][c]=cur
				res[r][c+1]=cur
			elif (r==2 or r==3) and c%2==1 and c>0:
				cur=bestc(r,c,r,c+1)
				res[r][c]=cur
				res[r][c+1]=cur
			c+=1
		r+=1
	return

if n%2==0:
	even_solve(n)
else:
	odd_solve(n)

for r in res:
	print ''.join(map(str,r))


n = int(raw_input())
if 1 == n:
  print 'x'
  print 'x'
  print 'y'
  print 'y'
elif 2 == n:
  print 'xx'
  print 'yy'
  print 'xx'
  print 'yy'
else:
  s1 = 'aabb' * ((n + 3) >> 2)
  s2 = 'ccdd' * ((n + 3) >> 2)
  if n & 0x01:
    print (s1[0:n - 1] + 'x')
    print (s2[0:n - 1] + 'x')
    print ('y' + s1[0:n - 1])
    print ('y' + s2[0:n - 1])
  else:
    print s1[0:n]
    print ('x' + s2[0:n - 2] + 'y')
    print ('x' + s1[0:n - 2] + 'y')
    print s2[0:n]


def ina():
    return list(map(int, input().split()))
n = int(input())
s = ['ab', 'cd', 'ef', 'gh']
if (n % 2 == 1):
    ans = ''
    for i in range(n//2):
        ans += s[0][i%2] + s[0][i%2]
    print ans + 'i'
    ans = ''
    for i in range(n//2):
        ans += s[1][i%2] + s[1][i%2]
    print ans + 'i'
    ans = 'j'
    for i in range(n//2):
        ans += s[2][i%2] + s[2][i%2]
    print ans
    ans = 'j'
    for i in range(n//2):
        ans += s[3][i%2] + s[3][i%2]
    print ans
else:
    ans = ''
    for i in range(n//2):
        ans = s[0][i%2] + s[0][i%2]
    print ans
    ans = 'i'
    for i in range(n//2 - 1):
        ans += s[1][i%2] + s[1][i%2]
    print ans + 'j'
    ans = 'i'
    for i in range(n//2 - 1):
        ans += s[2][i%2] + s[2][i%2]
    print ans + 'j'
    ans = ''
    for i in range(n//2):
        ans += s[3][i%2] + s[3][i%2]
    print ans


def ina():
    return list(map(int, input().split()))
n = int(input())
s = ['ab', 'cd', 'ef', 'gh']
if (n % 2 == 1):
    ans = ''
    for i in range(n//2):
        ans += s[0][i%2] + s[0][i%2]
    print ans + 'i'
    ans = ''
    for i in range(n//2):
        ans += s[1][i%2] + s[1][i%2]
    print ans + 'i'
    ans = 'j'
    for i in range(n//2):
        ans += s[2][i%2] + s[2][i%2]
    print ans
    ans = 'j'
    for i in range(n//2):
        ans += s[3][i%2] + s[3][i%2]
    print ans
else:
    ans = ''
    for i in range(n//2):
        ans += s[0][i%2] + s[0][i%2]
    print ans
    ans = 'i'
    for i in range(n//2 - 1):
        ans += s[1][i%2] + s[1][i%2]
    print ans + 'j'
    ans = 'i'
    for i in range(n//2 - 1):
        ans += s[2][i%2] + s[2][i%2]
    print ans + 'j'
    ans = ''
    for i in range(n//2):
        ans += s[3][i%2] + s[3][i%2]
    print ans


n = int(raw_input())
res = [['.' for i in xrange(n)] for j in xrange(4)]
a = 'qwertyuiopasdfghjklzxcvbnm'

o = 0
def place(c, r, h):
	global o, res
	o += 1
	o %= 26
	res[r][c] = a[o]
	if h: c += 1
	else: r += 1
	res[r][c] = a[o]

place(0, 0, False)
for i in xrange(n - 1):
	if i % 2 == 0:
		place(i, 2, True)
		place(i, 3, True)
	else:
		place(i, 0, True)
		place(i, 1, True)
if n % 2 == 1:
	place(n - 1, 2, False)
else:
	place(n - 1, 0, False)

print "\n".join(["".join(x) for x in res])


n = input()

if n & 1:
    print ('kkll' * n)[ : n - 1] + 'b'
    print ('llkk' * n)[ : n - 1] + 'b'
    print 'a' + ('mmnn' * n)[ : n - 1]
    print 'a' + ('nnmm' * n)[ : n - 1]
else:
    print ('kkll' * n)[ : n]
    print 'b' + ('mmnn' * n)[ : n - 2] + 'a'
    print 'b' + ('kkll' * n)[ : n - 2] + 'a'
    print ('mmnn' * n)[ : n]


n = input()

if n < 3:
    print -1
else:
    print 'yyxx'
    print 'azzb'
    print 'awwb'
    j = 0
    for i in range(n-3):
        if i%2 == 0:
            print 'gghh'
        else:
            print 'hhgg'


n = input()
def func(color, fb):
    s = ""
    lp = n-len(fb)
    for i in xrange(lp):
        s += color[i/2%3]
    if fb == "f":
        s = "x" + s
    elif fb == "b":
        s += "x"
    elif fb == "fb":
        s = "x" + s + "y"
    print s
if n == 1:
    print -1
elif n % 2 == 0:
    func("rgb", "")
    func("lmn", "fb")
    func("stu", "fb")
    func("rgb", "")
else:
    func("rgb", "b")
    func("lmn", "b")
    func("stu", "f")
    func("rgb", "f")


n = input()
def func(color, fb):
    s = ""
    lp = n-len(fb)
    for i in xrange(lp):
        s += color[i/2%3]
    if fb == "f":
        s = "x" + s
    elif fb == "b":
        s += "x"
    elif fb == "fb":
        s = "x" + s + "x"
    print s
if n == 1:
    print -1
elif n % 2 == 0:
    func("rgb", "")
    func("lmn", "fb")
    func("stu", "fb")
    func("rgb", "")
else:
    func("rgb", "b")
    func("lmn", "b")
    func("stu", "f")
    func("rgb", "f")


n = input()
def func(flg, color):
    s = "" if flg else "x"
    lp = n if flg else n-2
    for i in xrange(lp):
        s += color[i/2%3]
    if not flg:
        s += "y"
    print s
func(True, "rgb")
func(False, "lmn")
func(False, "stu")
func(True, "rgb")


n = input()
if n == 1:
    print -1
elif n == 2:
    print "aa\nbc\nbc\ndd"
else:
    t = n/2
    while abs(t-(n-t*2)) > 1:
        t -= 1
    o = n-t*2
    front = ["" for i in xrange(4)]
    back = ["" for i in xrange(4)]
    if t > o:
        front = ["gg", "hh", "ii", "jj"]
    elif t < o:
        back = ["k", "k", "m", "m"]
    s = ["abb", "acc", "dee","dff"]
    t = min(t, o)
    for i in xrange(4):
        print front[i] + s[i]*t + back[i]


n = input()
def func(flg):
    color = "rgb" if flg else "lmn"
    s = "" if flg else "x"
    lp = n if flg else n-2
    for i in xrange(lp):
        s += color[i/2%3]
    if not flg:
        s += "y"
    print s
func(True)
func(False)
func(False)
func(True)


n = input()
def func(color, fb):
    s = ""
    lp = n-len(fb)
    for i in xrange(lp):
        s += color[i/2%3]
    if fb == "f":
        s = "x" + s
    elif fb == "b":
        s += "x"
    elif fb == "fb":
        s = "x" + s + "y"
    print s
if n == 1:
    print "a\na\nb\nb\n"

elif n % 2 == 0:
    func("rgb", "")
    func("lmn", "fb")
    func("stu", "fb")
    func("rgb", "")
else:
    func("rgb", "b")
    func("lmn", "b")
    func("stu", "f")
    func("rgb", "f")


import sys
n = input()
if n==1:
    print 'a\na\nb\nb'
    sys.exit(0)
f = lambda s,n: list((s*n)[:n])
l1 = f('aabb',n)
l2 = f('ddee',n)
l3 = ['z']+f('ffgg',n-1)
l4 = ['z']+f('hhii',n-1)
if n&1: l2[-1]=l1[-1] = 'c'
else: l4[-1]=l3[-1] = 'x'
print ''.join(l1)
print ''.join(l2)
if n==2:
    print 'ff\ngg'
    sys.exit(0)
print ''.join(l3)
print ''.join(l4)


s = raw_input()
st = []
for c in s:
    if st and c==st[-1]: st.pop()
    else: st.append(c)
print ''.join(st)


n = int(raw_input())

if n%2 == 0:
	line = ['aa' if i%2 == 0 else 'bb' for i in range(n/2)]
	print ''.join(line)
	line = ['cc' if i%2 == 0 else 'dd' for i in range(n/2 - 1)]
	print 'e' + ''.join(line) + 'f'
	line = ['aa' if i%2 == 0 else 'bb' for i in range(n/2 - 1)]
	print 'e' + ''.join(line) + 'f'
	line = ['cc' if i%2 == 0 else 'dd' for i in range(n/2)]
	print ''.join(line)
else:
	line = ['aa' if i%2 == 0 else 'bb' for i in range(n/2)]
	print ''.join(line) + 'e'
	line = ['cc' if i%2 == 0 else 'dd' for i in range(n/2)]
	print ''.join(line) + 'e'
	line = ['aa' if i%2 == 0 else 'bb' for i in range(n/2)]
	print 'g' + ''.join(line)
	line = ['cc' if i%2 == 0 else 'dd' for i in range(n/2)]
	print 'g' + ''.join(line)


n = int(raw_input())

if n == 1:
	print '-1'
else:
	if n%2 == 0:
		line = ['aa' if i%2 == 0 else 'bb' for i in range(n/2)]
		print ''.join(line)
		line = ['cc' if i%2 == 0 else 'dd' for i in range(n/2 - 1)]
		print 'e' + ''.join(line) + 'f'
		line = ['aa' if i%2 == 0 else 'bb' for i in range(n/2 - 1)]
		print 'e' + ''.join(line) + 'f'
		line = ['cc' if i%2 == 0 else 'dd' for i in range(n/2)]
		print ''.join(line)
	else:
		line = ['aa' if i%2 == 0 else 'bb' for i in range(n/2)]
		print ''.join(line) + 'e'
		line = ['cc' if i%2 == 0 else 'dd' for i in range(n/2)]
		print ''.join(line) + 'e'
		line = ['aa' if i%2 == 0 else 'bb' for i in range(n/2)]
		print 'g' + ''.join(line)
		line = ['cc' if i%2 == 0 else 'dd' for i in range(n/2)]
		print 'g' + ''.join(line)


#!/usr/bin/python

n = input()
if n == 1:
	print "a"
	print "a"
	print "b"
	print "b"
	exit()
if n == 3:
	print "aab"
	print "cdb"
	print "cde"
	print "ffe"
	exit()
if n == 2:
	print "aa"
	print "bc"
	print "bc"
	print "dd"
	exit()
table = [[ "" for i in xrange(n)] for j in xrange(4)]
moji = 97
nn = 0
if n % 2 == 0:
	for i in xrange(4):
		for j in xrange(n):
			if i == 0:
				table[i][j] = chr(moji)
				nn += 1
				if nn == 2:
					nn = 0
					moji += 1
					if moji == 122:
						moji = 97
			elif i == 1:
				if j == 0 or j == n-1:
					table[i][j] = chr(moji)
					if table[i][j] == table[i-1][j]:
						moji += 1
						table[i][j] = chr(moji)
					moji += 1
					if moji == 122:
						moji = 97
				else:
					table[i][j] = chr(moji)
					if table[i][j] == table[i-1][j]:
						moji += 1
						table[i][j] = chr(moji)
					nn += 1
					if nn == 2:
						nn = 0
						moji += 1
						if moji == 122:
							moji = 97
			elif i == 2:
				if j == 0 or j == n-1:
					table[i][j] = table[i-1][j]
				else:
					table[i][j] = chr(moji)
					nn += 1
					if nn == 2:
						nn = 0
						moji += 1
						if moji == 122:
							moji = 97
			elif i == 3:
				table[i][j] = chr(moji)
				if table[i][j] == table[i-1][j]:
					moji += 1
					table[i][j] = chr(moji)
				nn += 1
				if nn == 2:
					nn = 0
					moji += 1
					if moji == 122:
						moji = 97
	ans = ["" for i in xrange(4)]
	for i in xrange(4):
		for j in xrange(n):
			ans[i] += table[i][j]
	for i in xrange(4):
		print ans[i]
	exit()
moji = 97
nn = 0
if n % 2 != 0:
	for i in xrange(4):
		for j in xrange(n):
			if i == 0:
				if i == n -1:
					table[i][j] = chr(moji+1)
					continue
				table[i][j] = chr(moji)
				nn += 1
				if nn == 2:
					nn = 0
					moji += 1
					if moji == 122:
						moji = 97
			elif i == 1:
				if j == 0 or j == n-2:
					table[i][j] = chr(moji)
					nn = 0
					if table[i][j] == table[i-1][j]:
						moji += 1
						table[i][j] = chr(moji)
					moji += 1
					if moji == 122:
						moji = 97
				elif j == n - 1:
					table[i][j] = table[i-1][j]
				else:
					table[i][j] = chr(moji)
					if table[i][j] == table[i-1][j]:
						moji += 1
						table[i][j] = chr(moji)
					nn += 1
					if nn == 2:
						nn = 0
						moji += 1
						if moji == 122:
							moji = 97
			elif i == 2:
				if j == 0 or j == n-2:
					table[i][j] = table[i-1][j]
				else:
					table[i][j] = chr(moji)
					nn += 1
					if nn == 2:
						nn = 0
						moji += 1
						if moji == 122:
							moji = 97
			elif i == 3:
				if j == 0:
					nn = 0
				if j == n -1:
					table[i][j] = table[i-1][j]
					continue
				table[i][j] = chr(moji)
				if table[i][j] == table[i-1][j]:
					moji += 1
					table[i][j] = chr(moji)
				nn += 1
				if nn == 2:
					nn = 0
					moji += 1
					if moji == 122:
					 moji = 97
	ans = ["" for i in xrange(4)]
	for i in xrange(4):
		for j in xrange(n):
			ans[i] += table[i][j]
	for i in xrange(4):
		print ans[i]


#!/usr/local/bin/python

n = input()
if n == 1:
        print "a"
        print "a"
        print "b"
        print "c"
elif n == 2:
        print "aa"
        print "bb"
        print "aa"
        print "bb"
elif n == 3:
        print "aab"
        print "ccb"
        print "baa"
        print "bcc"
elif n % 2 != 0:
        print ("aabb" * 50)[:n-1] + "c"
        print ("bbaa" * 50)[:n-1] + "c"
        print "c" + ("ddee" * 50)[:n-1]
        print "c" + ("eedd" * 50)[:n-1]

else:
        print ("aabb" * 50)[:n]
        print ("bbaa" * 50)[:n]
        print "c" + ("ddee" * 50)[:n-2] + "c"
        print "c" + ("eedd" * 50)[:n-2] + "c"


#!/usr/bin/python

n = input()
if n % 2 != 0:
	print -1
	exit()

table = [[ "" for i in xrange(n)] for j in xrange(4)]

moji = 97
nn = 0
for i in xrange(4):
	for j in xrange(n):
		if i == 0:
			table[i][j] = chr(moji)
			nn += 1
			if nn == 2:
				nn = 0
				moji += 1
				if moji == 122:
					moji = 97
		elif i == 1:
			if j == 0 or j % 3 == 0:
				table[i][j] = chr(moji)
				if table[i][j] == table[i-1][j]:
					moji += 1
					table[i][j] = chr(moji)
				moji += 1
				if moji == 122:
					moji = 97
			else:
				table[i][j] = chr(moji)
				if table[i][j] == table[i-1][j]:
					moji += 1
					table[i][j] = chr(moji)
				nn += 1
				if nn == 2:
					nn = 0
					moji += 1
					if moji == 122:
						moji = 97
		elif i == 2:
			if j == 0 or j % 3 == 0:
				table[i][j] = table[i-1][j]
			else:
				table[i][j] = chr(moji)
				nn += 1
				if nn == 2:
					nn = 0
					moji += 1
					if moji == 122:
						moji = 97
		elif i == 3:
			table[i][j] = chr(moji)
			if table[i][j] == table[i-1][j]:
				moji += 1
				table[i][j] = chr(moji)
			nn += 1
			if nn == 2:
				nn = 0
				moji += 1
				if moji == 122:
					moji = 97

ans = ["" for i in xrange(4)]
for i in xrange(4):
	for j in xrange(n):
		ans[i] += table[i][j]

for i in xrange(4):
	print ans[i]


#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {

	short count = 0;
	short member = 0;
	short distance1 = 1;
	short distance2 = 1;
	int n; // num elements of array

	scanf("%u", &n);

	int *Array = new int[n]; // Declaring Dynamic Array

	for (count = 0; count < n; count++) scanf("%d", &Array[count]); // filling array

	count = 0;
	int min = Array[count];
	count++;
	// Search minima :
	while (count < n) {

		if (Array[count] != 1) {

			if (Array[count] < min) {

				min = Array[count];
				member = count;

			}

			count++;
		}

		else {

			min = Array[count];
			member = count;
			break;

		}
	}
	// Search NEAREST minima :
	count = member + 1;

	while (Array[count] != min) {

		distance1++;
		count++;

	}

	count++;

	if (distance1 != 1) {

		while (count < n) {

			while (Array[count] != min) {

				distance2++;
				count++;

			}

			if (count + 1 != n) {

				if (distance2 < distance1) {

					distance1 = distance2;
					distance2 = 1;
					count++;

				}

				else count++;

			}

			else {

				if (distance1 > distance2) {

					distance1 = distance2;
					distance2 = 1;

				}

				break;

			}
		}

		printf("%u", distance1);

	}

	else printf("%u", distance1);

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {

	short count = 0;
	short member = 0;
	short distance1 = 1;
	short distance2 = 1;
	int n; // num elements of array

	scanf("%u", &n);

	int *Array = new int[n]; // Declaring Dynamic Array

	for (count = 0; count < n; count++) scanf("%d", &Array[count]); // filling array

	count = 0;
	int min = Array[count];
	count++;
	// Search minima :
	while (count < n) {

		if (Array[count] != 1) {

			if (Array[count] < min) {

				min = Array[count];
				member = count;

			}

			count++;
		}

		else {

			min = Array[count];
			member = count;
			break;

		}
	}
	// Search NEAREST minima :
	count = member + 1;

	while (Array[count] != min) {

		distance1++;
		count++;

	}

	if (distance1 != 1) {

		while (count < n) {

			while (Array[count] != min) {

				distance2++;
				count++;

			}

			if (distance2 < distance1) {

				distance1 = distance2;
				distance2 = 1;
				count++;

			}

			else count++;

		}

		printf("%u", distance1);

	}

	else printf("%u", distance1);

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {

	int count = 0;
	int member = 0;
	int distance1 = 1;
	int distance2 = 1;
	int n; // num elements of array

	scanf("%u", &n);

	int *Array = new int[n]; // Declaring Dynamic Array

	for (count = 0; count < n; count++) scanf("%d", &Array[count]); // filling array

	count = 0;
	int min = Array[count];
	// Search minima :
	while (count < n) {

		if (Array[count] != 1) {

			if (Array[count] < min) {

				min = Array[count];
				member = count;

			}

			count++;
		}

		else {

			min = Array[count];
			member = count;
			break;

		}
	}
	// Search NEAREST minima :
	count = member + 1;

	while (Array[count] != min) {

		distance1++;
		count++;

	}

	count++;

	if (distance1 != 1) {

		while (count < n) {

			while (Array[count] != min && count != n) {

				distance2++;
				count++;

			}

			if (count + 1 != n) {

				if (distance2 < distance1) {

					distance1 = distance2;
					distance2 = 1;
					count++;

				}

				else {

					distance2 = 1;
					count++;

				}
			}

			else {

				if (distance1 > distance2 && distance2 != 1) {

					distance1 = distance2;
					distance2 = 1;

				}

				break;

			}
		}

		printf("%u", distance1);

	}

	else printf("%u", distance1);

	delete Array;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {

	int count = 0;
	int member = 0;
	int distance1 = 1;
	int distance2 = 1;
	int n; // num elements of array

	scanf("%u", &n);

	int *Array = new int[n]; // Declaring Dynamic Array

	for (count = 0; count < n; count++) scanf("%d", &Array[count]); // filling array

	count = 0;
	int min = Array[count];
	// Search minima :
	while (count < n) {

		if (Array[count] != 1) {

			if (Array[count] < min) {

				min = Array[count];
				member = count;

			}

			count++;
		}

		else {

			min = Array[count];
			member = count;
			break;

		}
	}
	// Search NEAREST minima :
	count = member + 1;

	while (Array[count] != min) {

		distance1++;
		count++;

	}

	count++;

	if (distance1 != 1 && count + 1 != n) {

		while (count < n) {

			while (Array[count] != min && count != n) {

				distance2++;
				count++;

			}

			if (count + 1 != n) {

				if (distance2 < distance1) {

					distance1 = distance2;
					distance2 = 1;
					count++;

				}

				else {

					distance2 = 1;
					count++;

				}
			}

			else {

				if (distance1 > distance2 && distance2 != 1) {

					distance1 = distance2;
					distance2 = 1;

				}

				break;

			}
		}

		printf("%u", distance1);

	}

	else printf("%u", distance1);

	delete Array;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {

	int count = 0;
	int member = 0;
	int distance1 = 1;
	int distance2 = 1;
	int n; // num elements of array

	scanf("%u", &n);

	int *Array = new int[n]; // Declaring Dynamic Array

	for (count = 0; count < n; count++) scanf("%d", &Array[count]); // filling array

	count = 0;
	int min = Array[count];
	// Search minima :
	while (count < n) {

		if (Array[count] != 1) {

			if (Array[count] < min) {

				min = Array[count];
				member = count;

			}

			count++;
		}

		else {

			min = Array[count];
			member = count;
			break;

		}
	}
	// Search NEAREST minima :
	count = member + 1;

	while (Array[count] != min) {

		distance1++;
		count++;

	}

	count++;

	if (distance1 != 1 && count + 1 != n) {

		while (count < n) {

			while (Array[count] != min && count != n) {

				distance2++;
				count++;

			}

			if (count + 1 != n) {

				if (Array[count] == min) {

					if (distance2 < distance1) {

						distance1 = distance2;
						distance2 = 1;
						count++;

					}

					else {

						distance2 = 1;
						count++;

					}
				}
			}

			else {

				if (distance1 > distance2 && distance2 != 1) {

					distance1 = distance2;
					distance2 = 1;

				}

				break;

			}
		}

		printf("%u", distance1);

	}

	else printf("%u", distance1);

	delete Array;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {

	int count = 0;
	int member = 0;
	int distance1 = 1;
	int distance2 = 1;
	int n; // num elements of array

	scanf("%u", &n);

	int *Array = new int[n]; // Declaring Dynamic Array

	for (count = 0; count < n; count++) scanf("%d", &Array[count]); // filling array

	count = 0;
	int min = Array[count];
	count++;
	// Search minima :
	while (count < n) {

		if (Array[count] != 1) {

			if (Array[count] < min) {

				min = Array[count];
				member = count;

			}

			count++;
		}

		else {

			min = Array[count];
			member = count;
			break;

		}
	}
	// Search NEAREST minima :
	count = member + 1;

	while (Array[count] != min) {

		distance1++;
		count++;

	}

	count++;

	if (distance1 != 1) {

		while (count < n) {

			while (Array[count] != min && count != n) {

				distance2++;
				count++;

			}

			if (count + 1 != n) {

				if (distance2 < distance1) {

					distance1 = distance2;
					distance2 = 1;
					count++;

				}

				else {

					distance2 = 1;
					count++;

				}
			}

			else {

				if (distance1 > distance2) {

					distance1 = distance2;
					distance2 = 1;

				}

				break;

			}
		}

		printf("%u", distance1);

	}

	else printf("%u", distance1);

	delete Array;
	return 0;
}


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

int main()
{
    int n,long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n-1;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int max1=0;
    for(int i=0;i<vec.size()-1;i++)
    {
        max1=max(max1,a[occ[i+1]]-a[occ[i]])
    }

    cout<<max1;
    return 0;
}


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

int main()
{
    int n;long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n-1;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int max1=0;
    for(int i=0;i<occ.size()-1;i++)
    {
        max1=max(max1,a[occ[i+1]]-a[occ[i]])
    }

    cout<<max1;
    return 0;
}


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

int main()
{
    int n;long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int max1=0;
    for(int i=0;i<occ.size()-1;i++)
    {
        max1=(max1>a[occ[i+1]]-a[occ[i]]?max1:a[occ[i+1]]-a[occ[i]]);
    }

    cout<<max1;
    return 0;
}


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

int main()
{
    int n;long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n-1;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int max1=0;
    for(int i=0;i<occ.size()-1;i++)
    {
        max1=(max1>a[occ[i+1]]-a[occ[i]]?max1:a[occ[i+1]]-a[occ[i]]);
    }

    cout<<max1;
    return 0;
}


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

int main()
{
    int n;long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n-1;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int max1=0;
    for(int i=0;i<vec.size()-1;i++)
    {
        max1=max(max1,a[occ[i+1]]-a[occ[i]])
    }

    cout<<max1;
    return 0;
}


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

int main()
{
    int n;long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int max1=0;
    for(int i=0;i<occ.size()-1;i++)
    {
        max1=(max1>occ[i+1]-occ[i]?max1:occ[i+1]-occ[i]);
    }

    cout<<max1;
    return 0;
}


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

int main()
{
    int n,long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n-1;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int max1=0;
    for(int i=0;i<occ.size()-1;i++)
    {
        max1=max(max1,a[occ[i+1]]-a[occ[i]])
    }

    cout<<max1;
    return 0;
}


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

int main()
{
    int n;long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n-1;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int max1=0;
    for(int i=0;i<occ.size()-1;i++)
    {
        max1=max(max1,a[occ[i+1]]-a[occ[i]]);
    }

    cout<<max1;
    return 0;
}


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

int main()
{
    int n;long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int min1=n;
    for(int i=0;i<occ.size()-1;i++)
    {
        min1=(min1<occ[i+1]-occ[i]?min1:occ[i+1]-occ[i]);
    }

    cout<<min1;
    return 0;
}


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

int main()
{
    int n;long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int min=n;
    for(int i=0;i<occ.size()-1;i++)
    {
        min=(min<occ[i+1]-occ[i]?min:occ[i+1]-occ[i]);
    }

    cout<<max1;
    return 0;
}


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

int main()
{
    int n;long long int a[100005];
    long long int b[100005];
    cin>>n;

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

    for(int i=0;i<n-1;i++)
    {
        if(b[i]<b[i+1])
         swap(b[i],b[i+1]);
    }
    long long int min=b[n-1];
    vector<int>occ;

     for(int i=0;i<n;i++)
    {
        if(a[i]==min)
         {
             occ.push_back(i);
         }
    }
    int min1=n;
    for(int i=0;i<occ.size()-1;i++)
    {
        min1=(min1<occ[i+1]-occ[i]?min1:occ[i+1]-occ[i]);
    }

    cout<<min;
    return 0;
}


#include <iostream>
#include<vector>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
int n;
cin>>n;
int mi=99999999999;
vector<int> vec;
int x;
for(int i=0;i<n;i++)
{
    cin>>x;
 if(mi>x){
    mi=x;
 }
    vec.push_back(x);
}
int sum=0;
int mii=999999;
for(int i=0;i<vec.size();i++)
{
    if(vec[i]==mi){
    for(int j=i+1;j<vec.size();j++)
    {
     if(vec[j]==mi){
        sum=abs(i-j);
        if(sum<mii){
            mii=sum;
        }
        if(mii==1){
            break;
        }
     }
    }
    }
if(mii==1){
    break;
}
}
cout<<mii;

    return 0;

}


#include <iostream>
#include<vector>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
int n;
cin>>n;
int mi=999999999;
vector<int> vec;
int x;
for(long long i=0;i<n;i++)
{
    cin>>x;
 if(mi>x){
    mi=x;
 }
vec.push_back(x);
}
int sum=0;
int mii=999999;
for(long long  i=0;i<vec.size();i++)
{
    if(vec[i]==mi){
    for(long long j=i+1;j<vec.size();j++)
    {
     if(vec[j]==mi){
        sum=abs(i-j);
        if(sum<mii){
            mii=sum;
        }
        if(mii==1){
            break;
        }
     }
    }
    }
if(mii==1){
    break;
}
}
cout<<mii;

    return 0;

}


#include <iostream>
#include<vector>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
int n;
cin>>n;
long long mi=99999999999;
vector<int> vec;
int x;
for(int i=0;i<n;i++)
{
    cin>>x;
 if(mi>x){
    mi=x;
 }
    vec.push_back(x);
}
int sum=0;
int mii=999999;
for(int i=0;i<n;i++)
{
    if(vec[i]==mi){
    for(int j=i+1;j<n;j++)
    {
     if(vec[j]==mi){
        sum=abs(i-j);
        if(sum<mii){
            mii=sum;
        }
     }
    }
    }
}
cout<<mii;

    return 0;

}


#include <iostream>
#include<vector>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
int n;
cin>>n;
int mi=99999999999;
vector<int> vec;
int x;
for(int i=0;i<n;i++)
{
cin>>x;
 if(mi>x){
    mi=x;
 }
vec.push_back(x);
}
int sum;
int mii=999999;
vector<int> v;
for(int i=0;i<vec.size();i++)
{
 if(vec[i]==mi){
  v.push_back(i);
 }
}
for(int i=0;i<v.size()-1;i++)
{
    sum=v[i+1]-v[i];
    if(sum<mii){
        mii=sum;
    }
}
cout<<mii;

    return 0;

}


#include <iostream>
#include<vector>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
int n;
cin>>n;
int mi=999999999;
vector<int> vec;
int x;
for(long long i=0;i<n;i++)
{
    cin>>x;
 if(mi>x){
    mi=x;
 }
vec.push_back(x);
}
int sum=0;
int mii=999999;
vector<int> v;
for(int i=0;i<vec.size();i++)
{
 if(vec[i]==mi){
    v.push_back(i);
 }
}
for(int i=0;i<v.size()-1;i++)
{
    sum=v[i+1]-v[i];
    if(sum<mii){
        mii=sum;
    }
}
cout<<mii;

    return 0;

}


#include <iostream>
#include<vector>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
long long n;
cin>>n;
long long mi=99999999999;
vector<int> vec;
int x;
for(int i=0;i<n;i++)
{
    cin>>x;
 if(mi>x){
    mi=x;
 }
    vec.push_back(x);
}
int sum=0;
int mii=999999;
for(int i=0;i<n;i++)
{
    if(vec[i]==mi){
    for(int j=i+1;j<n;j++)
    {
     if(vec[j]==mi){
        sum=abs(i-j);
        if(sum<mii){
            mii=sum;
        }
        if(mii==1){
            break;
        }
     }
    }
    }
if(mii==1){
    break;
}
}
cout<<mii;

    return 0;

}


#include <iostream>
#include<vector>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
int n;
cin>>n;
int mi=99999999999;
vector<int> vec;
int x;
for(int i=0;i<n;i++)
{
    cin>>x;
 if(mi>x){
    mi=x;
 }
    vec.push_back(x);
}
int sum=0;
int mii=999999;
for(int i=0;i<n;i++)
{
    if(vec[i]==mi){
    for(int j=i+1;j<n;j++)
    {
     if(vec[j]==mi){
        sum=abs(i-j);
        if(sum<mii){
            mii=sum;
        }
        if(mii==1){
            break;
        }
     }
    }
    }
if(mii==1){
    break;
}
}
cout<<mii;

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define r(i,a,b) for(int i=a;i<b;++i)
#define F first
#define S second
#define PB push_back
#define MP make_pair

int n,i1,a,b,v,u;
bool f1=0,f2=0,ff=0;

int main()
{
  vector<int>ar;
  vector<int>arr;
  int mi=1e10,mii=1e10;

  cin>>n;

  for(int i=0;i<n;++i)
  {
    cin>>v;
    ar.push_back(v);
    if(mi>=ar[i])
    mi=ar[i];
  }

  for(int j=0;j<n;++j)
  {
    if(ar[j]==mi && f1==0)
    {
      a=j;
      f1=1;
    }
    else if(ar[j]==mi && f1==1)
    {
      b=j;
      u=b-a;
      arr.push_back(u);
      i1++;
      a=b;
      b=0;
      f2=0;
      if(u==1)
      {
        cout<<u;
        return 0;
      }
    }

  }

    for(int j=0;j<n;++j)
    {
      if(mii>arr[j] && arr[j]!=0)
      mii=arr[j];
      else
      break;
    }
    cout<<mii;

  return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define r(i,a,b) for(int i=a;i<b;++i)
#define F first
#define S second
#define PB push_back
#define MP make_pair

int n,i1,a,b,v,u;
bool f1=0,f2=0,ff=0;

int main()
{
  vector<int>ar;
  vector<int>arr;
  int mi=1e10,mii=1e10;

  cin>>n;

  for(int i=0;i<n;++i)
  {
    cin>>v;
    ar.push_back(v);
    if(mi>=ar[i])
    mi=ar[i];
  }

  for(int j=0;j<n;++j)
  {
    if(ar[j]==mi && f1==0)
    {
      a=j;
      f1=1;
    }
    else if(ar[j]==mi && f1==1)
    {
      b=j;
      u=b-a;
      arr.push_back(u);
      i1++;
      a=b;
      b=0;
      f2=0;
    }
  }

    for(int j=0;j<n;++j)
    {
      if(mii>arr[j] && arr[j]!=0)
      mii=arr[j];
      else
      break;
    }
    cout<<mii;

  return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define r(i,a,b) for(int i=a;i<b;++i)
#define F first
#define S second
#define PB push_back
#define MP make_pair

long long n,i1,a,b,ar[10000000000],arr[10000000000],mi=1e10,mii=1e10;;
bool f1=0,f2=0,ff=0;

int main()
{
  cin>>n;

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

  for(int j=0;j<n;++j)
  {
    if(ar[j]==mi && f1==0)
    {
      a=j;
      f1=1;
    }
    else if(ar[j]==mi && f1==1)
    {
      b=j;

      arr[i1]=b-a;
      i1++;
      a=b;
      b=0;
      f2=0;
    }
  }

    for(int j=0;j<n;++j)
    {
      if(mii>arr[j] && arr[j]!=0)
      mii=arr[j];
      else
      break;
    }
    cout<<mii;

  return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define r(i,a,b) for(int i=a;i<b;++i)
#define F first
#define S second
#define PB push_back
#define MP make_pair

int n,i1,a,b,ar[100000],arr[100000];
bool f1=0,f2=0,ff=0;

int main()
{
  int mi=1e10,mii=1e10;

  cin>>n;

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

  for(int j=0;j<n;++j)
  {
    if(ar[j]==mi && f1==0)
    {
      a=j;
      f1=1;
    }
    else if(ar[j]==mi && f1==1)
    {
      b=j;

      arr[i1]=b-a;
      i1++;
      a=b;
      b=0;
      f2=0;
    }
  }

    for(int j=0;j<n;++j)
    {
      if(mii>arr[j] && arr[j]!=0)
      mii=arr[j];
      else
      break;
    }
    cout<<mii;

  return 0;
}


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

int a,b,c;
int main()
{
    cin>>a>>b>>c;

    cout<<(c+b)/a;
    return 0;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    int x,r=0,y=1000,m;
    cin>>x;
    long long a[x];
    for(int i=1;i<=x;i++)
    {
        cin>>a[i];
        if(a[i]==a[i-1])
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    for(int i=1;i<=x;i++)
    {
        for(int j=i+1;j<=x;j++)
        {
            if(a[i]==a[j])
            {
                r=j-i;
            }
        }
        m=min(y,r);
        if(m==1)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    cout<<m<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    int x,r=0,y=1000,m,o=100000000000;
    cin>>x;
    long long a[x];
    for(int i=1;i<=x;i++)
    {
        cin>>a[i];
        if(o>a[i])
        {
            o=a[i];
        }

    }
    for(int i=1;i<=x;i++)
    {
        if(a[i]==a[i-1]&&a[i]==o)
            {
                cout<<'1'<<endl;
                return 0;
            }
    }
    for(int i=1;i<=x;i++)
    {
        for(int j=i+1;j<=x;j++)
        {
            if(a[i]==a[j])
            {
                if(a[i]==o)
                {
                    r=j-i;
                }
            }
        }
        m=min(y,r);
        if(m==1)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    cout<<m<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    long long x,m=0,v=1000,z=1;
    cin>>x;
    int a[x];
    for(int i=0;i<x;i++)
    {
        cin>>a[i];
    }
    for(int i=0;i<x;i++)
    {
        for(int j=i+1;j<x;j++)
        {
            if(a[i]==a[j])
            {
               m=j-i;
               v=min(m,v);
            }
            else
            {
                continue;
            }

        }
    }
    cout<<v<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    int x,r=0,y=1000,m,o=100000000000;
    cin>>x;
    long long a[x];
    for(int i=1;i<=x;i++)
    {
        cin>>a[i];
        if(o>a[i])
        {
            o=a[i];
        }
        if(a[i]==a[i-1]&&a[i]==o)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    for(int i=1;i<=x;i++)
    {
        for(int j=i+1;j<=x;j++)
        {
            if(a[i]==a[j])
            {
                if(a[i]==o)
                {
                    r=j-i;
                }
            }
        }
        m=min(y,r);
        if(m==1)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    cout<<m<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    int x,r=0,y=10000000000000,m,o=100000000000,c,p=10000000;
    cin>>x;
    long long a[x];
    for(int i=1;i<=x;i++)
    {
        cin>>a[i];
        if(o>=a[i])
        {
            o=a[i];
            c=i;
        }

    }
    for(int i=1;i<=x;i++)
    {
        if(a[i]==a[i-1]&&a[i]==o)
            {
                cout<<'1'<<endl;
                return 0;
            }
    }
    for(int i=1;i<=x;i++)
    {
          if(a[i]==a[c])
            {
                if(a[i]==o)
                {
                    r=abs(c-i);
                    if(r<p&&r!=0)
                    {
                        p=r;
                    }
                }
        }
        m=min(y,p);
        if(m==1)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    cout<<m<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    int x,r=0,y=1000,m,o=1000;
    cin>>x;
    long long a[x];
    for(int i=1;i<=x;i++)
    {
        cin>>a[i];
        if(o>a[i])
        {
            o=a[i];
        }
        if(a[i]==a[i-1])
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    for(int i=1;i<=x;i++)
    {
        for(int j=i+1;j<=x;j++)
        {
            if(a[i]==a[j])
            {
                if(a[i]==o)
                {
                    r=j-i;
                }
            }
        }
        m=min(y,r);
        if(m==1)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    cout<<m<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    int x,r=0,y=1000,m,o=100000000000,c;
    cin>>x;
    long long a[x];
    for(int i=1;i<=x;i++)
    {
        cin>>a[i];
        if(o>a[i])
        {
            o=a[i];
            c=i;
        }

    }
    for(int i=1;i<=x;i++)
    {
        if(a[i]==a[i-1]&&a[i]==o)
            {
                cout<<'1'<<endl;
                return 0;
            }
    }
    for(int i=1;i<=x;i++)
    {
          if(a[i]==a[c])
            {
                if(a[i]==o)
                {
                    r=abs(c-i);
                }

        }
        m=min(y,r);
        if(m==1)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    cout<<m<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    int x,r=0,y=1000,m,o=100000000000;
    cin>>x;
    long long a[x];
    for(int i=1;i<=x;i++)
    {
        cin>>a[i];
        if(o>a[i])
        {
            o=a[i];
        }
    }
    for(int i=1;i<=x;i++)
    {
        for(int j=i+1;j<=x;j++)
        {
            if(a[i]==a[j])
            {
                if(a[i]==o)
                {
                    r=j-i;
                }
            }
        }
        m=min(y,r);
        if(m==1)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    cout<<m<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    int x,r=0,y=1000,m,o=100000000000;
    cin>>x;
    long long a[x];
    for(int i=1;i<=x;i++)
    {
        cin>>a[i];
        if(o>a[i])
        {
            o=a[i];
        }
        if(a[i]==a[i-1])
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    for(int i=1;i<=x;i++)
    {
        for(int j=i+1;j<=x;j++)
        {
            if(a[i]==a[j])
            {
                if(a[i]==o)
                {
                    r=j-i;
                }
            }
        }
        m=min(y,r);
        if(m==1)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    cout<<m<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long  x,m=0,v=1000,z=1;
    cin>>x;
    long long  a[x];
    for(int i=0;i<x;i++)
    {
        scanf("I64d",&a[x]);
    }
    for(int i=0;i<x;i++)
    {
        for(int j=i+1;j<x;j++)
        {
            if(a[i]==a[j])
            {
               m=j-i;
               v=min(m,v);
            }
            else
            {
                continue;
            }

        }
    }
    cout<<v<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    int x,r=0,y=1000,m,o=100000000000,c,p=10000000;
    cin>>x;
    long long a[x];
    for(int i=1;i<=x;i++)
    {
        cin>>a[i];
        if(o>=a[i])
        {
            o=a[i];
            c=a[i];
        }

    }
    for(int i=1;i<=x;i++)
    {
        if(a[i]==a[i-1]&&a[i]==o)
            {
                cout<<'1'<<endl;
                return 0;
            }
    }
    for(int i=1;i<=x;i++)
    {
        for(int j=i+1;j<=x;j++)
        {
          if(a[i]==a[j]&&a[i]==c)
            {
                r=j-i;
                if(r<p&&r!=0)
                {
                    p=r;
                }

            }
        }
        m=min(y,p);
        if(m==1)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    cout<<m<<endl;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    int x,r=0,y=1000,m,o=100000000000,c,p=10000000;
    cin>>x;
    long long a[x];
    for(int i=1;i<=x;i++)
    {
        cin>>a[i];
        if(o>=a[i])
        {
            o=a[i];
            c=i;
        }

    }
    for(int i=1;i<=x;i++)
    {
        if(a[i]==a[i-1]&&a[i]==o)
            {
                cout<<'1'<<endl;
                return 0;
            }
    }
    for(int i=1;i<=x;i++)
    {
          if(a[i]==a[c])
            {
                if(a[i]==o)
                {
                    r=abs(c-i);
                    if(r<p&&r!=0)
                    {
                        p=r;
                    }
                }
        }
        m=min(y,p);
        if(m==1)
        {
            cout<<'1'<<endl;
            return 0;
        }
    }
    cout<<m<<endl;
}


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

int main()
{
    ios::sync_with_stdio(0);
    long long x,y,n=0,b;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        scanf("%I64d",&y);
        if(y==4)
        {
            cout<<"YES"<<endl;
            continue;
        }
        b=sqrt(y);
        if(b*b==y&&b%2!=0)
        {
            n=0;
            for(long long j=3;j*j<=b;j+=2)
            {
                if(y%j==0)
                {
                    n++;
                    break;
                }
            }
            if(n>0||y==1)
            {
                cout<<"NO"<<endl;
            }
            else if(n==0)
            {
                cout<<"YES"<<endl;
            }
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }
}


#include<iostream>
#include<string>
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x,m=0,v=1000,z=1;
    cin>>x;
    int a[x];
    for(int i=0;i<x;i++)
    {

        cin>>a[i];
    }
    for(int i=0;i<x;i++)
    {
        for(int j=i+1;j<x;j++)
        {
            if(a[i]==a[j])
            {
               m=j-i;
               v=min(m,v);
            }
            else
            {
                continue;
            }

        }
    }
    cout<<v<<endl;
}


//// 404 Err Can't Find Code </>
/// Yazdan_Ra

#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <math.h>
#include <queue>
#include <vector>
#include <fstream>

using namespace std;

#define pb push_back
#define pp pop_back
#define mp make_pair
#define pf pop_front
#define fr first
#define sc second
#define FIX(x) cout.precision(x)
#define sz(x) ((int)(x).size())
#define smax(x,y) ((x)=max((x),(y)))
#define smin(x,y) ((x)=min((x),(y)))
#define all(x) (x).begin(),(x).end()
#define mem(x) memset(x,0,sizeof(x))
#define connect(z,x,y) z[x].pb(y),z[y].pb(x)
#define debug1(x) cout<<string(40,'*')<<endl<< #x <<" ---> "<<x<<endl;
#define debug2(x,y) cout<<string(40,'*')<<endl<< #x <<" ---> "<<x<<endl<< #y <<" ---> "<<y<<endl;
#define debug3(x,y,z) cout<<string(40,'*')<<endl<< #x <<" ---> "<<x<<endl<< #y <<" ---> "<<y<<endl<< #z <<" ---> "<<z<<endl;
#define debug4(x,y,z,t) cout<<string(40,'*')<<endl<< #x <<" ---> "<<x<<endl<< #y <<" ---> "<<y<<endl<< #z <<" ---> "<<z<<endl<< #t <<" ---> "<<t<<endl;
#define _ ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
//#define cin fin
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

inline int iin() { int x; scanf( "%d" , &x ); return x; }
inline ll  lin() { ll  x; scanf( "%lld" , &x ); return x; }

const ll N = 1e6+85;
const ll M = 1e3+85;
const ll mod = 1e9+7;
const ll pinf = LLONG_MAX;
const ll minf = LLONG_MIN;

int ans = 1e9 ;
map < int , int > mark ;

int32_t main()
{_
    int n; cin>>n;
    for ( int i=1 ; i<=n ; i++ ) {
        int a; cin>>a;
        if ( mark[a] )
            smin( ans , abs(mark[a]-i) ) ;
        mark[a] = i ;
    }
    return cout << ans << endl , EXIT_SUCCESS ;
}