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

#include <bits/stdc++.h>
using namespace std;
int cn1[100];
int cn2[100];
int cn3[100];
int main() {
  long n, m, i, j = 0, s = 0, cc, l;
  string a, b, c;
  cin >> a;
  cin >> b;
  cin >> c;
  l = a.size();
  for (i = 0; i < l; i++) cn1[a[i] - 'a']++;
  l = b.size();
  for (i = 0; i < l; i++) cn2[b[i] - 'a']++;
  l = c.size();
  for (i = 0; i < l; i++) cn3[c[i] - 'a']++;
  int k = 0;
  for (i = 0; i < 26; i++) {
    if (cn2[i] > 0) {
      if (cn2[i] > cn1[i]) {
        k = 1;
        break;
      }
    }
  }
  if (k) {
    cout << c;
    for (i = 0; i < 26; i++) cn1[i] = cn1[i] - cn3[i];
    for (i = 0; i < 26; i++) {
      for (j = 0; j < cn1[i]; j++) cout << char(i + 'a');
    }
    cout << endl;
  } else {
    for (i = 0; i < 26; i++) {
      if (cn3[i] > 0) {
        if (cn3[i] > cn1[i]) {
          k = 1;
          break;
        }
      }
    }
    if (k) {
      cout << b;
      for (i = 0; i < 26; i++) cn1[i] = cn1[i] - cn2[i];
      for (i = 0; i < 26; i++) {
        for (j = 0; j < cn1[i]; j++) cout << char(i + 'a');
      }
      cout << endl;
    } else {
      int p, kk;
      kk = 0;
      for (i = 0; i < 26; i++) {
        if (cn1[i] > 0 and cn3[i] == 0 and cn2[i] == 0) {
          p = i;
          kk = 1;
          break;
        }
      }
      if (kk) {
        cout << c << char(p + 'a');
        for (i = 0; i < 26; i++) cn1[i] = cn1[i] - cn3[i];
        cn1[p]--;
        for (i = 25; i >= 0; i--) {
          for (j = 0; j < cn1[i]; j++) cout << char(i + 'a');
        }
        cout << endl;
      } else {
        for (i = 0; i < 26; i++) cn1[i] = cn1[i] - cn3[i];
        for (i = 0; i < 26; i += 2) {
          for (j = 0; j < cn1[i]; j++) cout << char(i + 'a');
        }
        for (i = 25; i >= 0; i -= 2) {
          for (j = 0; j < cn1[i]; j++) cout << char(i + 'a');
        }
        cout << c;
        cout << endl;
      }
    }
  }
  return 0;
}
