#include <iostream>
using namespace std;
class Point
{
friend class Line;
private:
double st,ed;
public:
Point():st(0),ed(0){cout << "Point : (" <<st<< ", " <<ed<<") is created." << endl;}
Point(double stt ,double edd ):st(stt),ed(edd){cout << "Point : (" <<st<< ", " <<ed<<") is created." << endl;}
Point (const Point &p)
{
st = p.st;
ed= p.ed;
cout << "Point : (" << st<< ", " << ed<<") is copied." << endl;
}
double x() const {return st;}
double y() const {return ed;}
void show()
{cout << "Point : (" <<st<< ", "<<ed<< ")" <<endl;}
~Point ()
{cout << "Point : (" <<st<< ", " <<ed <<") is erased." << endl;}
};
class Line
{
friend class Point;
private :
Point st_,ed_;
public:
Line():st_(0,0),ed_(0,0)
{
cout << "Line : (" << st_.x() << ", " << st_.y()<< ") to (" <<ed_.x() <<", " << ed_.y() << ")" << " is created." << endl;
}
Line( Point &sst, Point &eed):st_(sst),ed_(eed)
{ cout << "Line : (" << st_.x() << ", " << st_.y()<< ") to (" <<ed_.x() <<", " << ed_.y() << ")" << " is created." << endl;}
Line(double x1,double y1,double x2,double y2):st_(x1,y1),ed_(x2,y2)
{
cout << "Line : (" << st_.x() << ", " << st_.y()<< ") to (" <<ed_.x() <<", " << ed_.y() << ")" << " is created." << endl;
}
void show() const
{cout << "Line : (" << st_.x() << ", " << st_.y()<< ") to (" <<ed_.x() <<", " << ed_.y() << ")" <<endl;
}
~Line()
{ cout << "Line : (" << st_.x() << ", " << st_.y()<< ") to (" <<ed_.x() <<", " << ed_.y() << ")" << " is erased." << endl;}
Line(const Line &l):st_(l.st_),ed_(l.ed_)
{cout << "Line : (" << st_.x() << ", " << st_.y()<< ") to (" <<ed_.x() <<", " << ed_.y() << ")" << " is copied." <<endl;}
Line setLine(double x1,double y1,double x2,double y2)
{
st_.st=x1;
st_.ed=y1;
ed_.st=x2;
ed_.ed=y2;
return *this;}
Line &setLine(const Point &p ,const Point &q)
{
st_=p;
ed_=q;
return *this;
}
Line &setLine(const Line &p)
{
st_=p.st_;
ed_=p.ed_;
return *this;
}
void readLine()
{
double x1,y1,x2,y2;
char in;
cin>>x1>>in>>y1>>x2>>in>>y2;
st_.st=x1;
st_.ed=y1;
ed_.st=x2;
ed_.ed=y2;
}};
int main()
{
int num, i;
Point p(1, -2), q(2, -1), t;
t.show();
std::cin>>num;
Line line[num];
for(i = 0; i < num; i++)
{
line[i].readLine();
line[i].show();
}
Line l1(p, q), l2(p,t), l3(q,t), l4(l1);
l1.show();
l2.setLine(l1).show();
l3.show();
l4.setLine(t,q).show();
}