import java.util.*;import java.io.*;import java.math.*;

public class Main
{

    public static void process()throws IOException
    {
    	char s[]=(" "+nln()).toCharArray(),t[]=(" "+nln()).toCharArray();

        int len1=s.length-1,len2=t.length-1;

        int i=len1,j=len2;

        long res=0l;

        while(i>0 && j>0){
            if(s[i]!=t[j])
                break;
            i--;
            j--;
        }

        res=i+j;
        pn(res);
    }

    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new AnotherReader();
        boolean oj = true;

    	oj = System.getProperty("ONLINE_JUDGE") != null;
    	if(!oj) sc=new AnotherReader(100);

        long s = System.currentTimeMillis();
        int t=1;
		//t=ni();
        while(t-->0)
            process();
        out.flush();
        if(!oj)
            System.out.println(System.currentTimeMillis()-s+"ms");
        System.out.close();
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;
    static long mod=(long)1e9+7l;

    static void r_sort(int arr[],int n){
        Random r = new Random();
        for (int i = n-1; i > 0; i--){
            int j = r.nextInt(i+1);

            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        Arrays.sort(arr);
    }

    static long mpow(long x, long n) {
        if(n == 0)
            return 1;
        if(n % 2 == 0) {
            long root = mpow(x, n / 2);
            return root * root % mod;
        }else {
            return x * mpow(x, n - 1) % mod;
        }
    }

    static long mcomb(long a, long b) {
        if(b > a - b)
            return mcomb(a, a - b);
        long m = 1;
        long d = 1;
        long i;
        for(i = 0; i < b; i++) {
            m *= (a - i);
            m %= mod;
            d *= (i + 1);
            d %= mod;
        }
        long ans = m * mpow(d, mod - 2) % mod;
        return ans;
    }
/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class DeleteFromTheLeft {
    public static void main(String[] args) {
        Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String one = s.nextLine();
        String two = s.nextLine();
        int i = one.length() - 1;
        int j = two.length() - 1;
        int tot=0;
        while (j>=0&&i>=0){
            if(one.charAt(i)==two.charAt(j))
                tot++;
            else
                break;
            j--;
            i--;
        }
        System.out.println(one.length()+two.length()-2*tot);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class DeleteFromTheLeft {
    public static void main(String[]args) {
        Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String one=s.nextLine();
        String two=s.nextLine();
        boolean flag=false;
        int ans=0;
        while (!flag){
            while (one.length()>=two.length()){
                if(one.compareTo(two)!=0){
                    one=del(one);
                    ans++;
                }else{
                    flag=true;
                    break;
                }

            }
            while (two.length()>one.length()){
                if(one.compareTo(two)!=0){
                    two=del(two);
                    ans++;
                }else{
                    flag=true;
                    break;
                }
            }
        }
        System.out.println(ans);

    }
    static String del(String str){
        return str.substring(1);
    }
    }


// Working program with FastReader
import java.io.*;
import java.util.*;

public class codeforces_1005B
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}

	public static void main(String[] args)
	{
		FastReader ob=new FastReader();
		String s1=ob.next(),s2=ob.next();
		if(s1.compareTo(s2)==0){
            System.out.println(0);
            return;
        }
		else if(s1.compareTo("")==0 || s2.compareTo("")==0){
            System.out.println(s1.length()+s2.length());
            return;
        }
		if(s1.length()<s2.length()){
		    String temp=s2;
		    s2=s1;
		    s1=temp;
        }
		if(s1.contains(s2)){
            System.out.println(s1.length()-s2.length());
            return;
        }
		int j=0,count=0;
		int n=s1.length(),m=s2.length();
        for (int i = n-m; i <n ; i++) {
            if(s1.charAt(i)!=s2.charAt(j)){
                count=i+j+2;
            }
            j++;
        }
        System.out.println(count);

	}
}


// Working program with FastReader
import java.io.*;
import java.util.*;

public class codeforces_1005B
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}

	public static void main(String[] args)
	{
		FastReader ob=new FastReader();
		String s1=ob.next(),s2=ob.next();
		if(s1.compareTo(s2)==0){
            System.out.println(0);
            return;
        }
		else if(s1.compareTo("")==0 || s2.compareTo("")==0){
            System.out.println(s1.length()+s2.length());
            return;
        }
		if(s1.length()<s2.length()){
		    String temp=s2;
		    s2=s1;
		    s1=temp;
        }

		int j=0,count=0;
		int n=s1.length(),m=s2.length();
		boolean flag=true;
        for (int i = n-m; i <n ; i++) {
            if(s1.charAt(i)!=s2.charAt(j)){
                count=i+j+2;
                flag=false;
            }
            j++;
        }
        if(flag){
            System.out.println(n-m);
            return;
        }
        System.out.println(count);

	}
}


// Working program with FastReader
import java.io.*;
import java.util.*;

public class codeforces_1005B
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}

	public static void main(String[] args)
	{
		FastReader ob=new FastReader();
		String s1=ob.next(),s2=ob.next();
		if(s1.compareTo(s2)==0){
            System.out.println(0);
            return;
        }
		else if(s1.compareTo("")==0 || s2.compareTo("")==0){
            System.out.println(s1.length()+s2.length());
            return;
        }
		if(s1.length()<s2.length()){
		    String temp=s2;
		    s2=s1;
		    s1=temp;
        }
		if(s1.contains(s2)){
            System.out.println(s1.length()-s2.length());
            return;
        }
		int n=s1.length(),m=s2.length();
		int j=0;
        for (int i = n-m; i <n ; i++) {
            if(s1.substring(i,n).compareTo(s2.substring(j,m))==0){
                System.out.println(i+1);
                return;
            }
            j++;
        }
        System.out.println(s1.length()+s2.length());

	}
}


// Working program with FastReader
import java.io.*;
import java.util.*;

public class codeforces_1005B
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}

	public static void main(String[] args)
	{
		FastReader ob=new FastReader();
		String s1=ob.next(),s2=ob.next();
		if(s1.compareTo(s2)==0){
            System.out.println(0);
            System.out.println("abcd");
            return;
        }
		else if(s1.compareTo("")==0 || s2.compareTo("")==0){
            System.out.println(s1.length()+s2.length());
            System.out.println("abcd");
            return;
        }
		if(s1.length()<s2.length()){
		    String temp=s2;
		    s2=s1;
		    s1=temp;
        }

		int j=0,count=0;
		int n=s1.length(),m=s2.length();
		boolean flag=true;
        for (int i = n-m; i <n ; i++) {
            if(s1.charAt(i)!=s2.charAt(j)){
                count=i+j+2;
                flag=false;
            }
            j++;
        }
        if(flag){
            System.out.println(n-m);
            return;
        }
        System.out.println(count);

	}
}


// Working program with FastReader
import java.io.*;
import java.util.*;

public class codeforces_1005B
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}

	public static void main(String[] args)
	{
		FastReader ob=new FastReader();
		String s1=ob.next(),s2=ob.next();
		if(s1.compareTo(s2)==0){
            System.out.println(0);
            return;
        }
		else if(s1.compareTo("")==0 || s2.compareTo("")==0){
            System.out.println(s1.length()+s2.length());
            return;
        }
		if(s1.length()<s2.length()){
		    String temp=s2;
		    s2=s1;
		    s1=temp;
        }
		if(s1.contains(s2)){
            System.out.println(s1.length()-s2.length());
            return;
        }
		int n=s1.length(),m=s2.length();
		int j=0;
        for (int i = n-m; i <n ; i++) {
            if(s1.charAt(i)==s1.charAt(j) && s1.substring(i,n).compareTo(s2.substring(j,m))==0){
                System.out.println(i+1);
                return;
            }
            j++;
        }
        System.out.println(s1.length()+s2.length());

	}
}


// Working program with FastReader
import java.io.*;
import java.util.*;

public class codeforces_1005B
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}

	public static void main(String[] args)
	{
		FastReader ob=new FastReader();
		String s1=ob.next(),s2=ob.next();
		if(s1.compareTo(s2)==0){
            System.out.println(0);
            return;
        }
		else if(s1.compareTo("")==0 || s2.compareTo("")==0){
            System.out.println(s1.length()+s2.length());
            return;
        }
		if(s1.length()<s2.length()){
		    String temp=s2;
		    s2=s1;
		    s1=temp;
        }

		int j=0,count=0;
		int n=s1.length(),m=s2.length();
        for (int i = n-m; i <n ; i++) {
            if(s1.charAt(i)!=s2.charAt(j)){
                count=i+j+2;
            }
            j++;
        }
        System.out.println(count);

	}
}


// Working program with FastReader
import java.io.*;
import java.util.*;

public class codeforces_1005B
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}

	public static void main(String[] args)
	{
		FastReader ob=new FastReader();
		String s1=ob.next(),s2=ob.next();
		if(s1.compareTo(s2)==0){
            System.out.println(0);
            return;
        }
		else if(s1.compareTo("")==0 || s2.compareTo("")==0){
            System.out.println(s1.length()+s2.length());
            return;
        }
		if(s1.length()<s2.length()){
		    String temp=s2;
		    s2=s1;
		    s1=temp;
        }
		if(s1.contains(s2)){
            System.out.println(s1.length()-s2.length());
            return;
        }
		int n=s1.length(),m=s2.length();
		int j=0;
		String arr[]=new String[m];
		arr[m-1]=""+s2.charAt(m-1);
        for (int i = m-2; i>-1;i--) {
            arr[i]=arr[i+1]+s2.charAt(i);
        }
        String arr1[]=new String[m];
        arr1[m-1]=s1.charAt(n-1)+"";
        j=m-2;
        for (int i=n-2;i>=n-m;i--) {
            arr1[j]=arr1[j+1]+s1.charAt(i);
            j--;
        }
        for (int i = 0; i <m ; i++) {
            if(arr[i].compareTo(arr1[i])==0){
                System.out.println(n-m+i+1);
                return;
            }
        }

        System.out.println(s1.length()+s2.length());

	}
}


/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;

public class GFG {
	public static void main (String[] args) {

	  Scanner sc = new Scanner(System.in);

	  String s = sc.next();

      String t = sc.next();

      int suff = 0;
      while(true)
      {
          int i = s.length()-suff-1;
          int j = t.length()-suff-1;

          if(i>=0&&j>=0&&s.charAt(i) == t.charAt(j))
          {
            suff++;
          }
          else
          {
              break;
          }
      }
	  System.out.println(s.length()+t.length() - 2 * suff);

}
}


import java.util.*;
public class test {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		String s=sc.next();
		String t=sc.next();
		StringBuilder ss=new StringBuilder(s);
		StringBuilder tt=new StringBuilder(t);
		int count=0;
		if(ss.length()>tt.length())
		{
			while(!ss.toString().equals(tt.toString()))
			{
				if(ss.length()>tt.length())
				{
					ss.deleteCharAt(0);
					++count;
				}
				else
				{
					count+=2;
					ss.deleteCharAt(0);
					tt.deleteCharAt(0);
				}
			}
		}
		else if(ss.length()<tt.length())
		{
			while(!ss.toString().equals(tt.toString()))
			{
				if(ss.length()<tt.length())
				{
					tt.deleteCharAt(0);
					++count;
				}
				else
				{
					count+=2;
					ss.deleteCharAt(0);
					tt.deleteCharAt(0);
				}
			}
		}
		else if(ss.length()==tt.length())
		{
			while(!ss.toString().equals(tt.toString()))
			{
				count+=2;
				ss.deleteCharAt(0);
				tt.deleteCharAt(0);
			}
		}
		System.out.println(count);

	}

}


import java.util.*;
import java.lang.*;

public class test {

	private static final Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

	String s=sc.next();
		String t=sc.next();
		char sr[]=s.toCharArray();
		char tr[]=t.toCharArray();
		int sl=s.length();
		int tl=s.length();
		int i=1;
		int count=0;
		for(;i<=Integer.min(sl, tl);i++)
		{
			if(sr[sl-i]!=tr[tl-i])
				break;
			else
				++count;
		}
		count=2*count;
		System.out.println(sl+tl-count);
		sc.close();
	}
}


import java.util.*;
import java.lang.*;

public class test {

	private static final Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

