#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);
}
}
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPHNzdHJlYW0+CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDx2ZWN0b3I+CgppbnQgbWFpbigpCnsKICAgIHN0ZDo6dmVjdG9yPHN0ZDo6dmVjdG9yPGludD4gPiBkaXN0YW5jZXM7CiAgICAvL3N0ZDo6aWZzdHJlYW0gTXlGaWxlICgiZmlsZS5jc3YiKTsKICAgIHN0ZDo6aXN0cmVhbSAmTXlGaWxlIChzdGQ6OmNpbik7CiAgICAvL2lmKE15RmlsZS5pc19vcGVuKCkpCiAgICB7CiAgICAgICAgc3RkOjpzdHJpbmcgbGluZTsKICAgICAgICB3aGlsZShzdGQ6OmdldGxpbmUoTXlGaWxlLCBsaW5lKSkKICAgICAgICB7CiAgICAgICAgICAgIHN0ZDo6aXN0cmluZ3N0cmVhbSByb3cgKGxpbmUpOwogICAgICAgICAgICBkaXN0YW5jZXMucHVzaF9iYWNrKHN0ZDo6dmVjdG9yPGludD4oKSk7CiAgICAgICAgICAgIHN0ZDo6c3RyaW5nIGNlbGw7CiAgICAgICAgICAgIHdoaWxlKHN0ZDo6Z2V0bGluZShyb3csIGNlbGwsICcsJykpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGludCBkaXN0OwogICAgICAgICAgICAgICAgc3RkOjppc3RyaW5nc3RyZWFtKGNlbGwpID4+IGRpc3Q7CiAgICAgICAgICAgICAgICBkaXN0YW5jZXMuYmFjaygpLnB1c2hfYmFjayhkaXN0KTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KfQ==
MCwxLDIsMyw0CjQsMywyLDEsMAo5LDgsNyw2LDUKNSw2LDcsOCw5Cg==
0,1,2,3,4
4,3,2,1,0
9,8,7,6,5
5,6,7,8,9