#include<bits/stdc++.h>
using namespace std;
char in[100], out[100];

int main(){
	for(int I=1;I<=20;I++){
		int a, i;
		char c;
		string s, ans="", cnt ="";
		//cin >> s;
		stack <char > S;
		for(i=0;i<30;i++){
			a = rand()%3;
			c = 'a'+a;
			cnt += c;
			if(S.empty()){
				S.push(c);
			}else{
				if(S.top()==c){
					while(!S.empty() and S.top()==c ){
						S.pop();
						a = c-'a';
						a += 1;
						a %= 3;
						c = a+'a';
					}
					S.push(c);	
				}else{
					S.push(c);
				}
			}
		}
		while(!S.empty()){
			ans = S.top()+ans;
			S.pop();
		}
		sprintf(in,".%d.in",I);
	    freopen(in,"w",stdout);
		cout<<cnt<<"\n";
		
		sprintf(in,".%d.out",I);
	    freopen(in,"w",stdout);
		cout<<ans<<"\n";
	}
}
