#include <algorithm>
#include <cctype>
#include <iostream>
#include <iterator>
#include <string>
using namespace std;
int main() {
auto fulltext = "my name is John. i have a girlfriend. her name is Anna"s;
transform(crbegin(fulltext), make_reverse_iterator(find(cbegin(fulltext), cend(fulltext), '.')), rbegin(fulltext), [](const unsigned char idx) { return toupper(idx); });
cout << fulltext << endl;
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNjdHlwZT4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aXRlcmF0b3I+CiNpbmNsdWRlIDxzdHJpbmc+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglhdXRvIGZ1bGx0ZXh0ID0gIm15IG5hbWUgaXMgSm9obi4gaSBoYXZlIGEgZ2lybGZyaWVuZC4gaGVyIG5hbWUgaXMgQW5uYSJzOwoKCXRyYW5zZm9ybShjcmJlZ2luKGZ1bGx0ZXh0KSwgbWFrZV9yZXZlcnNlX2l0ZXJhdG9yKGZpbmQoY2JlZ2luKGZ1bGx0ZXh0KSwgY2VuZChmdWxsdGV4dCksICcuJykpLCByYmVnaW4oZnVsbHRleHQpLCBbXShjb25zdCB1bnNpZ25lZCBjaGFyIGlkeCkgeyByZXR1cm4gdG91cHBlcihpZHgpOyB9KTsKCgljb3V0IDw8IGZ1bGx0ZXh0IDw8IGVuZGw7Cn0=