	String s=sc.next();
		String t=sc.next();
		char sr[]=s.toCharArray();
		char tr[]=t.toCharArray();
		int sl=s.length();
		int tl=t.length();
		int i=1;
		int count=0;
		for(;i<=Integer.min(sl, tl);i++)
		{
			if(sr[sl-i]!=tr[tl-i])
				break;
			else
				++count;
		}
		count=2*count;
		System.out.println(sl+tl-count);
		sc.close();
	}
}


import java.util.*;
import java.lang.*;

public class test {

	private static final Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		String s=sc.next();
		String t=sc.next();
		int sl=s.length();
		int tl=s.length();
		s=new StringBuilder(s).reverse().toString();
		t=new StringBuilder(t).reverse().toString();
		int min=Integer.min(s.length(), t.length());
		int i=1;
		while(i<=min)
		{
			String s1=s.substring(0,i);
			String s2=t.substring(0,i);
			if(!s1.equals(s2))
			{
				break;
			}
			++i;
		}
		int index=i-1;
		int total=0;
		int c1=s.length()-index;
		int c2=t.length()-index;
		if(c1<0)
			total=c2;
		else if(c2<0)
			total=c1;
		else
			total=c1+c2;
		System.out.println(total);
		sc.close();
	}
}


import java.util.Scanner;

public class CR496DIV3DeleteFromTheLeft {

	public static int solve(String s, String t) {
		int count = 0;
		int is = s.length() - 1, it = t.length() - 1;
		while(is >= 0 && it >= 0 && s.charAt(is) == t.charAt(it)) {
			is --;
			it --;
			count ++;
		}
		return s.length() + t.length() - 2 * count ;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		System.out.println(solve(s, t));
	}

}


//package com.company;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    String t = sc.next();
	    boolean possible = false;
	    int min = Integer.MAX_VALUE;

		if(s.length() >= t.length()) {
			for (int i = 0; i < s.length(); i++) {
				for (int j = 0; j < t.length(); j++) {
					if(s.length()-i == t.length()-j) {
						int start = i;
						int moves = i+j;
						for(int k=j; k<t.length(); k++) {
							if(s.charAt(start) != t.charAt(k))
								break;
							if(k==t.length()-1) {
								min = Math.min(min, moves);
								possible = true;
							}
							start++;
						}
					}
				}
			}
		}
		else {
			for (int i = 0; i < t.length(); i++) {
				for (int j = 0; j < s.length(); j++) {
					if(t.length()-i == s.length()-j) {
						int start = i;
						int moves = i+j;
						for(int k=j; k<s.length(); k++) {
							if(t.charAt(start) != s.charAt(k))
								break;
							if(k==s.length()-1) {
								min = Math.min(min, moves);
								possible = true;
							}
							start++;
						}
					}
				}
			}
		}

		if(possible) {
			System.out.println(min);
		}
		else {
			System.out.println(s.length() + t.length());
		}

    }

}


//package com.company;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    String t = sc.next();
		int min = Math.min(s.length(), t.length());
		int s_counter = s.length()-1;
		int t_counter = t.length()-1;
		for(int i=0; i<min; i++) {
			if (s.charAt(s_counter) != t.charAt(t_counter)) {
				break;
			}
			s_counter--;
			t_counter--;

		}
		int moves = s_counter+1 + t_counter+1;
		System.out.println(moves);

    }

}


package qfy;

import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		int n = 200005;
		Scanner cin = new Scanner(System.in);
		String a = cin.next(),b= cin.next();
		if(a.length() == 0 || b.length() == 0) {
			System.out.println(a.length()+b.length());
			return ;
		}
		int sum = 0,lena = a.length()-1,lenb = b.length()-1,ans = 0;
		while(lena >= 0 && lenb >= 0) {
			if(a.charAt(lena) != b.charAt(lenb)) {
				if(lena == a.length()-1) {
					sum = a.length()+b.length();
					ans = 1;
					break;
				}
				else {
					sum += 2;
				}
			}
			lena--;
			lenb--;
		}
		if(ans != 1)
			sum += (lena+1)+(lenb+1);
		System.out.println(sum);
		return ;
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		int n = 200005;
		Scanner cin = new Scanner(System.in);
		String a = cin.nextLine(),b= cin.nextLine();
		if(a.length() == 0 || b.length() == 0) {
			System.out.println(a.length()+b.length());
			return ;
		}
		int sum = 0,lena = a.length()-1,lenb = b.length()-1,ans = 0;
		while(lena >= 0 && lenb >= 0) {
			if(a.charAt(lena) != b.charAt(lenb)) {
				if(lena == a.length()-1) {
					sum = a.length()+b.length();
					ans = 1;
					break;
				}
				else {
					sum += 2;
				}
			}
			lena--;
			lenb--;
		}
		if(ans != 1)
			sum += (lena+1)+(lenb+1);
		System.out.println(sum);
		return ;
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		int n = 200005;
		Scanner cin = new Scanner(System.in);
		String a = cin.next(),b= cin.next();
		if(a.length() == 0 || b.length() == 0) {
			System.out.println(a.length()+b.length());
			return ;
		}
		int sum = 0,lena = a.length()-1,lenb = b.length()-1,ans = 0;
		while(lena >= 0 && lenb >= 0) {
			if(a.charAt(lena) != b.charAt(lenb)) {
				if(lena == a.length()-1) {
					sum = a.length()+b.length();
					ans = 1;
					break;
				}
				else {
					sum += 2;
				}
			}
			lena--;
			lenb--;
		}
		if(ans != 1)
			sum += (lena+1)+(lenb+1);
		System.out.println(sum);
		return ;
	}
}


package qfy;

import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		int n = 200005;
		Scanner cin = new Scanner(System.in);
		String a = cin.next();
		String b = cin.next();
		int sum = 0,lena = a.length()-1,lenb = b.length()-1;
		while(lena >= 0 && lenb >= 0) {
			if(a.charAt(lena) != b.charAt(lenb)) {
				if(lena == a.length()-1) {
					sum = a.length()+b.length();
					break;
				}
				else {
					sum += 2;
				}
			}
			lena--;
			lenb--;
		}
		sum += (lena+1)+(lenb+1);
		System.out.println(sum);
	}
}


package qfy;

import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		int n = 200005;
		Scanner cin = new Scanner(System.in);
		String a = cin.nextLine(),b= cin.nextLine();
		if(a.length() == 0 || b.length() == 0) {
			System.out.println(a.length()+b.length());
			return ;
		}
		int sum = 0,lena = a.length()-1,lenb = b.length()-1,ans = 0;
		while(lena >= 0 && lenb >= 0) {
			if(a.charAt(lena) != b.charAt(lenb)) {
				if(lena == a.length()-1) {
					sum = a.length()+b.length();
					ans = 1;
					break;
				}
				else {
					sum += 2;
				}
			}
			lena--;
			lenb--;
		}
		if(ans != 1)
			sum += (lena+1)+(lenb+1);
		System.out.println(sum);
		return ;
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		int n = 200005;
		Scanner cin = new Scanner(System.in);
		String a = cin.next();
		String b = cin.next();
		if(a.length() == 0 || b.length() == 0) {
			System.out.println(a.length()+b.length());
			return ;
		}
		int sum = 0,lena = a.length()-1,lenb = b.length()-1,ans = 0;
		while(lena >= 0 && lenb >= 0) {
			if(a.charAt(lena) != b.charAt(lenb)) {
				if(lena == a.length()-1) {
					sum = a.length()+b.length();
					ans = 1;
					break;
				}
				else {
					sum += 2;
				}
			}
			lena--;
			lenb--;
		}
		if(ans != 1)
			sum += (lena+1)+(lenb+1);
		System.out.println(sum);
		return ;
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		int n = 200005;
		Scanner cin = new Scanner(System.in);
		String a = cin.next(),b= cin.next();
		int sum = 0,lena = a.length()-1,lenb = b.length()-1,ans = 0;
		while(lena >= 0 && lenb >= 0) {
			if(a.charAt(lena) == b.charAt(lenb)) {
				lena--;
				lenb--;
			}
			else {
				break;
			}
		}
		System.out.println(lena+lenb+2);
		return ;
	}
}


package qfy;

import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		int n = 200005;
		Scanner cin = new Scanner(System.in);
		String a = cin.next();
		String b = cin.next();
		int sum = 0,lena = a.length()-1,lenb = b.length()-1;
		while(lena >= 0 && lenb >= 0) {
			if(a.charAt(lena) != b.charAt(lenb)) {
				if(lena == a.length()-1) {
					sum = a.length()+b.length();
					break;
				}
				else {
					sum += 2;
				}
			}
			lena--;
			lenb--;
		}
		System.out.println(sum);
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		int n = 200005;
		Scanner cin = new Scanner(System.in);
		String a = cin.next();
		String b = cin.next();
		int sum = 0,lena = a.length()-1,lenb = b.length()-1;
		while(lena >= 0 && lenb >= 0) {
			if(a.charAt(lena) != b.charAt(lenb)) {
				if(lena == a.length()-1) {
					sum = a.length()+b.length();
					break;
				}
				else {
					sum += 2;
				}
			}
			lena--;
			lenb--;
		}
		System.out.println(sum);
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		int n = 200005;
		Scanner cin = new Scanner(System.in);
		String a = cin.next();
		String b = cin.next();
		int sum = 0,lena = a.length()-1,lenb = b.length()-1;
		while(lena >= 0 && lenb >= 0) {
			if(a.charAt(lena) != b.charAt(lenb)) {
				if(lena == a.length()-1) {
					sum = a.length()+b.length();
					break;
				}
				else {
					sum += 2;
				}
			}
			lena--;
			lenb--;
		}
		sum += (lena+1)+(lenb+1);
		System.out.println(sum);
	}
}


#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <functional>
#include <cassert>

#define fi first
#define se second
#define mp make_pair
#define pii pair<int,int>
#define ll long long
using namespace std;
const int maxn = 300;

int ans[maxn];
ll f[maxn];
int beg[maxn], e[maxn];

bool can(int f, int s, int a, int n) {
	if (n == 1) {
		return f == s && a == 0;
	}
	if (n == 2) {
		if (!f && s) {
			return a == 1;
		} else {
			return a == 0;
		}
	}
	if (f == 0) {
		int mx = (n - 1) / 2;
		if ((n - 1) % 2 == 1 && s == 1)
			mx++;
		return mx >= a;
	} else {
		return can(0, s, a, n - 1);
	}
}

void doit(int f, int s, int a, int n) {
	if (n == 1) {
		if (!f)
			printf("A");
		else
			printf("C");
		puts("");
		return;
	} else if (n == 2) {
		if (!f)
			printf("A");
		else
			printf("C");
			if (!s)
			printf("A");
		else
			printf("C");
		puts("");
		return;
	}
	int ans[maxn];
	ans[0] = f, ans[n - 1] = s;
	if (f == 0) {
		if (a > 0)
			ans[1] = 1;
		int j = 2;
		for (int i = 0; i < a - 1; i++) {
			ans[j] = 0, ans[j+1] = 1;
			j += 2;
		}
		for (int i = j; i < n - 1; i++)
			ans[i] = 2;
	} else {
		int j = 1;
		for (int i = 0; i < a; i++) {
			ans[j] = 0, ans[j+1] = 1;
			j += 2;
		}
		for (int i = j; i < n - 1; i++)
			ans[i] = 2;
	}

	for (int i = 0; i < n; i++)
		if (!ans[i])
			printf("A");
		else if (ans[i] == 1)
			printf("C");
		else
			printf("B");
	puts("");
	//assert(ans[0] == f && ans[n-1] == s);
}

