CF379D.New Year Letter

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Many countries have such a New Year or Christmas tradition as writing a letter to Santa including a wish list for presents. Vasya is an ordinary programmer boy. Like all ordinary boys, he is going to write the letter to Santa on the New Year Eve (we Russians actually expect Santa for the New Year, not for Christmas).

Vasya has come up with an algorithm he will follow while writing a letter. First he chooses two strings, s1s_{1} anf s2s_{2} , consisting of uppercase English letters. Then the boy makes string sks_{k} , using a recurrent equation sn=sn2+sn1s_{n}=s_{n-2}+s_{n-1} , operation '+' means a concatenation (that is, the sequential record) of strings in the given order. Then Vasya writes down string sks_{k} on a piece of paper, puts it in the envelope and sends in to Santa.

Vasya is absolutely sure that Santa will bring him the best present if the resulting string sks_{k} has exactly xx occurrences of substring AC (the short-cut reminds him оf accepted problems). Besides, Vasya decided that string s1s_{1} should have length nn , and string s2s_{2} should have length mm . Vasya hasn't decided anything else.

At the moment Vasya's got urgent New Year business, so he asks you to choose two strings for him, s1s_{1} and s2s_{2} in the required manner. Help Vasya.

输入格式

The first line contains four integers k,x,n,mk,x,n,m (3<=k<=50; 0<=x<=109; 1<=n,m<=100)(3<=k<=50; 0<=x<=10^{9}; 1<=n,m<=100) .

输出格式

In the first line print string s1s_{1} , consisting of nn uppercase English letters. In the second line print string s2s_{2} , consisting of mm uppercase English letters. If there are multiple valid strings, print any of them.

If the required pair of strings doesn't exist, print "Happy new year!" without the quotes.

输入输出样例

  • 输入#1

    3 2 2 2
    

    输出#1

    AC
    AC
    
  • 输入#2

    3 3 2 2
    

    输出#2

    Happy new year!
    
  • 输入#3

    3 0 2 2
    

    输出#3

    AA
    AA
    
  • 输入#4

    4 3 2 1
    

    输出#4

    Happy new year!
    
  • 输入#5

    4 2 2 1
    

    输出#5

    Happy new year!
    
首页