先看几个例子\\ yyccyycc 满足条件n=2n = 2\\ yyyccyyycc 满足条件n=6n = 6\\ yyyyccyyyycc 满足条件n=12n = 12\\ yyyyyccyyyyycc满足条件n=20n = 20,此时你肯定一定有点思路了,这里直接给出结论如果有kkyy末尾有cccc的情况那么最少会产生kkkk*k-kyycyyc字串,为什么说最少呢,因为我们可以在这个基础上添加CC使得可以构造3,4,5,7,8,9,10,11……等任意个yycyyc\\ 举个例子,如果我们要构造的nn是7我们只需要在yyyccyyycc的基础上在开头两个yy后面添加一个cc即可,所以对于任意的nn,我们先求出kk,然后再求还需要多少个cc,然后按照"yy+c+k2y+cc""yy+另需多少c+k-2个y+cc"这样的构造方法构造字符串ss即可。

#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
# include<iostream>
# include<iomanip>
# include<algorithm>
# include<cmath>
# include<cstdio>
# include<set>
# include<stack>
# include<queue> 
# include<map>
# include<string>
# include<cstring> 
 
# define eps 1e-9
# define fi first
# define se second
# define ll long long
# define int ll
// cout<<fixed<<setprecision(n) 
using namespace std;
 
typedef unsigned long long ull;
typedef pair<int,int > PII; 
const int mod=1e9+7;
const int MAX=1e5+10;
const int Time=86400;
const int X=131;
const int inf=0x3f3f3f3f;
const double PI = 1e-4;
double pai = 3.14159265358979323846; 

int T,n,dp[MAX],pre[2][15];

void solve(){
	  string s;
	  cin >> n ;
	  if(n == 1){ //特判n=1 因为我们默认构造最小是yycc
	  	 cout<<"3\nyyc\n";
	  	 return;
	  }
	  int k = sqrt(n) + 1;
	  if((k-1) * k > n ) k--; //总共需要多少个y
	 
	  int x = k - 2;  //除了开头2个y还需要多少个y
	  int m = n - (k * k - k);//除了末尾两个c中间还需要多少个c
	  s = "yy";
	  for(int i = 0 ; i < m ; i ++ )  s += 'c';
	  for(int i = 0 ; i < x ; i ++ )  s += 'y';
	  
	  s +=  "cc"; 
	  cout<<s.size() <<"\n" << s<<"\n";
	  
}


signed main(){  
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> T;
    while(T--){
    	solve();
	}

    return 0;
}