int main() {
#ifdef _CONSOLE
	freopen("input.txt", "r", stdin);
#endif
	int k, x, n, m;
	cin >> k >> x >> n >> m;

	//for (int i = 2; f[i - 1] + f[i] <= 1e9; i++) {
	//	f[i] = f[i - 1] + f[i];
	//}
	//ll c1 = f[k - 2], c2 = f[k - 1];
	for (int a = 0; a <= n / 2; a++) {
		for (int b = 0; b <= m / 2; b++) {
			for (int l_1 = 0; l_1 < 2; l_1++) {
				for (int r_1 = 0; r_1 < 2; r_1++) {
					for (int l_2 = 0; l_2 < 2; l_2++) {
						for (int r_2 = 0; r_2 < 2; r_2++) {
							beg[1] = l_1, e[1] = r_1;
							beg[2] = l_2, e[2] = r_2;
							f[1] = a, f[2] = b;
							if (can(l_1, r_1, a, n) && can(l_2, r_2, b, m)) {
								for (int i = 3; i <= k; i++) {
									beg[i] = beg[i - 2];
									e[i] = e[i - 1];
									int inc = 0;
									if (e[i - 2] == 0 && beg[i - 1] == 1)
										inc = 1;
									f[i] = f[i - 1] + f[i - 2] + inc;
									if (f[i] > x)
										break;
								}
								if (f[k] == x) {
									doit(l_1, r_1, a, n);
									doit(l_2, r_2, b, m);
									return 0;
								}
							}
						}
					}
				}
			}
		}
	}
	puts("Happy new year!");
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <functional>
#include <cassert>

#define fi first
#define se second
#define mp make_pair
#define pii pair<int,int>
#define ll long long
using namespace std;
const int maxn = 55;

int ans[maxn];
ll f[maxn];
int beg[maxn], e[maxn];

bool can(int f, int s, int a, int n) {
	if (n == 1) {
		return f == s && a == 0;
	}
	if (f == 0) {
		int mx = (n - 1) / 2;
		if ((n - 1) % 2 == 1 && s == 1)
			mx++;
		return mx >= a;
	} else {
		return can(0, s, a, n - 1);
	}
}

void doit(int f, int s, int a, int n) {
	if (n == 1) {
		if (!f)
			printf("A");
		else
			printf("C");
		puts("");
		return;
	} else if (n == 2) {
			if (!f)
			printf("A");
		else
			printf("C");
			if (!s)
			printf("A");
		else
			printf("C");
		puts("");
		return;
	}
	int ans[maxn];
	ans[0] = f, ans[n - 1] = s;
	if (f == 0) {
		ans[1] = 1;
		int j = 2;
		for (int i = 0; i < a - 1; i++) {
			ans[j] = 0, ans[j+1] = 1;
			j += 2;
		}
		for (int i = j; i < n - 1; i++)
			ans[i] = 2;
	} else {
		int j = 1;
		for (int i = 0; i < a; i++) {
			ans[j] = 0, ans[j+1] = 1;
			j += 2;
		}
		for (int i = j; i < n - 1; i++)
			ans[i] = 2;
	}

	for (int i = 0; i < n; i++)
		if (!ans[i])
			printf("A");
		else if (ans[i] == 1)
			printf("C");
		else
			printf("B");
	puts("");
	//assert(ans[0] == f && ans[n-1] == s);
}

int main() {
#ifdef _CONSOLE
	freopen("input.txt", "r", stdin);
#endif
	int k, x, n, m;
	cin >> k >> x >> n >> m;

	//for (int i = 2; f[i - 1] + f[i] <= 1e9; i++) {
	//	f[i] = f[i - 1] + f[i];
	//}
	//ll c1 = f[k - 2], c2 = f[k - 1];
	for (int a = 0; a <= n / 2; a++) {
		for (int b = 0; b <= m / 2; b++) {
			for (int l_1 = 0; l_1 < 2; l_1++) {
				for (int r_1 = 0; r_1 < 2; r_1++) {
					for (int l_2 = 0; l_2 < 2; l_2++) {
						for (int r_2 = 0; r_2 < 2; r_2++) {
							beg[1] = l_1, e[1] = r_1;
							beg[2] = l_2, e[2] = r_2;
							f[1] = a, f[2] = b;
							if (can(l_1, r_1, a, n) && can(l_2, r_2, b, m)) {
								for (int i = 3; i <= k; i++) {
									beg[i] = beg[i - 2];
									e[i] = e[i - 1];
									int inc = 0;
									if (e[i - 2] == 0 && beg[i - 1] == 1)
										inc = 1;
									f[i] = f[i - 1] + f[i - 2] + inc;
									if (f[i] > x)
										break;
								}
								if (f[k] == x) {
									doit(l_1, r_1, a, n);
									doit(l_2, r_2, b, m);
									return 0;
								}
							}
						}
					}
				}
			}
		}
	}
	puts("Happy new year!");
	return 0;
}


//Bakuri Tsutskhashvili

# include <iostream>
# include <algorithm>
# include <stdio.h>
# include <vector>
# include <math.h>
# include <map>
# include <string>

typedef long long ll;
# define INF 2147483647
# define fesvi(popo) sqrt(double(popo))
# define Pi acos(-1.0)
# define IOS ios::sync_with_stdio(0);

using namespace std;
struct name{
	ll a;
	ll b;
	ll aa;
	ll bb;
	ll ab;
	ll ba;
};
vector<name> ans(51);
ll n,x,k,m;
string t1,t2;
void ret(string fi,string sec,ll sig1,ll sig2){
	if(sig1*ans[k].a+sig2*ans[k].b+(fi[0]=='C' && sec[sec.size()-1]=='A')*ans[k].ba+(fi[fi.size()-1]=='A' && sec[0]=='C')*ans[k].ab+(sec[0]=='C' && sec[sec.size()-1]=='A')*ans[k].bb==x){
		cout<<fi<<"\n"<<sec;
		exit(0);
	}
}
void check(ll n1,ll m1){
	vector<string>ans1,ans2;
	t1=t2="";
	for (int i=1;i<=n1;i++)
		t1+="AC";
	for (int i=1;i<=m1;i++)
		t2+="AC";
	for (int i=1;i<=n-2*n1-2;i++)
		t1+="B";
	for (int i=1;i<=m-2*m1-2;i++)
		t2+="B";
	if (n-t1.size()==2)
		ans1.push_back("C"+t1+"A"),ans1.push_back("B"+t1+"A"),ans1.push_back("C"+t1+"B"),ans1.push_back("B"+t1+"B");
	if (n-t1.size()==1)
		ans1.push_back(t1+"A"),ans1.push_back("C"+t1),ans1.push_back("B"+t1);
	if (n-t1.size()==0)
		ans1.push_back(t1);
	if (m-t2.size()==2)
		ans2.push_back("C"+t2+"A"),ans2.push_back("B"+t2+"A"),ans2.push_back("C"+t2+"B"),ans2.push_back("B"+t2+"B");
	if (m-t2.size()==1)
		ans2.push_back(t2+"A"),ans2.push_back("C"+t2),ans2.push_back("B"+t2);
	if (m-t2.size()==0)
		ans2.push_back(t2);
	for (int i=0;i<ans1.size();i++)
		for (int j=0;j<ans2.size();j++)
			ret(ans1[i],ans2[j],n1,m1);

}
void prepare(){
	ans[1].a=1;
	ans[1].b=ans[1].ab=ans[1].aa=ans[1].ba=ans[1].bb=0;
	ans[2].b=1;
	ans[2].a=ans[2].ab=ans[2].aa=ans[2].ba=ans[2].bb=0;
	ans[3].a=ans[3].b=ans[3].ab=1;
	ans[3].aa=ans[3].ba=ans[3].bb=0;
	for (int i=4;i<=50;i++){
		ans[i].a=ans[i-1].a+ans[i-2].a;
		ans[i].b=ans[i-1].b+ans[i-2].b;
		ans[i].ab=ans[i-1].ab+ans[i-2].ab;
		ans[i].aa=0;
		ans[i].bb=ans[i-1].bb+ans[i-2].bb;
		ans[i].ba=ans[i-1].ba+ans[i-2].ba;
		if (i%2==0)
			ans[i].ba++;
		else
			ans[i].bb++;
	}
}
int main(){
#ifndef ONLINE_JUDGE
       freopen("input.txt","r",stdin);
       freopen("output.txt","w",stdout);
     #endif
	   IOS
	   prepare();
	cin>>k>>x>>n>>m;
		for (int i=0;i<=(n/2);i++)
			for (int j=0;j<=(m/2);j++)
				check(i,j);
		cout<<"Happy new year!";
}


# include <iostream>
# include <vector>
# include <string>
typedef long long ll;
using namespace std;
struct name{ll a;ll b;ll aa;ll bb;ll ab;ll ba;};
vector<name> ans(51);ll n,x,k,m;string t1,t2;
void ret(string fi,string sec,ll sig1,ll sig2){if(sig1*ans[k].a+sig2*ans[k].b+(fi[0]=='C' && sec[sec.size()-1]=='A')*ans[k].ba+(fi[fi.size()-1]=='A' && sec[0]=='C')*ans[k].ab+(sec[0]=='C' && sec[sec.size()-1]=='A')*ans[k].bb==x){cout<<fi<<"\n"<<sec;exit(0);}}
void check(ll n1,ll m1){vector<string>ans1,ans2;t1=t2="";for (int i=1;i<=n1;i++)t1+="AC";for (int i=1;i<=m1;i++)t2+="AC";for (int i=1;i<=n-2*n1-2;i++)t1+="B";for (int i=1;i<=m-2*m1-2;i++)t2+="B";if (n-t1.size()==2)ans1.push_back("C"+t1+"A"),ans1.push_back("B"+t1+"A"),ans1.push_back("C"+t1+"B"),ans1.push_back("B"+t1+"B");if (n-t1.size()==1)ans1.push_back(t1+"A"),ans1.push_back("C"+t1),ans1.push_back("B"+t1);if (n-t1.size()==0)ans1.push_back(t1);if (m-t2.size()==2)ans2.push_back("C"+t2+"A"),ans2.push_back("B"+t2+"A"),ans2.push_back("C"+t2+"B"),ans2.push_back("B"+t2+"B");if (m-t2.size()==1)ans2.push_back(t2+"A"),ans2.push_back("C"+t2),ans2.push_back("B"+t2);if (m-t2.size()==0)ans2.push_back(t2);for (int i=0;i<ans1.size();i++)for (int j=0;j<ans2.size();j++)ret(ans1[i],ans2[j],n1,m1);}
void prepare(){ans[1].a=1;ans[1].b=ans[1].ab=ans[1].aa=ans[1].ba=ans[1].bb=0;ans[2].b=1;ans[2].a=ans[2].ab=ans[2].aa=ans[2].ba=ans[2].bb=0;ans[3].a=ans[3].b=ans[3].ab=1;ans[3].aa=ans[3].ba=ans[3].bb=0;for (int i=4;i<=50;i++){ans[i].a=ans[i-1].a+ans[i-2].a;ans[i].b=ans[i-1].b+ans[i-2].b;ans[i].ab=ans[i-1].ab+ans[i-2].ab;ans[i].aa=0;ans[i].bb=ans[i-1].bb+ans[i-2].bb;ans[i].ba=ans[i-1].ba+ans[i-2].ba;if (i%2==0)ans[i].ba++;else ans[i].bb++;}}
int main(){prepare();cin>>k>>x>>n>>m;for (int i=0;i<=(n/2);i++)for (int j=0;j<=(m/2);j++)check(i,j);cout<<"Happy new year!";}


#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:200000000")

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <limits>
#include <cassert>
#include <ctime>
#include <list>
#include <bitset>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <complex>
//#include <tuple>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

template<typename T> inline T Abs(T a){ return a>0 ? a : -a; }
template<typename T> inline T sqr(T a){ return a*a; }
template<typename T> inline void relaxMin(T &a,T b){ if (b<a) a=b; }
template<typename T> inline void relaxMax(T &a,T b){ if (b>a) a=b; }

#define _(a,val) memset(a,val,sizeof a);
#define REP(i, a, b) for(int i(a),_bb(b); i < _bb; ++i)
//#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define REPD(i, a, b) for(int i = (b) - 1; i >= a; --i)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()

const int INF = (int)1E9;
//const int INF = INT_MAX/2-1;
const long double EPS = 1E-6;
const long double PI = 3.1415926535897932384626433832795;
#define y1 idfgoseincdjkg
typedef vector<int> vint;
typedef pair<int,int> pii;

#undef assert
#define assert(expr){if (!(expr)) { ++*(char*)0; } }

int k,x,n,m;

struct w{
	int a,c,cnt;
	w(){}
	w(int _a,int _c,int _cnt) : a(_a),c(_c),cnt(_cnt){}
	w concat(w &r){
		w &l = *this;
		return w(r.a,l.c,l.cnt+r.cnt+l.a*r.c);
	}
};

void solve(){
	cin>>k>>x>>n>>m;
	for(int aa=0;aa<=1;aa++){
		for(int ac=0;ac<=1;ac++){
			for(int ba=0;ba<=1;ba++){
				for(int bc=0;bc<=1;bc++){
					int la = max(0,n-aa-ac);
					int lb = max(0,m-ba-bc);
					for(int a=0;a*2<=la;a++){
						for(int b=0;b*2<=lb;b++){
							w A(aa,ac,a),B(ba,bc,b);
							if (n==1 && aa) A.c=0;
							if (m==1 && ba) B.c=0;
							for(int cur=2;cur!=k;cur++){
								w na = B;
								w nb = A.concat(B);
								A=na;
								B=nb;
							}
							if (B.cnt == x){
								string SA,SB;
								if (n==1){
									if (aa) SA="A";
									else if (ac) SA="C";
									else SA="X";
								}else{
									SA="";
									REP(i,0,a) SA+="AC";
									while(aa+ac+SA.length() < n) SA+="X";
									if (aa) SA=SA+"A";
									if (ac) SA="C"+SA;
								}
								if (m==1){
									if (ba) SB="A";
									else if (bc) SB="C";
									else SB="Y";
								}else{
									SB="";
									REP(i,0,b) SB+="AC";
									while(ba+bc+SB.length() < m) SB+="X";
									if (ba) SB=SB+"A";
									if (bc) SB="C"+SB;
								}
								cout<<SA<<endl<<SB<<endl;
								return;
							}
						}
					}
				}
			}
		}
	}
	puts("Happy new year!");
}

#define TASK "circles"
int main(){
#ifdef acm
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
	freopen("error.txt", "wt", stderr);
#else
	//freopen("input.txt", "rt", stdin);
	//freopen("output.txt", "wt", stdout);
	//freopen(TASK".in", "rt", stdin);
	//freopen(TASK".out", "wt", stdout);
#endif
	//srand(time(0));
	//srand(0xA1B2C3D4);

	//pre();
	/*int tc; scanf("%d\n",&tc);
	for(int t=1;t<=tc;t++){
		printf("Case #%d: ",t);
		solve();
	}*/
	solve();

#ifdef acm
	printf("\n\n\n\n\n%.3lf\n", clock()*1e-3);
#endif
	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:200000000")

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <limits>
#include <cassert>
#include <ctime>
#include <list>
#include <bitset>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <complex>
//#include <tuple>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

template<typename T> inline T Abs(T a){ return a>0 ? a : -a; }
template<typename T> inline T sqr(T a){ return a*a; }
template<typename T> inline void relaxMin(T &a,T b){ if (b<a) a=b; }
template<typename T> inline void relaxMax(T &a,T b){ if (b>a) a=b; }

#define _(a,val) memset(a,val,sizeof a);
#define REP(i, a, b) for(int i(a),_bb(b); i < _bb; ++i)
//#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define REPD(i, a, b) for(int i = (b) - 1; i >= a; --i)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()

const int INF = (int)1E9;
//const int INF = INT_MAX/2-1;
const long double EPS = 1E-6;
const long double PI = 3.1415926535897932384626433832795;
#define y1 idfgoseincdjkg
typedef vector<int> vint;
typedef pair<int,int> pii;

#undef assert
#define assert(expr){if (!(expr)) { ++*(char*)0; } }

int k,x,n,m;

struct w{
	int a,c;
	ll cnt;
	w(){}
	w(int _a,int _c,ll _cnt) : a(_a),c(_c),cnt(_cnt){
		if(cnt > x+1) cnt=x+1;
	}
	w concat(w &r){
		w &l = *this;
		return w(r.a,l.c,l.cnt+r.cnt+l.a*r.c);
	}
};

void solve(){
	cin>>k>>x>>n>>m;
	for(int aa=0;aa<=1;aa++){
		for(int ac=0;ac<=1;ac++){
			for(int ba=0;ba<=1;ba++){
				for(int bc=0;bc<=1;bc++){
					int la = max(0,n-aa-ac);
					int lb = max(0,m-ba-bc);
					for(int a=0;a*2<=la;a++){
						for(int b=0;b*2<=lb;b++){
							w A(aa,ac,a),B(ba,bc,b);
							if (n==1 && aa) A.c=0;
							if (m==1 && ba) B.c=0;
							for(int cur=2;cur!=k;cur++){
								w na = B;
								w nb = A.concat(B);
								A=na;
								B=nb;
							}
							if (B.cnt == x){
								string SA,SB;
								if (n==1){
									if (aa) SA="A";
									else if (ac) SA="C";
									else SA="X";
								}else{
									SA="";
									REP(i,0,a) SA+="AC";
									while(aa+ac+SA.length() < n) SA+="X";
									if (aa) SA=SA+"A";
									if (ac) SA="C"+SA;
								}
								if (m==1){
									if (ba) SB="A";
									else if (bc) SB="C";
									else SB="Y";
								}else{
									SB="";
									REP(i,0,b) SB+="AC";
									while(ba+bc+SB.length() < m) SB+="X";
									if (ba) SB=SB+"A";
									if (bc) SB="C"+SB;
								}
								cout<<SA<<endl<<SB<<endl;
								return;
							}
						}
					}
				}
			}
		}
	}
	puts("Happy new year!");
}

#define TASK "circles"
int main(){
#ifdef acm
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
	freopen("error.txt", "wt", stderr);
#else
	//freopen("input.txt", "rt", stdin);
	//freopen("output.txt", "wt", stdout);
	//freopen(TASK".in", "rt", stdin);
	//freopen(TASK".out", "wt", stdout);
#endif
	//srand(time(0));
	//srand(0xA1B2C3D4);

	//pre();
	/*int tc; scanf("%d\n",&tc);
	for(int t=1;t<=tc;t++){
		printf("Case #%d: ",t);
		solve();
	}*/
	solve();

#ifdef acm
	printf("\n\n\n\n\n%.3lf\n", clock()*1e-3);
#endif
	return 0;
}


#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <utility>
#include <functional>
#include <bitset>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef pair<int, int> pii;

#define FOR(i, x, y) for(ll i=x; i<=y; i++)
#define FORD(i, x, y) for (ll i = x; i >= y; --i)
#define REP(i, n) for(ll i=0; i<n; i++)
#define REPD(i, n) for(ll i = n - 1; i >= 0; --i)

#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define UNIQ(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define SZ(c) (int)(c).size()

#define CLEAR(x) memset(x,0,sizeof x)
#define FILL(x, v) memset(x,v,sizeof x)
#define COPY(from, to) memcpy(to, from, sizeof to)

#define pb push_back
#define mp make_pair
#define X first
#define Y second

const double eps = 1.0e-11;
const double pi = acos(-1.0);
const int N = 55;
ll a[N], b[N], ab[N], ba[N], bb[N];
int st[N], ed[N];

struct state {
  int st, ed, ins;
  state(int s, int e, int i) : st(s), ed(e), ins(i) {};
};

vector<state> generate(int len) {
  vector<state> res;
  if (len == 1) {
    res.push_back(state(0, 0, 0));
    res.push_back(state(1, 1, 0));
    res.push_back(state(2, 2, 0));
    return res;
  }
  REP(ss, 3) REP(ee, 3) {
    int mx, mn = 0;
    if (ss == 0 && ee == 1) {
      mx = len / 2;
      if (len == 2) mn = 1;
    }
    else {
      if (ss == 0 || ee == 1) mx = (len - 1) / 2;
      else mx = (len - 2) / 2;
    }
    FOR(i, mn, mx) res.push_back(state(ss, ee, i));
  }
  return res;
}

char ch[3] = {'A', 'C', 'X'};

void output(int st, int ed, int ins, int len) {
  cout << ch[st];
  if (len == 1) {
    cout << endl;
    return;
  }
  if (len == 2) {
    cout << ch[ed] << endl;
    return;
  }

  if (st == 0) {
    cout << ch[1];
    REP(i, ins - 1) cout << "AC";
    FOR(i, 2 * ins, len - 2) cout << "X";
  }
  else {
    FOR(i, 1, len - 2) {
      if (i + 2 * ins >= len) {
        if ((len - 1 - i) % 2) cout << "A";
        else cout << "C";
      } else cout << "X";
    }
  }
  if (2 * ins != len) cout << ch[ed] << endl;
}

int main() {
  /*output(0, 0, 0, 1);
  output(1, 1, 0, 1);
  output(2, 2, 0, 1);
  output(1, 1, 0, 2);
  output(1, 1, 0, 3);
  output(1, 1, 0, 8);
  return 0;*/
  int k, x, n, m;
  cin >> k >> x >> n >> m;
  a[1] = 1;
  b[2] = 1;
  st[2] = ed[2] = 1;
  FOR(i, 3, k) {
    a[i] = a[i - 2] + a[i - 1];
    b[i] = b[i - 2] + b[i - 1];
    ab[i] = ab[i - 2] + ab[i - 1];
    ba[i] = ba[i - 2] + ba[i - 1];
    bb[i] = bb[i - 2] + bb[i - 1];
    if (ed[i - 2] == 0 && st[i - 1] == 1) ++ab[i];
    if (ed[i - 2] == 1 && st[i - 1] == 1) ++bb[i];
    if (ed[i - 2] == 1 && st[i - 1] == 0) ++ba[i];
    st[i] = st[i - 2];
    ed[i] = ed[i - 1];
  }
  vector<state> first = generate(n);
  vector<state> second = generate(m);

  REP(i, SZ(first)) REP(j, SZ(second)) {
    int curr = a[k] * first[i].ins + b[k] * second[j].ins;
    if (first[i].ed == 0 && second[j].st == 1) curr += ab[k];
    if (second[j].ed == 0 && second[j].st == 1) curr += bb[k];
    if (second[j].ed == 0 && first[i].st == 1) curr += ba[k];
    if (curr == x) {
      output(first[i].st, first[i].ed, first[i].ins, n);
      output(second[j].st, second[j].ed, second[j].ins, m);
      return 0;
    }

  }
  cout << "Happy new year!\n";
  return 0;
}


#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <utility>
#include <functional>
#include <bitset>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef pair<int, int> pii;

#define FOR(i, x, y) for(ll i=x; i<=y; i++)
#define FORD(i, x, y) for (ll i = x; i >= y; --i)
#define REP(i, n) for(ll i=0; i<n; i++)
#define REPD(i, n) for(ll i = n - 1; i >= 0; --i)

#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define UNIQ(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define SZ(c) (int)(c).size()

#define CLEAR(x) memset(x,0,sizeof x)
#define FILL(x, v) memset(x,v,sizeof x)
#define COPY(from, to) memcpy(to, from, sizeof to)

#define pb push_back
#define mp make_pair
#define X first
#define Y second

const double eps = 1.0e-11;
const double pi = acos(-1.0);
const int N = 55;
ll a[N], b[N], ab[N], ba[N], bb[N];
int st[N], ed[N];

struct state {
  int st, ed, ins;
  state(int s, int e, int i) : st(s), ed(e), ins(i) {};
};

vector<state> generate(int len) {
  vector<state> res;
  if (len == 1) {
    res.push_back(state(0, 0, 0));
    res.push_back(state(1, 1, 0));
    res.push_back(state(2, 2, 0));
    return res;
  }
  REP(ss, 3) REP(ee, 3) {
    int mx, mn = 0;
    if (ss == 0 && ee == 1) {
      mx = len / 2;
      if (len == 2) mn = 1;
    }
    else {
      if (ss == 0 || ee == 1) mx = (len - 1) / 2;
      else mx = (len - 2) / 2;
    }
    FOR(i, mn, mx) res.push_back(state(ss, ee, i));
  }
  return res;
}

char ch[3] = {'A', 'C', 'X'};

void output(int st, int ed, int ins, int len) {
  cout << ch[st];
  if (len == 1) {
    cout << endl;
    return;
  }
  if (len == 2) {
    cout << ch[ed] << endl;
    return;
  }
  if (!ins) {
    FOR(i, 1, len - 2) cout << "X";
    cout << ch[ed] << endl;
    return;
  }

  if (st != 0 && ed != 1) {
    REP(i, ins) cout << "AC";
    FOR(i, 2 * ins + 1, len - 2) cout << "X";
    cout << ch[ed] << endl;
    return;
  }

  if (st == 0) {
    cout << ch[1];
    REP(i, ins - 1) cout << "AC";
    FOR(i, 2 * ins, len - 2) cout << "X";
  }
  else {
    FOR(i, 1, len - 2) {
      if (i + 2 * ins >= len) {
        if ((len - 1 - i) % 2) cout << "A";
        else cout << "C";
      } else cout << "X";
    }
  }
  if (2 * ins != len) cout << ch[ed] << endl;
}

int main() {
  /*output(0, 0, 0, 1);
  output(1, 1, 0, 1);
  output(2, 2, 0, 1);
  output(1, 1, 0, 2);
  output(1, 1, 0, 3);
  output(2, 1, 4, 9);
  return 0;*/
  int k, x, n, m;
  cin >> k >> x >> n >> m;
  a[1] = 1;
  b[2] = 1;
  st[2] = ed[2] = 1;
  FOR(i, 3, k) {
    a[i] = a[i - 2] + a[i - 1];
    b[i] = b[i - 2] + b[i - 1];
    ab[i] = ab[i - 2] + ab[i - 1];
    ba[i] = ba[i - 2] + ba[i - 1];
    bb[i] = bb[i - 2] + bb[i - 1];
    if (ed[i - 2] == 0 && st[i - 1] == 1) ++ab[i];
    if (ed[i - 2] == 1 && st[i - 1] == 1) ++bb[i];
    if (ed[i - 2] == 1 && st[i - 1] == 0) ++ba[i];
    st[i] = st[i - 2];
    ed[i] = ed[i - 1];
  }
  vector<state> first = generate(n);
  vector<state> second = generate(m);

  REP(i, SZ(first)) REP(j, SZ(second)) {
    ll curr = a[k] * first[i].ins + b[k] * second[j].ins;
    if (first[i].ed == 0 && second[j].st == 1) curr += ab[k];
    if (second[j].ed == 0 && second[j].st == 1) curr += bb[k];
    if (second[j].ed == 0 && first[i].st == 1) curr += ba[k];
    if (curr == x) {
      output(first[i].st, first[i].ed, first[i].ins, n);
      output(second[j].st, second[j].ed, second[j].ins, m);
      return 0;
    }

  }
  cout << "Happy new year!\n";
  return 0;
}


#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <utility>
#include <functional>
#include <bitset>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef pair<int, int> pii;

#define FOR(i, x, y) for(ll i=x; i<=y; i++)
#define FORD(i, x, y) for (ll i = x; i >= y; --i)
#define REP(i, n) for(ll i=0; i<n; i++)
#define REPD(i, n) for(ll i = n - 1; i >= 0; --i)

#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define UNIQ(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define SZ(c) (int)(c).size()

#define CLEAR(x) memset(x,0,sizeof x)
#define FILL(x, v) memset(x,v,sizeof x)
#define COPY(from, to) memcpy(to, from, sizeof to)

#define pb push_back
#define mp make_pair
#define X first
#define Y second

const double eps = 1.0e-11;
const double pi = acos(-1.0);
const int N = 55;
ll a[N], b[N], ab[N], ba[N], bb[N];
int st[N], ed[N];

struct state {
  int st, ed, ins;
  state(int s, int e, int i) : st(s), ed(e), ins(i) {};
};

vector<state> generate(int len) {
  vector<state> res;
  if (len == 1) {
    res.push_back(state(0, 0, 0));
    res.push_back(state(1, 1, 0));
    res.push_back(state(2, 2, 0));
    return res;
  }
  REP(ss, 3) REP(ee, 3) {
    int mx, mn = 0;
    if (ss == 0 && ee == 1) {
      mx = len / 2;
      if (len == 2) mn = 1;
    }
    else {
      if (ss == 0 || ee == 1) mx = (len - 1) / 2;
      else mx = (len - 2) / 2;
    }
    FOR(i, mn, mx) res.push_back(state(ss, ee, i));
  }
  return res;
}

char ch[3] = {'A', 'C', 'X'};

void output(int st, int ed, int ins, int len) {
  cout << ch[st];
  if (len == 1) {
    cout << endl;
    return;
  }
  if (len == 2) {
    cout << ch[ed] << endl;
    return;
  }

  if (st != 0 && ed != 1) {
    REP(i, ins) cout << "AC";
    FOR(i, 2 * ins + 1, len - 2) cout << "X";
    cout << ch[ed] << endl;
    return;
  }

  if (st == 0) {
    cout << ch[1];
    REP(i, ins - 1) cout << "AC";
    FOR(i, 2 * ins, len - 2) cout << "X";
  }
  else {
    FOR(i, 1, len - 2) {
      if (i + 2 * ins >= len) {
        if ((len - 1 - i) % 2) cout << "A";
        else cout << "C";
      } else cout << "X";
    }
  }
  if (2 * ins != len) cout << ch[ed] << endl;
}

int main() {
  /*output(0, 0, 0, 1);
  output(1, 1, 0, 1);
  output(2, 2, 0, 1);
  output(1, 1, 0, 2);
  output(1, 1, 0, 3);
  output(1, 1, 0, 8);
  return 0;*/
  int k, x, n, m;
  cin >> k >> x >> n >> m;
  a[1] = 1;
  b[2] = 1;
  st[2] = ed[2] = 1;
  FOR(i, 3, k) {
    a[i] = a[i - 2] + a[i - 1];
    b[i] = b[i - 2] + b[i - 1];
    ab[i] = ab[i - 2] + ab[i - 1];
    ba[i] = ba[i - 2] + ba[i - 1];
    bb[i] = bb[i - 2] + bb[i - 1];
    if (ed[i - 2] == 0 && st[i - 1] == 1) ++ab[i];
    if (ed[i - 2] == 1 && st[i - 1] == 1) ++bb[i];
    if (ed[i - 2] == 1 && st[i - 1] == 0) ++ba[i];
    st[i] = st[i - 2];
    ed[i] = ed[i - 1];
  }
  vector<state> first = generate(n);
  vector<state> second = generate(m);

  REP(i, SZ(first)) REP(j, SZ(second)) {
    ll curr = a[k] * first[i].ins + b[k] * second[j].ins;
    if (first[i].ed == 0 && second[j].st == 1) curr += ab[k];
    if (second[j].ed == 0 && second[j].st == 1) curr += bb[k];
    if (second[j].ed == 0 && first[i].st == 1) curr += ba[k];
    if (curr == x) {
      output(first[i].st, first[i].ed, first[i].ins, n);
      output(second[j].st, second[j].ed, second[j].ins, m);
      return 0;
    }

  }
  cout << "Happy new year!\n";
  return 0;
}


#define _CRT_SECURE_NO_DEPRECATE

#pragma comment(linker,"/STACK:267386880")

#include <iostream>
#include <functional>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <memory>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <utility>
#include <iterator>
#include <bitset>
#include <sstream>
#include <numeric>
#include <complex>

#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define pdd pair<double,double>
#define LL long long
#define ULL unsigned LL
#define VI vector<int>
#define X first
#define Y second
#define sz(_v) ((int)_v.size())
#define all(_v) (_v).begin(),(_v).end()
#define FOR(i,a,b) for (int i(a); i<=(b); ++i)
#define rep(i,a) FOR(i,1,a)
#define rept(i,a) FOR(i,0,(LL)(a)-1)
#define x1 X1
#define y1 Y1
#define sqr(a) ((a)*(a))
#define C(a) memset((a),0,sizeof (a))
#define MS(a,x) memset((a),(x),sizeof (a))
#define INF 1000000000
#define PI 3.141592653589
#define eps 1e-9
#define MOD 10007
#define PRIME 149

using namespace std;

LL hm[55][3][3];
pii sf[55];
bool ok;

void precalc()
{
    sf[1]=mp(1,1);
    sf[2]=mp(2,2);
    hm[1][0][1]=1;
    hm[2][0][2]=1;
    FOR(i,3,50)
    {
        hm[i][0][1]=hm[i-1][0][1]+hm[i-1][0][1];
        hm[i][0][2]=hm[i-1][0][2]+hm[i-1][0][2];
        sf[i]=mp(sf[i-2].X,sf[i-1].Y);
        rept(j,3) rept(q,3)
            hm[i][j][q]=hm[i-1][j][q]+hm[i-2][j][q];
        hm[i][sf[i-2].Y][sf[i-1].X]++;
    }
}

void putC(string &s, const char &c, int pos)
{
    if (s[pos]!=c && s[pos]!='X')
        ok=false;
    s[pos]=c;
}

void getAns(int n, int m, int nAC, int mAC, int t11, int t12, int t21, int t22)
{
    ok=true;
    string nS,mS;
    rept(i,n)
        nS+="X";
    rept(i,m)
        mS+="X";
    if (t11)
    {
        putC(nS,'C',0);
        putC(nS,'A',n-1);
    }
    if (t12)
    {
        putC(nS,'A',n-1);
        putC(mS,'C',0);
    }
    if (t21)
    {
        putC(mS,'A',m-1);
        putC(nS,'C',0);
    }
    if (t22)
    {
        putC(mS,'C',0);
        putC(mS,'A',m-1);
    }
    if (!t11 && nS[0]=='C' && nS[n-1]=='A')
        return;
    if (!t12 && nS[n-1]=='A' && mS[0]=='C')
        return;
    if (!t21 && mS[m-1]=='A' && nS[0]=='C')
        return;
    if (!t22 && mS[0]=='C' && mS[m-1]=='A')
        return;
    rept(i,n-1)
    {
        if (nAC>0 && nS[i]=='X' && nS[i+1]=='X')
            putC(nS,'A',i),putC(nS,'C',i+1),nAC--;
    }
    rept(i,m-1)
    {
        if (mAC>0 && mS[i]=='X' && mS[i+1]=='X')
            putC(mS,'A',i),putC(mS,'C',i+1),mAC--;
    }
    if (nAC==0 && mAC==0 && ok)
    {
        cout<<nS<<endl;
        cout<<mS<<endl;
        exit(0);
    }
}

void solve()
{
    precalc();
    int k,x,n,m;
    scanf("%d%d%d%d",&k,&x,&n,&m);
    rept(nAC,51) rept(mAC,51)
        rept(t11,2) rept(t12,2) rept(t21,2) rept(t22,2)
    {
        LL res(nAC*1ll*hm[k][0][1]);
        res+=mAC*1ll*hm[k][0][2];
        res+=t11*1ll*hm[k][1][1];
        res+=t12*1ll*hm[k][1][2];
        res+=t21*1ll*hm[k][2][1];
        res+=t22*1ll*hm[k][2][2];
        if (res==x)
        {
            getAns(n,m,nAC,mAC,t11,t12,t21,t22);
        }
    }
    puts("Happy new year!");
}

void bruteforce()
{

}

int main()
{
#ifndef ONLINE_JUDGE
    {
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    }
#endif
    solve();
    bruteforce();
    return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <sstream>
#include <vector>
#include <complex>
#include <ctime>
#include <stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector< VI > VVI;
typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define REP(i, n) for(int i = 0; i < (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define FOR(i, x, y) for(int i = (x); i <= (y); ++i)
#define RFOR(i, x, y) for(int i = (x); i >= (y); --i)
#define SZ(a) (int)(a).size()
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define CLEAR(x) memset(x, 0, sizeof x);
#define COPY(FROM, TO) memcpy(TO, FROM, sizeof TO);
#define UNIQUE(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define pb push_back
#define sqr(x) ((x)*(x))
#define mk make_pair
#define X first
#define Y second
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
const int INF = 1e+9;

struct aaa {
  aaa () {}
  aaa (int l_, int r_, int cnt_) : l(l_), r(r_), cnt(cnt_) {}
  int l, r, cnt;
  aaa operator+ (const aaa& rhs) {
    aaa res;
    res.cnt = cnt + rhs.cnt;
    if (r == 0 && rhs.l == 1) res.cnt++;
    res.l = l, res.r = rhs.r;
    return res;
  }
};
int k, x, n, m;
string s1, s2;
char ch[3] = {'A', 'C', 'X'};
bool isValid (int l1, int r1, int c1, int len) {
  if (len == 1) {
    if (l1 != r1 || c1 > 0)
      return false;
  }
  if (len % 2) {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0) return true;
      else if (r1 == 1) return true;
      else return false;
    } else return true;
  } else {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0 && r1 == 1) return true;
      else return false;
    } else return true;
  }
}
string generate (aaa s, int len) {
  string res;
  if (s.l != 0) {
    res += ch[s.l];
  }
  REP (i, s.cnt)
    res += "AC";
  if (SZ(res) == 0)
    res += ch[s.l];
  int tmp = SZ(res);
  REP (i, len - 1 - tmp) {
    res += "X";
  }
  if (SZ(res) < len) res += ch[s.r];
  return res;
}
int main () {
  cin >> k >> x >> n >> m;
  REP (l1, 3) {
    REP (r1, 3) {
      REP (c1, n / 2 + 1) {
        REP (l2, 3) {
          REP (r2, 3) {
            REP (c2, n / 2 + 1) {
              if (isValid (l1, r1, c1, n) &&  isValid(l2, r2, c2, m)) {
                if (l1 == 0 && r1 == 0 && l2 == 1 && r2 == 1 && c1 == 0 && c2 == 0)
                  int g = 1;
                aaa s1(l1, r1, c1);
                aaa s2(l2, r2, c2);
                aaa t1, t2;
                t1 = s1, t2 = s2;
                REP (step, k - 2) {
                  aaa tmp = s2;
                  s2 = s1 + s2;
                  s1 = tmp;
                }
                if (s2.cnt == x) {
                  cout << generate (t1, n) << endl;
                  cout << generate (t2, m);
                  return 0;
                }
              }
            }
          }
        }
      }
    }
  }
  cout << "Happy new year!";
  return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <sstream>
#include <vector>
#include <complex>
#include <ctime>
#include <stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector< VI > VVI;
typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define REP(i, n) for(int i = 0; i < (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define FOR(i, x, y) for(int i = (x); i <= (y); ++i)
#define RFOR(i, x, y) for(int i = (x); i >= (y); --i)
#define SZ(a) (int)(a).size()
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define CLEAR(x) memset(x, 0, sizeof x);
#define COPY(FROM, TO) memcpy(TO, FROM, sizeof TO);
#define UNIQUE(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define pb push_back
#define sqr(x) ((x)*(x))
#define mk make_pair
#define X first
#define Y second
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
const int INF = 1e+9;

struct aaa {
  aaa () {}
  aaa (int l_, int r_, int cnt_) : l(l_), r(r_), cnt(cnt_) {}
  int l, r;
  ll cnt;
  aaa operator+ (const aaa& rhs) {
    aaa res;
    res.cnt = cnt + rhs.cnt;
    if (r == 0 && rhs.l == 1) res.cnt++;
    res.l = l, res.r = rhs.r;
    return res;
  }
};
int k, x, n, m;
string s1, s2;
char ch[3] = {'A', 'C', 'X'};
bool isValid (int l1, int r1, int c1, int len) {
  if (len == 1) {
    if (l1 != r1 || c1 > 0)
      return false;
    else if (l1 == r1 || c1 == 0)
      return true;
  }
  if (len % 2) {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0) return true;
      else if (r1 == 1) return true;
      else return false;
    } else return true;
  } else {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0 && r1 == 1) return true;
      else return false;
    } else return true;
  }
}
string generate (aaa s, int len) {
  string res;
  if (s.l != 0) {
    res += ch[s.l];
  }
  REP (i, s.cnt)
    res += "AC";
  if (SZ(res) == 0)
    res += ch[s.l];
  int tmp = SZ(res);
  REP (i, len - 1 - tmp) {
    res += "X";
  }
  if (SZ(res) < len) res += ch[s.r];
  return res;
}
int main () {
  cin >> k >> x >> n >> m;
  REP (l1, 3) {
    REP (r1, 3) {
      REP (c1, n / 2 + 1) {
        REP (l2, 3) {
          REP (r2, 3) {
            REP (c2, m / 2 + 1) {
              if (l1 == 2 && r1 == 2 && l2 == 1 && r2 == 0 && c1 == 0 && c2 == 0)
                  int g = 1;
              if (isValid (l1, r1, c1, n) && isValid(l2, r2, c2, m)) {
                aaa s1(l1, r1, c1);
                aaa s2(l2, r2, c2);
                aaa t1, t2;
                t1 = s1, t2 = s2;
                REP (step, k - 2) {
                  aaa tmp = s2;
                  s2 = s1 + s2;
                  s1 = tmp;
                }
                if (s2.cnt == x) {
                  cout << generate (t1, n) << endl;
                  cout << generate (t2, m);
                  return 0;
                }
              }
            }
          }
        }
      }
    }
  }
  cout << "Happy new year!";
  return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <sstream>
#include <vector>
#include <complex>
#include <ctime>
#include <stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector< VI > VVI;
typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define REP(i, n) for(int i = 0; i < (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define FOR(i, x, y) for(int i = (x); i <= (y); ++i)
#define RFOR(i, x, y) for(int i = (x); i >= (y); --i)
#define SZ(a) (int)(a).size()
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define CLEAR(x) memset(x, 0, sizeof x);
#define COPY(FROM, TO) memcpy(TO, FROM, sizeof TO);
#define UNIQUE(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define pb push_back
#define sqr(x) ((x)*(x))
#define mk make_pair
#define X first
#define Y second
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
const int INF = 1e+9;

struct aaa {
  aaa () {}
  aaa (int l_, int r_, int cnt_) : l(l_), r(r_), cnt(cnt_) {}
  int l, r, cnt;
  aaa operator+ (const aaa& rhs) {
    aaa res;
    res.cnt = cnt + rhs.cnt;
    if (r == 0 && rhs.l == 1) res.cnt++;
    res.l = l, res.r = rhs.r;
    return res;
  }
};
int k, x, n, m;
string s1, s2;
char ch[3] = {'A', 'C', 'X'};
bool isValid (int l1, int r1, int c1, int len) {
  if (len == 1) {
    if (l1 != r1 || c1 > 0)
      return false;
  }
  if (len % 2) {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0) return true;
      else if (r1 == 1) return true;
      else return false;
    } else return true;
  } else {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0 && r1 == 1) return true;
      else return false;
    } else return true;
  }
}
string generate (aaa s, int len) {
  string res;
  if (s.l != 0) {
    res += ch[s.l];
  }
  REP (i, s.cnt)
    res += "AC";
  if (SZ(res) == 0)
    res += ch[s.l];
  REP (i, len - 1 - SZ(res)) {
    res += "X";
  }
  if (SZ(res) < len) res += ch[s.r];
  return res;
}
int main () {
  cin >> k >> x >> n >> m;
  REP (l1, 3) {
    REP (r1, 3) {
      REP (c1, n / 2 + 1) {
        REP (l2, 3) {
          REP (r2, 3) {
            REP (c2, n / 2 + 1) {
              if (isValid (l1, r1, c1, n) &&  isValid(l2, r2, c2, m)) {
                if (l1 == 0 && r1 == 0 && l2 == 1 && r2 == 1 && c1 == 0 && c2 == 0)
                  int g = 1;
                aaa s1(l1, r1, c1);
                aaa s2(l2, r2, c2);
                aaa t1, t2;
                t1 = s1, t2 = s2;
                REP (step, k - 2) {
                  aaa tmp = s2;
                  s2 = s1 + s2;
                  s1 = tmp;
                }
                if (s2.cnt == x) {
                  cout << generate (t1, n) << endl;
                  cout << generate (t2, m);
                  return 0;
                }
              }
            }
          }
        }
      }
    }
  }
  cout << "Happy new year!";
  return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <sstream>
#include <vector>
#include <complex>
#include <ctime>
#include <stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector< VI > VVI;
typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define REP(i, n) for(int i = 0; i < (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define FOR(i, x, y) for(int i = (x); i <= (y); ++i)
#define RFOR(i, x, y) for(int i = (x); i >= (y); --i)
#define SZ(a) (int)(a).size()
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define CLEAR(x) memset(x, 0, sizeof x);
#define COPY(FROM, TO) memcpy(TO, FROM, sizeof TO);
#define UNIQUE(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define pb push_back
#define sqr(x) ((x)*(x))
#define mk make_pair
#define X first
#define Y second
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
const int INF = 1e+9;

struct aaa {
  aaa () {}
  aaa (int l_, int r_, int cnt_) : l(l_), r(r_), cnt(cnt_) {}
  int l, r, cnt;
  aaa operator+ (const aaa& rhs) {
    aaa res;
    res.cnt = cnt + rhs.cnt;
    if (r == 0 && rhs.l == 1) res.cnt++;
    res.l = l, res.r = rhs.r;
    return res;
  }
};
int k, x, n, m;
string s1, s2;
char ch[3] = {'A', 'C', 'X'};
bool isValid (int l1, int r1, int c1, int len) {
  if (len % 2) {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0) return true;
      else if (r1 == 1) return true;
      else return false;
    } else return true;
  } else {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0 && r1 == 1) return true;
      else return false;
    } else return true;
  }
}
string generate (aaa s, int len) {
  string res;
  if (s.l != 0) {
    res += ch[s.l];
  }
  REP (i, s.cnt)
    res += "AC";
  if (SZ(res) == 0)
    res += ch[s.l];
  REP (i, len - 1 - SZ(res)) {
    res += "X";
  }
  if (SZ(res) < len) res += ch[s.r];
  return res;
}
int main () {
  cin >> k >> x >> n >> m;
  REP (l1, 3) {
    REP (r1, 3) {
      REP (c1, n / 2 + 1) {
        REP (l2, 3) {
          REP (r2, 3) {
            REP (c2, n / 2 + 1) {
              if (isValid (l1, r1, c1, n) &&  isValid(l2, r2, c2, m)) {
                if (l1 == 0 && r1 == 1 && l2 == 0 && r2 == 1 && c1 == 1 && c2 == 1)
                  int g = 1;
                aaa s1(l1, r1, c1);
                aaa s2(l2, r2, c2);
                aaa t1, t2;
                t1 = s1, t2 = s2;
                REP (step, k - 2) {
                  aaa tmp = s2;
                  s2 = s1 + s2;
                  s1 = s2;
                }
                if (s2.cnt == x) {
                  cout << generate (t1, n) << endl;
                  cout << generate (t2, m);
                  return 0;
                }
              }
            }
          }
        }
      }
    }
  }
  cout << "Happy new year!";
  return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <sstream>
#include <vector>
#include <complex>
#include <ctime>
#include <stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector< VI > VVI;
typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define REP(i, n) for(int i = 0; i < (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define FOR(i, x, y) for(int i = (x); i <= (y); ++i)
#define RFOR(i, x, y) for(int i = (x); i >= (y); --i)
#define SZ(a) (int)(a).size()
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define CLEAR(x) memset(x, 0, sizeof x);
#define COPY(FROM, TO) memcpy(TO, FROM, sizeof TO);
#define UNIQUE(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define pb push_back
#define sqr(x) ((x)*(x))
#define mk make_pair
#define X first
#define Y second
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
const int INF = 1e+9;

struct aaa {
  aaa () {}
  aaa (int l_, int r_, int cnt_) : l(l_), r(r_), cnt(cnt_) {}
  int l, r;
  ll cnt;
  aaa operator+ (const aaa& rhs) {
    aaa res;
    res.cnt = cnt + rhs.cnt;
    if (r == 0 && rhs.l == 1) res.cnt++;
    res.l = l, res.r = rhs.r;
    return res;
  }
};
int k, x, n, m;
string s1, s2;
char ch[3] = {'A', 'C', 'X'};
bool isValid (int l1, int r1, int c1, int len) {
  if (len == 1) {
    if (l1 != r1 || c1 > 0)
      return false;
    else if (l1 == r1 || c1 == 0)
      return true;
  }
  if (len == 2) {
    if (l1 == 0 && r1 == 1 && c1 == 1)
      return true;
    else if (!(l1 == 0 && r1 == 1) && c1 == 0)
      return true;
    else return false;
  }
  if (len % 2) {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0) return true;
      else if (r1 == 1) return true;
      else return false;
    } else return true;
  } else {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0 && r1 == 1) return true;
      else return false;
    } else return true;
  }
}
string generate (aaa s, int len) {
  string res;
  if (s.l != 0) {
    res += ch[s.l];
  }
  REP (i, s.cnt)
    res += "AC";
  if (SZ(res) == 0)
    res += ch[s.l];
  int tmp = SZ(res);
  REP (i, len - 1 - tmp) {
    res += "X";
  }
  if (SZ(res) < len) res += ch[s.r];
  return res;
}
int main () {
  cin >> k >> x >> n >> m;
  REP (l1, 3) {
    REP (r1, 3) {
      REP (c1, n / 2 + 1) {
        REP (l2, 3) {
          REP (r2, 3) {
            REP (c2, m / 2 + 1) {
              if (l1 == 0 && r1 == 1 && l2 == 1 && r2 == 0 && c1 == 1 && c2 == 0)
                  int g = 1;
              if (isValid (l1, r1, c1, n) && isValid(l2, r2, c2, m)) {
                aaa s1(l1, r1, c1);
                aaa s2(l2, r2, c2);
                aaa t1, t2;
                t1 = s1, t2 = s2;
                REP (step, k - 2) {
                  aaa tmp = s2;
                  s2 = s1 + s2;
                  s1 = tmp;
                }
                if (s2.cnt == x) {
                  cout << generate (t1, n) << endl;
                  cout << generate (t2, m);
                  return 0;
                }
              }
            }
          }
        }
      }
    }
  }
  cout << "Happy new year!";
  return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <sstream>
#include <vector>
#include <complex>
#include <ctime>
#include <stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector< VI > VVI;
typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define REP(i, n) for(int i = 0; i < (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define FOR(i, x, y) for(int i = (x); i <= (y); ++i)
#define RFOR(i, x, y) for(int i = (x); i >= (y); --i)
#define SZ(a) (int)(a).size()
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define CLEAR(x) memset(x, 0, sizeof x);
#define COPY(FROM, TO) memcpy(TO, FROM, sizeof TO);
#define UNIQUE(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define pb push_back
#define sqr(x) ((x)*(x))
#define mk make_pair
#define X first
#define Y second
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
const int INF = 1e+9;

struct aaa {
  aaa () {}
  aaa (int l_, int r_, int cnt_) : l(l_), r(r_), cnt(cnt_) {}
  int l, r, cnt;
  aaa operator+ (const aaa& rhs) {
    aaa res;
    res.cnt = cnt + rhs.cnt;
    if (r == 0 && rhs.l == 1) res.cnt++;
    res.l = l, res.r = rhs.r;
    return res;
  }
};
int k, x, n, m;
string s1, s2;
char ch[3] = {'A', 'C', 'X'};
bool isValid (int l1, int r1, int c1, int len) {
  if (len % 2) {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0) return true;
      else if (r1 == 1) return true;
      else return false;
    } else return true;
  } else {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0 && r1 == 1) return true;
      else return false;
    } else return true;
  }
}
string generate (aaa s, int len) {
  string res;
  if (s.l != 0) {
    res += ch[s.l];
  }
  REP (i, s.cnt)
    res += "AC";
  if (SZ(res) == 0)
    res += ch[s.l];
  REP (i, len - 1 - SZ(res)) {
    res += "X";
  }
  if (SZ(res) < len) res += ch[s.r];
  return res;
}
int main () {
  cin >> k >> x >> n >> m;
  REP (l1, 3) {
    REP (r1, 3) {
      REP (c1, n / 2 + 1) {
        REP (l2, 3) {
          REP (r2, 3) {
            REP (c2, n / 2 + 1) {
              if (isValid (l1, r1, c1, n) &&  isValid(l2, r2, c2, m)) {
                if (l1 == 0 && r1 == 1 && l2 == 0 && r2 == 1 && c1 == 1 && c2 == 1)
                  int g = 1;
                aaa s1(l1, r1, c1);
                aaa s2(l2, r2, c2);
                aaa t1, t2;
                t1 = s1, t2 = s2;
                REP (step, k - 2) {
                  aaa tmp = s2;
                  s2 = s1 + s2;
                  s1 = s2;
                }
                if (s2.cnt == x) {
                  cout << generate (t1, n) << endl;
                  cout << generate (t2, m);
                  return 0;
                }
              }
            }
          }
        }
      }
    }
  }
  cout << "Happy New Year!";
  return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <sstream>
#include <vector>
#include <complex>
#include <ctime>
#include <stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector< VI > VVI;
typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define REP(i, n) for(int i = 0; i < (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define FOR(i, x, y) for(int i = (x); i <= (y); ++i)
#define RFOR(i, x, y) for(int i = (x); i >= (y); --i)
#define SZ(a) (int)(a).size()
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define CLEAR(x) memset(x, 0, sizeof x);
#define COPY(FROM, TO) memcpy(TO, FROM, sizeof TO);
#define UNIQUE(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define pb push_back
#define sqr(x) ((x)*(x))
#define mk make_pair
#define X first
#define Y second
const long double PI = acos(-1.0);
const long double EPS = 1e-9;
const int INF = 1e+9;

struct aaa {
  aaa () {}
  aaa (int l_, int r_, int cnt_) : l(l_), r(r_), cnt(cnt_) {}
  int l, r;
  ll cnt;
  aaa operator+ (const aaa& rhs) {
    aaa res;
    res.cnt = cnt + rhs.cnt;
    if (r == 0 && rhs.l == 1) res.cnt++;
    res.l = l, res.r = rhs.r;
    return res;
  }
};
int k, x, n, m;
string s1, s2;
char ch[3] = {'A', 'C', 'X'};
bool isValid (int l1, int r1, int c1, int len) {
  if (len == 1) {
    if (l1 != r1 || c1 > 0)
      return false;
  }
  if (len % 2) {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0) return true;
      else if (r1 == 1) return true;
      else return false;
    } else return true;
  } else {
    if (c1 > len / 2) return false;
    else if (c1 == len / 2) {
      if (l1 == 0 && r1 == 1) return true;
      else return false;
    } else return true;
  }
}
string generate (aaa s, int len) {
  string res;
  if (s.l != 0) {
    res += ch[s.l];
  }
  REP (i, s.cnt)
    res += "AC";
  if (SZ(res) == 0)
    res += ch[s.l];
  int tmp = SZ(res);
  REP (i, len - 1 - tmp) {
    res += "X";
  }
  if (SZ(res) < len) res += ch[s.r];
  return res;
}
int main () {
  cin >> k >> x >> n >> m;
  REP (l1, 3) {
    REP (r1, 3) {
      REP (c1, n / 2 + 1) {
        REP (l2, 3) {
          REP (r2, 3) {
            REP (c2, n / 2 + 1) {
              if (isValid (l1, r1, c1, n) &&  isValid(l2, r2, c2, m)) {
                if (l1 == 0 && r1 == 0 && l2 == 1 && r2 == 1 && c1 == 0 && c2 == 1)
                  int g = 1;
                aaa s1(l1, r1, c1);
                aaa s2(l2, r2, c2);
                aaa t1, t2;
                t1 = s1, t2 = s2;
                REP (step, k - 2) {
                  aaa tmp = s2;
                  s2 = s1 + s2;
                  s1 = tmp;
                }
                if (s2.cnt == x) {
                  cout << generate (t1, n) << endl;
                  cout << generate (t2, m);
                  return 0;
                }
              }
            }
          }
        }
      }
    }
  }
  cout << "Happy new year!";
  return 0;
}


#pragma comment(linker, "/STACK:256000000")
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>

using namespace std;

    long long ks1, ks2, k12, k21, k22;
    long long k, x, n, m;
    string s1, s2;

bool f00() {
  for (long long ii = 0; ii <= n/2; ii++) {
    for (long long jj = 0; jj <= m/2; jj++) {
      if (ii * ks1 + jj * ks2 == x) {
        int ll = 0;
        while (ii > 0) {
          ii--;
          ll+=2;
          s1 = s1+ "AC";
        }
        while (ll < n) {
          s1 = s1 + "D";
          ll++;
        }
        ll = 0;
        while (jj > 0) {
          jj--;
          ll+=2;
          s2 = s2 + "AC";
        }
        while (ll < m) {
          s2 = s2 + "D";
          ll++;
        }
        return true;
      }
    }
  }
  return false;
}

bool f12() {
  n--;
  m--;
  x-= k12;
  if (f00()) {
    s1 = s1 + "A";
    s2 = "C" + s2;
    return true;
  }
  x+=k12;
  n++;
  m++;
  return false;
}

bool f22() {
  m--;
  m--;
  x-=k22;
  if (f00()) {
    s2 = "C" + s2 + "A";
    return true;
  }
  if (f12()) {
    m++;
    s2 = s2 + "A";
    return true;
    m--;
  }
  x+=k22;
  m++;
  m++;
  return false;
}

bool f21() {
  n--;
  m--;
  x-=k21;
  if (f00()) {
    s1 = "C" + s1;
    s2 = s2 + "A";
    return true;
  }
  if (f22()) {
    m++;
    s1 = "C" + s1;
    return true;
    m--;
  }
  n++;
  m++;
  x+=k12;
  return false;
}

bool f() {
  if (f00()) {
    return true;
  }
  if (f12()) {
    return true;
  }
  if (f21()) {
    return true;
  }
  if (f22()) {
    return true;
  }
  cout << "Happy new year!\n";
  return false;
}

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

    cin >> k >> x >> n >> m;
    long long u, i, o, s;

    u = 1;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
    }
    ks1 = i;

    u = 0;
    i = 1;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
    }
    ks2 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o == 3) {
        i++;
      }
    }
    k12 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o % 2 == 0) {
        i++;
      }
    }
    k21 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o % 2 == 1 && o > 3) {
        i++;
      }
    }
    k22 = i;

    if (f()) {
      cout << s1 << endl;
      cout << s2 << endl;
    }

   int kol234;
   cin >> kol234;
}


