#include <map>
#include <string>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
map<string, int> my_map;
my_map.insert(pair<string, int>("Ab", 1));
my_map.insert(pair<string, int>("Abb", 2));
my_map.insert(pair<string, int>("Abc", 3));
my_map.insert(pair<string, int>("Abd", 4));
my_map.insert(pair<string, int>("Ac", 5));
my_map.insert(pair<string, int>("Ad", 5));
cout<<my_map.lower_bound("Ab")->second<<endl;
cout<<my_map.upper_bound("Ab")->second<<endl;
return 0;
}
I2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgogCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKaW50IG1haW4oaW50IGFyZ2MsIGNoYXIqIGFyZ3ZbXSkKewogICAgbWFwPHN0cmluZywgaW50PiBteV9tYXA7CiAgICAKICAgIG15X21hcC5pbnNlcnQocGFpcjxzdHJpbmcsIGludD4oIkFiIiwgMSkpOwogICAgbXlfbWFwLmluc2VydChwYWlyPHN0cmluZywgaW50PigiQWJiIiwgMikpOwogICAgbXlfbWFwLmluc2VydChwYWlyPHN0cmluZywgaW50PigiQWJjIiwgMykpOwogICAgbXlfbWFwLmluc2VydChwYWlyPHN0cmluZywgaW50PigiQWJkIiwgNCkpOwogICAgbXlfbWFwLmluc2VydChwYWlyPHN0cmluZywgaW50PigiQWMiLCA1KSk7CiAgICBteV9tYXAuaW5zZXJ0KHBhaXI8c3RyaW5nLCBpbnQ+KCJBZCIsIDUpKTsKICAgIAogICAgY291dDw8bXlfbWFwLmxvd2VyX2JvdW5kKCJBYiIpLT5zZWNvbmQ8PGVuZGw7CiAgICBjb3V0PDxteV9tYXAudXBwZXJfYm91bmQoIkFiIiktPnNlY29uZDw8ZW5kbDsKICAgIHJldHVybiAwOwp9