#include <bits/stdc++.h>   using namespace std;   int main() {     vector<int> a(26), a2(26), a3(26);     string s1, s2, s3;     char ss1[100001], ss2[100001], ss3[100001];     scanf( %s%s%s , ss1, ss2, ss3);     s1 = ss1;     s2 = ss2;     s3 = ss3;     for (int i = 0; i < s1.size(); i++) a[s1[i] -  a ]++;     for (int i = 0; i < s2.size(); i++) a2[s2[i] -  a ]++;     for (int i = 0; i < s3.size(); i++) a3[s3[i] -  a ]++;     int max1 = 0, max2 = 0;     int ma2 = 100000;     for (int i = 0; i < 26; i++)       if (a2[i]) ma2 = min(ma2, a[i] / a2[i]);     for (int i = 0; i <= ma2; i++) {       int r = 100000;       for (int j = 0; j < 26; j++)         if (a3[j]) r = min(r, (a[j] - i * a2[j]) / a3[j]);       if (r + i > max1 + max2) max1 = i, max2 = r;     }     for (int i = 0; i < max1; i++) printf( %s , ss2);     for (int i = 0; i < max2; i++) printf( %s , ss3);     for (int i = 0; i < 26; i++) a[i] -= (a2[i] * max1 + a3[i] * max2);     for (int i = 0; i < 26; i++) {       while (a[i] > 0) {         printf( %c , i +  a );         a[i]--;       }     }     return 0;   }   