#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <boost/algorithm/string/classification.hpp> // Include boost::for is_any_of
#include <boost/algorithm/string/split.hpp> // Include for boost::split
using namespace std;
int main() {
std::string s = "as for whether when";
std::vector<std::string> words;
boost::split(words, s, boost::is_any_of(" "), boost::token_compress_on);
// Sorting the int vector
sort(words.begin(), words.end());
for(string &this_s : words) std::cout << this_s << " ";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Ym9vc3QvYWxnb3JpdGhtL3N0cmluZy9jbGFzc2lmaWNhdGlvbi5ocHA+IC8vIEluY2x1ZGUgYm9vc3Q6OmZvciBpc19hbnlfb2YKI2luY2x1ZGUgPGJvb3N0L2FsZ29yaXRobS9zdHJpbmcvc3BsaXQuaHBwPiAvLyBJbmNsdWRlIGZvciBib29zdDo6c3BsaXQKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJc3RkOjpzdHJpbmcgcyA9ICJhcyBmb3Igd2hldGhlciB3aGVuIjsKCXN0ZDo6dmVjdG9yPHN0ZDo6c3RyaW5nPiB3b3JkczsKCWJvb3N0OjpzcGxpdCh3b3JkcywgcywgYm9vc3Q6OmlzX2FueV9vZigiICIpLCBib29zdDo6dG9rZW5fY29tcHJlc3Nfb24pOwoJLy8gU29ydGluZyB0aGUgaW50IHZlY3RvcgogICAgc29ydCh3b3Jkcy5iZWdpbigpLCB3b3Jkcy5lbmQoKSk7CiAgICBmb3Ioc3RyaW5nICZ0aGlzX3MgOiB3b3Jkcykgc3RkOjpjb3V0IDw8IHRoaXNfcyA8PCAiICI7CglyZXR1cm4gMDsKfQ==