#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
int main()
{
std::vector<std::vector<int> > distances;
//std::ifstream MyFile ("file.csv");
std::istream &MyFile (std::cin);
//if(MyFile.is_open())
{
std::string line;
while(std::getline(MyFile, line))
{
std::istringstream row (line);
distances.push_back(std::vector<int>());
std::string cell;
while(std::getline(row, cell, ','))
{
int dist;
std::istringstream(cell) >> dist;
distances.back().push_back(dist);
}
}
}
for(std::size_t i = 0; i < distances.size(); ++i)
{
for(std::size_t j = 0; j < distances[i].size(); ++j)
{
std::cout << distances[i][j] << ' ' << std::flush;
}
std::cout << std::endl;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPHNzdHJlYW0+CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDx2ZWN0b3I+CgppbnQgbWFpbigpCnsKICAgIHN0ZDo6dmVjdG9yPHN0ZDo6dmVjdG9yPGludD4gPiBkaXN0YW5jZXM7CiAgICAvL3N0ZDo6aWZzdHJlYW0gTXlGaWxlICgiZmlsZS5jc3YiKTsKICAgIHN0ZDo6aXN0cmVhbSAmTXlGaWxlIChzdGQ6OmNpbik7CiAgICAvL2lmKE15RmlsZS5pc19vcGVuKCkpCiAgICB7CiAgICAgICAgc3RkOjpzdHJpbmcgbGluZTsKICAgICAgICB3aGlsZShzdGQ6OmdldGxpbmUoTXlGaWxlLCBsaW5lKSkKICAgICAgICB7CiAgICAgICAgICAgIHN0ZDo6aXN0cmluZ3N0cmVhbSByb3cgKGxpbmUpOwogICAgICAgICAgICBkaXN0YW5jZXMucHVzaF9iYWNrKHN0ZDo6dmVjdG9yPGludD4oKSk7CiAgICAgICAgICAgIHN0ZDo6c3RyaW5nIGNlbGw7CiAgICAgICAgICAgIHdoaWxlKHN0ZDo6Z2V0bGluZShyb3csIGNlbGwsICcsJykpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGludCBkaXN0OwogICAgICA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