#include <iostream>
#include <string>
#include <vector>
#include <cctype>
#include <cstdlib>
#include <fstream>
#include <sstream>
struct PersonInfo
{
std::string name;
std::vector<std::string> phones;
PersonInfo() = default;
PersonInfo (std::string &line);
};
PersonInfo (std::string &line)
{
std::string word;
std::istringstream ss(line);
ss >> name;
while (ss >> word)
phones.push_back (word);
}
int main()
{
std::ifstream in("phones");
std::string line, word;
std::vector<PersonInfo> users;
PersonInfo info;
while (getline(in, line))
{
info = line;
users.push_back (info);
}
for (const auto &rec: users)
{
std::cout << rec.name << " ";
for (const auto &ph: rec.phones)
std::cout << ph << " ";
std::cout << std::endl;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Y2N0eXBlPgojaW5jbHVkZSA8Y3N0ZGxpYj4KI2luY2x1ZGUgPGZzdHJlYW0+CiNpbmNsdWRlIDxzc3RyZWFtPgoKc3RydWN0IFBlcnNvbkluZm8KewogICAgICAgIHN0ZDo6c3RyaW5nIG5hbWU7CiAgICAgICAgc3RkOjp2ZWN0b3I8c3RkOjpzdHJpbmc+IHBob25lczsKICAgICAgICBQZXJzb25JbmZvKCkgPSBkZWZhdWx0OwogICAgICAgIFBlcnNvbkluZm8gKHN0ZDo6c3RyaW5nICZsaW5lKTsKfTsKClBlcnNvbkluZm8gKHN0ZDo6c3RyaW5nICZsaW5lKQp7CiAgICAgICAgc3RkOjpzdHJpbmcgd29yZDsKICAgICAgICBzdGQ6OmlzdHJpbmdzdHJlYW0gc3MobGluZSk7CiAgICAgICAgc3MgPj4gbmFtZTsKICAgICAgICB3aGlsZSAoc3MgPj4gd29yZCkKICAgICAgICAgICAgICAgIHBob25lcy5wdXNoX2JhY2sgKHdvcmQpOwp9CgppbnQgbWFpbigpCnsKICAgICAgICBzdGQ6Omlmc3RyZWFtIGluKCJwaG9uZXMiKTsKICAgICAgICBzdGQ6OnN0cmluZyBsaW5lLCB3b3JkOwogICAgICAgIHN0ZDo6dmVjdG9yPFBlcnNvbkluZm8+IHVzZXJzOwoKICAgICAgICBQZXJzb25JbmZvIGluZm87CiAgICAgICAgd2hpbGUgKGdldGxpbmUoaW4sIGxpbmUpKQogICAgICAgIHsKICAgICAgICAgICAgICAgIGluZm8gPSBsaW5lOwogICAgICAgICAgICAgICAgdXNlcnMucHVzaF9iYWNrIChpbmZvKTsKICAgICAgICB9CgogICAgICAgIGZvciAoY29uc3QgYXV0byAmcmVjOiB1c2VycykKICAgICAgICB7CiAgICAgICAgICAgICAgICBzdGQ6OmNvdXQgPDwgcmVjLm5hbWUgPDwgIiAiOwogICAgICAgICAgICAgICAgZm9yIChjb25zdCBhdXRvICZwaDogcmVjLnBob25lcykKICAgICAgICAgICAgICAgICAgICAgICAgc3RkOjpjb3V0IDw8IHBoIDw8ICIgIjsKICAgICAgICAgICAgICAgIHN0ZDo6Y291dCA8PCBzdGQ6OmVuZGw7CiAgICAgICAgfQp9Cg==