#include <iostream>
#include <algorithm>
std::string interleave(const std::string &s1, const std::string &s2) {
int length = std::min(s1.length(), s2.length());
std::string result;
for (int i = 0; i < length; i++) {
result += s1[i];
result += s2[i];
}
return result;
}
int main() {
std::cout << interleave("aaaaaa", "drzewko") << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKc3RkOjpzdHJpbmcgaW50ZXJsZWF2ZShjb25zdCBzdGQ6OnN0cmluZyAmczEsIGNvbnN0IHN0ZDo6c3RyaW5nICZzMikgewoJaW50IGxlbmd0aCA9IHN0ZDo6bWluKHMxLmxlbmd0aCgpLCBzMi5sZW5ndGgoKSk7CglzdGQ6OnN0cmluZyByZXN1bHQ7Cglmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CgkJcmVzdWx0ICs9IHMxW2ldOwoJCXJlc3VsdCArPSBzMltpXTsKCX0KCXJldHVybiByZXN1bHQ7Cn0KCmludCBtYWluKCkgewoJc3RkOjpjb3V0IDw8IGludGVybGVhdmUoImFhYWFhYSIsICJkcnpld2tvIikgPDwgc3RkOjplbmRsOwoJcmV0dXJuIDA7Cn0=