brtakoktrosttttttttttosafasfkalsfkodfdasiofhadfhasdsajfdsafoasodsafahaihfdisoadspapsapiosapdsajdipsahdhasuirhaeuifhhfkjgosooooooooodafdfioottttafdsafaddfuiasdjfjasdo
okat
tako
 aleksandrehteosidatedodam
evo
si
 goodbyeihopecontestisntsohar
oh
god
 duxidimkeetoivas
dd
odi
 hellodeninobrdo
od
hel
 ikbalturkeybelieveinyou
bal
kan
 zdule
didins
meinkraft
 cumurcumur
um
cur
 ikatanictisinajboljiuhrvatskojakoprictasovojaviseakotijedosadno
javise
sine
 zlobobermyfriendandthanksforhelp
de
for
 navijamzaradnickiastabidrugo
druzina
djavola
 saljivdzijasamjaneki
neki
ja
 bumbumdzejsikerol
bumbum
bum
 svetislavgajicpoznatijikaosvetaxxx
slavi
slavu
 princeofpersiayouhavegreatcontestbutinwrongtime
op
pera
 pozdravizamarkamatovicaaleksandracveticainenadaslagalicustanisica
vas
rad
 dreamoonhasonedream
no
no
 jankosustersicneceovoraditi
cosovic
oce
 milenicnikolaitisideotakmicenja
elem
nik
 touristyouaregreatguy
tourist
guy
 lukavpastaakojelukav
a
u
 xxxbbbcccoca
ca
cb
 aaaaaabababaaa
aa
a
 petryouaregoodandyouhavegoodblogs
blog
rega
 lebronnojameslebronprogrammers
je
bro
 mztskopjetisisampiosrcenaterenostaviajdezanaspobedi
mzt
optee
 gukimikazedauradimseminarskidodatnohumorhumor
dp
mrzime
 razredninjegosgrebovicdobarcoveklosbasketas
ne
go
 pozdravzamojeodeljenjeiprofesoreocudabudempetnula
bojan
cao
 damandicnenapravicheckerzeznulibise
man
ker
 pozdravizazenskudecunecuvasodvajatidaseneprotumacipogresno
cao
deco
 egoryouaregoodbutcantsolveeverythinginonehour
eat
your
 lemigazalemiolemilicomzalemljenje
lemi
zlo
 randomusername
umno
umno
 thisiscornercase
youhavetwolongerstrings
ibelivethatyoudontmissit
 oduleodule
xgrizx
ivanstosicprvi
 molimprofesorkuengleskogdamidapetjasamdobarcovekitrudimseiztogaiakosamoperisan
hvala
unapred
 djeneralmilomirstefanovic
radi
nesto
 balsabratepozdravimajudevojku
oj
zdrav
 iwanttothanktomygrandmaheisveryimportantpersoninmylife
thanks
stanka

