#include <iterator>
#include <sstream>
#include <iostream>
#include <string>
#include <map>
namespace std {
istream& operator >> (istream& is, pair<string, string>& ps)
{
return is >> ps.first >> ps.second;
}
ostream& operator << (ostream& os, const pair<const string, string>& ps)
{
return os << ps.first << "==>>" << ps.second;
}
}
int main() {
std::string file = "one two three four five six seven eight";
std::istringstream is(file);
std::map<std::string, std::string> mps;
std::insert_iterator< std::map<std::string, std::string> > mpsi(mps, mps.begin());
const std::istream_iterator<std::pair<std::string,std::string> > eos;
std::istream_iterator<std::pair<std::string,std::string> > its (is);
std::copy(its, eos, mpsi);
std::copy(mps.begin(), mps.end(), std::ostream_iterator<std::pair<std::string,std::string> >(std::cout, "\n"));
}
I2luY2x1ZGUgPGl0ZXJhdG9yPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8bWFwPgoKbmFtZXNwYWNlIHN0ZCB7CmlzdHJlYW0mIG9wZXJhdG9yID4+IChpc3RyZWFtJiBpcywgcGFpcjxzdHJpbmcsIHN0cmluZz4mIHBzKQp7CiAgIHJldHVybiBpcyA+PiBwcy5maXJzdCA+PiBwcy5zZWNvbmQ7Cn0Kb3N0cmVhbSYgb3BlcmF0b3IgPDwgKG9zdHJlYW0mIG9zLCBjb25zdCBwYWlyPGNvbnN0IHN0cmluZywgc3RyaW5nPiYgcHMpCnsKICAgcmV0dXJuIG9zIDw8IHBzLmZpcnN0IDw8ICI9PT4+IiA8PCBwcy5zZWNvbmQ7Cn0KfQoKaW50IG1haW4oKSB7CiAgc3RkOjpzdHJpbmcgZmlsZSA9ICJvbmUgdHdvIHRocmVlIGZvdXIgZml2ZSBzaXggc2V2ZW4gZWlnaHQiOyAKICBzdGQ6OmlzdHJpbmdzdHJlYW0gaXMoZmlsZSk7CiAgc3RkOjptYXA8c3RkOjpzdHJpbmcsIHN0ZDo6c3RyaW5nPiBtcHM7CiAgCiAgc3RkOjppbnNlcnR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