#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main () {
setlocale(LC_ALL, "en_US.utf8");
wcin.imbue(locale());
wcout.imbue(locale());
wstring frase; // note: wstring, not string
while( getline(wcin, frase)) {
wcout << "entered: " << frase << '\n';
for(size_t n = 0; n < frase.size(); ++n)
frase[n] = towlower(frase[n]);
wcout << "lowercased: " << frase << '\n';
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluICgpIHsKICAgIHNldGxvY2FsZShMQ19BTEwsICJlbl9VUy51dGY4Iik7CiAgICB3Y2luLmltYnVlKGxvY2FsZSgpKTsKICAgIHdjb3V0LmltYnVlKGxvY2FsZSgpKTsKICAgIAogICAgICAgIHdzdHJpbmcgZnJhc2U7IC8vIG5vdGU6IHdzdHJpbmcsIG5vdCBzdHJpbmcKICAgICAgICB3aGlsZSggZ2V0bGluZSh3Y2luLCBmcmFzZSkpIHsKICAgICAgICAgICAgICAgIHdjb3V0IDw8ICJlbnRlcmVkOiAiIDw8IGZyYXNlIDw8ICdcbic7CiAgICAgICAgZm9yKHNpemVfdCBuID0gMDsgbiA8IGZyYXNlLnNpemUoKTsgKytuKQogICAgICAgICAgICBmcmFzZVtuXSA9IHRvd2xvd2VyKGZyYXNlW25dKTsKICAgICAgICAgICAgICAgIHdjb3V0IDw8ICJsb3dlcmNhc2VkOiAiIDw8IGZyYXNlIDw8ICdcbic7CiAgICAgICAgfQp9Cg==