takotakotakotakotakoaaaaaaaaaaaaaaaaaaaaaabddddddddddddddddddeffffffffffffffffffghhhhhhhhhiiiiiiiiijjjjjloooooooooooooooooppppprrrssssssssssssssssssssstttttttttttuuu
 siaaaaddddeeeehklmnoorstt
 ohohgodabceeeiinnooprsssttty
 odiadeeiikmstuvx
 ododhelbeilnnor
 kanbbeeeeiiikllortuuvyy
 deluz
 umumcurcur
 sinesineaaaaaaaaabccddhiiiiiijjjjjkkkklnooooooooprrssstttttuvvv
 dedeforforaabbehhikllmnnnoprstyz
 druzinaaaaaabcdgiiijkmnorstv
 nekijajajaadiilmssvz
 bumbumdeeijklorsz
 slaviaaaaceegiiijjknoopsstttvvxxxz
 peraperaabcceeeefgghiiiimnnnnoooorrsstttttuuvwy
 vasvasvasradradradaaaaaaaaaaccccceeegiiiiiiikklllmmnnnnoopstttuzz
 nonoaaaddeeehmmorrs
 oceoceaadeiiijknnorrsssttuv
 elemniknikaaaccdeiiiiijlmnoostt
 touristguyguyaaeeorrt
 aaaaauuejkkkllopstvv
 cacbcbcboxxx
 aaaaaaaaaaabbb
 blogregaregaadddehnoooooopstuuvyy
 jebrobroaaeeegllmmmnnnooprrrss
 mztopteeopteeopteeaaaaaabcddiiiiijjkmnnnorrssssssvz
 mrzimeaaaaaddddeghhiiiikkkmmmnnoooorrrsstuuuu
 nenegogoaaaabbbccddeeeiijkklooorrrrsssstvvz
 bojancaoaaddddeeeeeeeefijjllmmnooooppprrrstuuuvzz
 mankeraaabcccddeeeehiiiilnnnprsuvzz
 decodecodecoaaaaaaadeeegiiijkmnnnnooppprrrssssttuuuuvvvzzz
 eateatyouryourbcdeeeeggghhiilnnnnooooorrstuvv
 lemilemilemilemizlozloaaaceegjjmn
 umnoaadeemnrrs
 acceehiinorrssst
 ddeelloouu
 unapredunapredaaaaaaabcddeeeeefgggiiiiiiijkkkkllmmmmmmoooooooooprrrsssssstttvz
 radinestoaceefiijllmmnorv
 ojojzdravaaaabbdeeiklmprstuuv
 stankaaaadeeeefghhiiiiilmmmmnnnnnoooopprrrrstttttvwyyy

		import java.io.PrintWriter;
	import java.util.Arrays;
	import java.util.HashMap;
	import java.util.Scanner;
		
		
		/*07:05:45PM
		
		String x =sc.next();
		char inp [] = x.toCharArray();
			SimpleDateFormat displayFormat = new SimpleDateFormat("HH:mm");
			SimpleDateFormat parseFormat = new SimpleDateFormat("hh:mm a");
			Date date = parseFormat.parse(x.substring(0, 5)+" "+x.substring(8, 10));
			System.out.println(displayFormat.format(date)+":"+x.substring(6, 8));
		*/
		
		
		
		
		
		
		
		
		public class Main {
		public static long l=10000000000L;
		
			public static void main(String[] args) throws Exception {
				PrintWriter out = new PrintWriter(System.out);	
				StringBuilder sb = new StringBuilder();
				Scanner sc = new Scanner(System.in);
				char a [] = sc.next().toCharArray();
				char b [] = sc.next().toCharArray();
				char c [] = sc.next().toCharArray();
				int aa[]=new int [26];
				int bb[]=new int [26];
				int cc[]=new int [26];
				for (int i = 0; i < a.length; i++) {
					aa[a[i]-'a']++;
				}
				for (int i = 0; i < b.length; i++) {
					bb[b[i]-'a']++;
				}
				for (int i = 0; i < c.length; i++) {
					cc[c[i]-'a']++;
				}
				
				String k ="";
				while(true)
				{
					boolean ok =true;
					int i;
					for ( i = 0; i < b.length; i++) {
						if(aa[b[i]-'a']>0)aa[b[i]-'a']--;
						else ok=false;
					}
					if(ok)for (int j = 0; j < b.length; j++) k+=b[j];
						
					else if(!ok)
					{
						for (int j = 0; j < i; j++) {
							aa[b[j]-'a']++;
						}
						break;
					}
				}
				while(true)
				{
					boolean ok =true;
					int i;
					for ( i = 0; i < c.length; i++) {
						if(aa[c[i]-'a']>0)aa[c[i]-'a']--;
						else ok=false;
					}
					if(ok)for (int j = 0; j < c.length; j++) k+=c[j];
						
					else if(!ok)
					{
						for (int j = 0; j < i; j++) {
							aa[c[j]-'a']++;
						}
						break;
					}
				}
				System.out.println(k);
			}
		}
		
		
		
		
		
		
		
		
		class Pair implements Comparable<Pair>
		{
			public int  x  ,y ,z ;
			Pair(int a , int b , int l)
			{
				x=a;y=b;z=l;
			}
			@Override
			public boolean equals(Object obj) {
				// TODO Auto-generated method stub
				return x==((Pair)(obj)).x && y==((Pair)obj).y;
			}
			
			@Override
			public int hashCode() {
				// TODO Auto-generated method stub
				return 6*x +8*y;
			}
			@Override
			public int compareTo(Pair o) {
				// TODO Auto-generated method stub
				return x*o.y - y*o.x;
			}
			
			
		}
		/*
		 class Scanner 
		{
			StringTokenizer st;
			BufferedReader br;
		
			public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}
		
			public String next() throws IOException 
			{
				while (st == null || !st.hasMoreTokens()) 
					st = new StringTokenizer(br.readLine());
				return st.nextToken();
			}
		
			public int nextInt() throws IOException {return Integer.parseInt(next());}
			
			public long nextLong() throws IOException {return Long.parseLong(next());}
		
			public String nextLine() throws IOException {return br.readLine();}
			
			public double nextDouble() throws IOException
			{
				String x = next();
				StringBuilder sb = new StringBuilder("0");
				double res = 0, f = 1;
				boolean dec = false, neg = false;
				int start = 0;
				if(x.charAt(0) == '-')
				{
					neg = true;
					start++;
				}
				for(int i = start; i < x.length(); i++)
					if(x.charAt(i) == '.')
					{
						res = Long.parseLong(sb.toString());
						sb = new StringBuilder("0");
						dec = true;
					}
					else
					{
						sb.append(x.charAt(i));
						if(dec)
							f *= 10;
					}
				res += Long.parseLong(sb.toString()) / f;
				return res * (neg?-1:1);
			}
			
			public boolean ready() throws IOException {return br.ready();}
		
		
		}
	*/