#pragma comment(linker, "/STACK:256000000")
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>

using namespace std;

    long long ks1, ks2, k12, k21, k22;
    long long k, x, n, m;
    string s1, s2;

bool f00() {
  if (n*m < 0)
    return false;
  for (long long ii = 0; ii <= n/2; ii++) {
    for (long long jj = 0; jj <= m/2; jj++) {
      if (ii * ks1 + jj * ks2 == x) {
        int ll = 0;
        while (ii > 0) {
          ii--;
          ll+=2;
          s1 = s1+ "AC";
        }
        while (ll < n) {
          s1 = s1 + "D";
          ll++;
        }
        ll = 0;
        while (jj > 0) {
          jj--;
          ll+=2;
          s2 = s2 + "AC";
        }
        while (ll < m) {
          s2 = s2 + "D";
          ll++;
        }
        return true;
      }
    }
  }
  return false;
}

bool f12() {
  n--;
  m--;
  x-= k12;
  if (f00()) {
    s1 = s1 + "A";
    s2 = "C" + s2;
    return true;
  }
  x+=k12;
  n++;
  m++;
  return false;
}

bool f22() {
  m--;
  m--;
  x-=k22;
  if (f00()) {
    s2 = "C" + s2 + "A";
    return true;
  }
      m++;
  if (f12()) {
    s2 = s2 + "A";
    return true;
  }
      m--;
  x+=k22;
  m++;
  m++;
  return false;
}

