func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int K;     vector<int> a(5, 0);     for (int i = 0; i < 5; i++) cin >> a[i];     cin >> K;     vector<int> b(K);     for (int i = 0; i < K; i++) {       string temp;       cin >> temp;       if (temp ==  XXL )         b[i] = 4;       else if (temp ==  XL )         b[i] = 3;       else if (temp ==  L )         b[i] = 2;       else if (temp ==  M )         b[i] = 1;       else         b[i] = 0;     }     for (int i = 0; i < K; i++) {       if (a[b[i]] > 0) {         a[b[i]]--;       } else {         if (b[i] + 1 < 5 && a[b[i] + 1] > 0) {           b[i]++;           a[b[i]] -= 1;         } else if (b[i] - 1 >= 0 && a[b[i] - 1] > 0) {           b[i]--;           a[b[i]] -= 1;         } else if (b[i] + 2 < 5 && a[b[i] + 2] > 0) {           b[i] += 2;           a[b[i]] -= 1;         } else if (b[i] - 2 >= 0 && a[b[i] - 2] > 0) {           b[i] -= 2;           a[b[i]] -= 1;         } else if (b[i] + 3 < 5 && a[b[i] + 3] > 0) {           b[i] += 3;           a[b[i]] -= 1;         } else if (b[i] - 3 >= 0 && a[b[i] - 3] > 0) {           b[i] -= 3;           a[b[i]] -= 1;         } else if (b[i] + 4 < 5 && a[b[i] + 4] > 0) {           b[i] += 4;           a[b[i]] -= 1;         } else if (b[i] - 4 >= 0 && a[b[i] - 4] > 0) {           b[i] -= 4;           a[b[i]] -= 1;         }       }     }     for (int i = 0; i < K; i++) {       if (b[i] == 4)         cout <<  XXL  << endl;       else if (b[i] == 3)         cout <<  XL  << endl;       else if (b[i] == 2)         cout <<  L  << endl;       else if (b[i])         cout <<  M  << endl;       else         cout <<  S  << endl;     }     return 0;   }   