#include <iostream>
#include <vector>
#include <algorithm>
struct NumberName {
int number;
std::string name;
operator int() const { return number; }
operator std::string() const { return name; }
};
std::vector<NumberName> gmap {
{0, "respectable"},
{1, "poor"},
{400, "acceptable income"},
{1000, "middle income"},
{2000, "rich"}
};
std::string get_wealth(int salary) {
return *(--upper_bound(begin(gmap), end(gmap), salary));
}
int main() {
std::cout << get_wealth(401) << '\n';
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKc3RydWN0IE51bWJlck5hbWUgewoJaW50IG51bWJlcjsKCXN0ZDo6c3RyaW5nIG5hbWU7CglvcGVyYXRvciBpbnQoKSBjb25zdCB7IHJldHVybiBudW1iZXI7IH0KCW9wZXJhdG9yIHN0ZDo6c3RyaW5nKCkgY29uc3QgeyByZXR1cm4gbmFtZTsgfQp9OwoKCXN0ZDo6dmVjdG9yPE51bWJlck5hbWU+CWdtYXAgewoJCQl7MCwgInJlc3BlY3RhYmxlIn0sIAoJCQl7MSwgInBvb3IifSwKCQkJezQwMCwgImFjY2VwdGFibGUgaW5jb21lIn0sIAoJCQl7MTAwMCwgIm1pZGRsZSBpbmNvbWUifSwgCgkJCXsyMDAwLCAicmljaCJ9CgkJfTsKCXN0ZDo6c3RyaW5nIGdldF93ZWFsdGgoaW50IHNhbGFyeSkgewoJCXJldHVybiAqKC0tdXBwZXJfYm91bmQoYmVnaW4oZ21hcCksIGVuZChnbWFwKSwgc2FsYXJ5KSk7Cgl9CgoKCmludCBtYWluKCkgewoJc3RkOjpjb3V0IDw8IGdldF93ZWFsdGgoNDAxKSA8PCAnXG4nOwp9