bool f21() {
  n--;
  m--;
  x-=k21;
  if (f00()) {
    s1 = "C" + s1;
    s2 = s2 + "A";
    return true;
  }
      m++;
  if (f22()) {
    s1 = "C" + s1;
    return true;
  }
  m--;
  n++;
  m++;
  x+=k12;
  return false;
}

bool f() {
  if (f00()) {
    return true;
  }
  if (f12()) {
    return true;
  }
  if (f21()) {
    return true;
  }
  if (f22()) {
    return true;
  }
  cout << "Happy new year!\n";
  return false;
}

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

    cin >> k >> x >> n >> m;
    long long u, i, o, s;

    u = 1;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
    }
    ks1 = i;

    u = 0;
    i = 1;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
    }
    ks2 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o == 3) {
        i++;
      }
    }
    k12 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o % 2 == 0) {
        i++;
      }
    }
    k21 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o % 2 == 1 && o > 3) {
        i++;
      }
    }
    k22 = i;

    if (f()) {
      cout << s1 << endl;
      cout << s2 << endl;
    }

   int kol234;
   cin >> kol234;
}


#pragma comment(linker, "/STACK:256000000")
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>

using namespace std;

    long long ks1, ks2, k12, k21, k22;
    long long k, x, n, m;
    string s1, s2;

