// G Hagopian

#include "..\std_lib_facilities-10.h"

using namespace std;

//------------------------------------------------------------------------------

struct Point
{
    int x;
    int y;

    friend istream& operator>>(istream& ist, Point& p)
    {
        char a,b,c;

        if ((ist >> a >> p.x >> b >> p.y >> c) && !(a == '(' && b == ',' && c == ')'))
            throw runtime_error("Invalid format");

        return ist;
    }

    friend ostream& operator<<(ostream& ost, const Point& p)
    {
        return ost << '(' << p.x << ',' << p.y << ')' << endl;
    }
};

//------------------------------------------------------------------------------

int main()
try
{
    /*cout << "Please enter  file name: ";
    string name;
    cin >> name;
    ifstream ist(name.c_str());    // ist is an input stream for the file named name
    if (!ist) error("can't open input file ",name);*/

    vector<Point> originalPoints;
    Point p;
    cout << "\nPlease enter 7 points: ";
    while ( originalPoints.size()<7 && cin>>p) originalPoints.push_back(p);
    for(auto i: originalPoints) cout << i;
}
catch (exception& e) {
    cerr << "error: " << e.what() << '\n';
    return 1;
}
catch (...) {
    cerr << "Oops: unknown exception!\n";
    return 2;
}

//------------------------------------------------------------------------------

/*
Please enter 7 points: (1,1) (2,2) (3,3) (4,4) (5,5) (6,6) (7,7)
(1,1)
(2,2)
(3,3)
(4,4)
(5,5)
(6,6)
(7,7)
*/