bool f00() {
  if (n< 0 || m < 0)
    return false;
  for (long long ii = 0; ii <= n/2; ii++) {
    for (long long jj = 0; jj <= m/2; jj++) {
      if (ii * ks1 + jj * ks2 == x) {
        int ll = 0;
        while (ii > 0) {
          ii--;
          ll+=2;
          s1 = s1+ "AC";
        }
        while (ll < n) {
          s1 = s1 + "D";
          ll++;
        }
        ll = 0;
        while (jj > 0) {
          jj--;
          ll+=2;
          s2 = s2 + "AC";
        }
        while (ll < m) {
          s2 = s2 + "D";
          ll++;
        }
        return true;
      }
    }
  }
  return false;
}

bool f12() {
  n--;
  m--;
  x-= k12;
  if (f00()) {
    s1 = s1 + "A";
    s2 = "C" + s2;
    return true;
  }
  x+=k12;
  n++;
  m++;
  return false;
}

bool f22() {
  m--;
  m--;
  x-=k22;
  if (f00()) {
    s2 = "C" + s2 + "A";
    return true;
  }
      m++;
  if (f12()) {
    s2 = s2 + "A";
    return true;
  }
      m--;
  x+=k22;
  m++;
  m++;
  return false;
}

bool f21() {
  n--;
  m--;
  x-=k21;
  if (f00()) {
    s1 = "C" + s1;
    s2 = s2 + "A";
    return true;
  }
      m++;
  if (f22()) {
    s1 = "C" + s1;
    return true;
  }
  m--;
  n++;
  m++;
  x+=k21;
  return false;
}

bool f() {
  if (f00()) {
    return true;
  }
  if (f12()) {
    return true;
  }
  if (f21()) {
    return true;
  }
  if (f22()) {
    return true;
  }
  cout << "Happy new year!\n";
  return false;
}

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

    cin >> k >> x >> n >> m;
    long long u, i, o, s;

    u = 1;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
    }
    ks1 = i;

    u = 0;
    i = 1;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
    }
    ks2 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o == 3) {
        i++;
      }
    }
    k12 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o % 2 == 0) {
        i++;
      }
    }
    k21 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o % 2 == 1 && o > 3) {
        i++;
      }
    }
    k22 = i;

    if (f()) {
      cout << s1 << endl;
      cout << s2 << endl;
    }

   int kol234;
   cin >> kol234;
}


#pragma comment(linker, "/STACK:256000000")
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>

using namespace std;

    long long ks1, ks2, k12, k21, k22;
    long long k, x, n, m;
    string s1, s2;

bool f00() {
  for (long long ii = 0; ii <= n/2; ii++) {
    for (long long jj = 0; jj <= m/2; jj++) {
      if (ii * ks1 + jj * ks2 == x) {
        int ll = 0;
        while (ii > 0) {
          ii--;
          ll+=2;
          s1 = s1+ "AC";
        }
        while (ll < n) {
          s1 = s1 + "D";
          ll++;
        }
        ll = 0;
        while (jj > 0) {
          jj--;
          ll+=2;
          s2 = s2 + "AC";
        }
        while (ll < m) {
          s2 = s2 + "D";
          ll++;
        }
        return true;
      }
    }
  }
  return false;
}

bool f12() {
  n--;
  m--;
  x-= k12;
  if (f00()) {
    s1 = s1 + "A";
    s2 = "C" + s2;
    return true;
  }
  x+=k12;
  n++;
  m++;
  return false;
}

bool f22() {
  m--;
  m--;
  x-=k22;
  if (f00()) {
    s2 = "C" + s2 + "A";
    return true;
  }
      m++;
  if (f12()) {
    s2 = s2 + "A";
    return true;
  }
      m--;
  x+=k22;
  m++;
  m++;
  return false;
}

bool f21() {
  n--;
  m--;
  x-=k21;
  if (f00()) {
    s1 = "C" + s1;
    s2 = s2 + "A";
    return true;
  }
      m++;
  if (f22()) {
    s1 = "C" + s1;
    return true;
  }
  m--;
  n++;
  m++;
  x+=k12;
  return false;
}

bool f() {
  if (f00()) {
    return true;
  }
  if (f12()) {
    return true;
  }
  if (f21()) {
    return true;
  }
  if (f22()) {
    return true;
  }
  cout << "Happy new year!\n";
  return false;
}

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

    cin >> k >> x >> n >> m;
    long long u, i, o, s;

    u = 1;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
    }
    ks1 = i;

    u = 0;
    i = 1;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
    }
    ks2 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o == 3) {
        i++;
      }
    }
    k12 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o % 2 == 0) {
        i++;
      }
    }
    k21 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o % 2 == 1 && o > 3) {
        i++;
      }
    }
    k22 = i;

    if (f()) {
      cout << s1 << endl;
      cout << s2 << endl;
    }

   int kol234;
   cin >> kol234;
}


#pragma comment(linker, "/STACK:256000000")
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>

using namespace std;

    long long ks1, ks2, k12, k21, k22;
    long long k, x, n, m;
    string s1, s2;

bool f00() {
  if (n< 0 || m < 0)
    return false;
  for (long long ii = 0; ii <= n/2; ii++) {
    for (long long jj = 0; jj <= m/2; jj++) {
      if (ii * ks1 + jj * ks2 == x) {
        int ll = 0;
        while (ii > 0) {
          ii--;
          ll+=2;
          s1 = s1+ "AC";
        }
        while (ll < n) {
          s1 = s1 + "D";
          ll++;
        }
        ll = 0;
        while (jj > 0) {
          jj--;
          ll+=2;
          s2 = s2 + "AC";
        }
        while (ll < m) {
          s2 = s2 + "D";
          ll++;
        }
        return true;
      }
    }
  }
  return false;
}

bool f12() {
  n--;
  m--;
  x-= k12;
  if (f00()) {
    s1 = s1 + "A";
    s2 = "C" + s2;
    return true;
  }
  x+=k12;
  n++;
  m++;
  return false;
}

bool f22() {
  m--;
  m--;
  x-=k22;
  if (f00()) {
    s2 = "C" + s2 + "A";
    return true;
  }
      m++;
  if (f12()) {
    s2 = s2 + "A";
    return true;
  }
      m--;
  x+=k22;
  m++;
  m++;
  return false;
}

bool f21() {
  n--;
  m--;
  x-=k21;
  if (f00()) {
    s1 = "C" + s1;
    s2 = s2 + "A";
    return true;
  }
      m++;
  if (f22()) {
    s1 = "C" + s1;
    return true;
  }
  m--;
  n++;
  m++;
  x+=k12;
  return false;
}

bool f() {
  if (f00()) {
    return true;
  }
  if (f12()) {
    return true;
  }
  if (f21()) {
    return true;
  }
  if (f22()) {
    return true;
  }
  cout << "Happy new year!\n";
  return false;
}

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

    cin >> k >> x >> n >> m;
    long long u, i, o, s;

    u = 1;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
    }
    ks1 = i;

    u = 0;
    i = 1;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
    }
    ks2 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o == 3) {
        i++;
      }
    }
    k12 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o % 2 == 0) {
        i++;
      }
    }
    k21 = i;

    u = 0;
    i = 0;
    o = 2;
    while (k > o) {
      s = i + u;
      u = i;
      i = s;
      o++;
      if (o % 2 == 1 && o > 3) {
        i++;
      }
    }
    k22 = i;

    if (f()) {
      cout << s1 << endl;
      cout << s2 << endl;
    }

   int kol234;
   cin >> kol234;
}


//#pragma comment(linker, "/STACK:134217728")
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
//#include <ctime>
using namespace std;

typedef pair<int,int> PII;
typedef vector<int> VI;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); --i)
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define ALL(a) (a).begin(),(a).end()
#define PB push_back
#define MP make_pair
#define MOD 1000000007
#define INF 1000000007
#define y1 agaga
#define ll long long
#define pi acos(-1.0)

int n;
long long  c12[55];
long long  c21[55];
long long  c22[55];
long long k1[55];
long long k2[55];

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(false);

    k1[1]=1;
    k2[1]=0;

    k1[2]=0;
    k2[2]=1;

    FOR(i,3,51)
    {
	    k1[i]=k1[i-2]+k1[i-1];
	    k2[i]=k2[i-2]+k2[i-1];
    }

    ////////////

    FOR(i,0,4)
    {
	    c12[i]=0;
	    c21[i]=0;
	    c22[i]=0;
    }

    c12[3]=1;

    FOR(i,4,51)
    {
	c12[i]=c12[i-2]+c12[i-1];
	c21[i]=c21[i-2]+c21[i-1];
	c22[i]=c22[i-2]+c22[i-1];

	if (i%2==0)
		c21[i]++;
	else
		c22[i]++;
    }

    /*FOR(i,0,51)
    {
	    cout << " i=" << i << endl;

	    cout << " K1=" << k1[i] << " K2=" << k2[i] << endl;

	    cout << c12[i] << " " << c22[i] << " " << c21[i] << endl;
    }*/

    int k,x,n,m;
    string s1="";
    string s2="";

    cin >> k >> x >> n >> m;

    bool ok=false;

    //////  with no condition

    FOR(i,0,n/2+1)
	    FOR(j,0,m/2+1)
	    if (i*k1[k]+j*k2[k]==x)
	    {
		    FOR(q,0,i)
			    s1+="AC";
		    while (s1.size()<n)
			    s1+='A';

		    FOR(q,0,j)
			    s2+="AC";
		    while (s2.size()<m)
			    s2+='A';

		    cout << s1 << endl << s2 << endl;
		    return 0;
	    }

    ////// first condition

    FOR(i,0,n)
	    s1+='A';

    FOR(i,0,m)
	    s2+='A';

       FOR(i,0,(n-1)/2+1)
	    FOR(j,0,(m-1)/2+1)
	    if (i*k1[k]+j*k2[k]+c12[k]==x)
	    {

		   if (ok) cout << "first" << endl;

		s2[m-1]='Z';
		s2[0]='C';

		FOR(q,0,i)
			s1[q*2+1]='C';
		FOR(q,0,j)
			s2[(q+1)*2]='C';

		    cout << s1 << endl << s2 << endl;
		    return 0;
	    }

    /// second

	         FOR(i,0,(n-1)/2+1)
	    FOR(j,0,(m-1)/2+1)
	    if (i*k1[k]+j*k2[k]+c21[k]==x)
	    {

		s1[0]='C';

		FOR(q,0,i)
			s1[q*2+2]='C';
		FOR(q,0,j)
			s2[q*2+1]='C';

		    cout << s1 << endl << s2 << endl;
		    return 0;
	    }

    //// third

	  FOR(i,0,(n-1)/2+1)
	    FOR(j,0,(m-1)/2+1)
	    if (i*k1[k]+j*k2[k]+c22[k]==x)
	    {

		s1[n-1]='Z';
		s2[0]='C';

		//cout << i <<  " " << j << endl;

		FOR(q,0,i)
			s1[q*2+1]='C';
		FOR(q,0,j)
			s2[q*2+1]='C';

		    cout << s1 << endl << s2 << endl;
		    return 0;
	    }

    /// 1 + 2

	   FOR(i,0,(n-2)/2+1)
	    FOR(j,0,(m-2)/2+1)
	   {
	    if (i*k1[k]+j*k2[k]+c12[k]+c21[k]+(1-m%2)*c22[k]==x)
	    {
		    s1[0]='C';
		    s2[0]='C';

		FOR(q,0,i)
			s1[q*2+2]='C';
		FOR(q,0,j)
			s2[q*2+2]='C';

		    cout << s1 << endl << s2 << endl;
		    return 0;
	    }
	   }

   //// 1 + 3

	   FOR(i,0,(n-1)/2+1)
	    FOR(j,0,(m-1)/2+1)
	    if (i*k1[k]+j*k2[k]+c12[k]+c22[k]==x)
	    {

		s2[0]='C';

		FOR(q,0,i)
			s1[q*2+1]='C';
		FOR(q,0,j)
			s2[(q+1)*2]='C';

		    cout << s1 << endl << s2 << endl;
		    return 0;
	    }

    cout << "Happy new year!" << endl;

    return 0;
}