#include <iostream>
#include<iomanip>
using namespace std;
class Point
{
private:
int x,y;
public:
Point();
Point(int x_a,int y_a);
int getx()const;
int gety()const;
void setdata(int ,int );
friend istream& operator>>(istream &input, Point &p1);
friend ostream& operator<<(ostream &output,const Point &p1);
Point operator+(const Point &x2);
Point operator-(const Point &x2);
};
Point::Point()
{
x=0;
y=0;
}
Point::Point(int x_a,int y_a)
{
x_a=x;
y_a=y;
}
int Point::getx()const
{
return x;
}
int Point::gety()const
{
return y;
}
void Point::setdata(int x_c,int y_c)
{
x_c=x;
y_c=y;
}
istream& operator>>(istream &input, Point &p1)
{
input>>setw(1)>>p1.x;
input.ignore();
input>>p1.y;
return input;
}
ostream& operator<<(ostream &output,const Point &p1)
{
output<<"("<<p1.x<<","<<p1.y<<")";
return output;
}
Point Point::operator+(const Point &x2)
{
int x3=x+x2.getx();
int y3=y+x2.gety();
return Point(x3,y3);
}
Point Point::operator-(const Point &x2)
{
int x3=x-x2.getx();
int y3=y-x2.gety();
return Point(x3,y3);
}
int main()
{
Point point1,point2;
cin>>point1;
cin>>point2;
cout<<point1<<" + "<<point2<<" = "<<point1+point2<<endl;
cout<<point1<<" - "<<point2<<" = "<<point1-point2;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTxpb21hbmlwPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpjbGFzcyBQb2ludAp7CnByaXZhdGU6CiAgICBpbnQgeCx5OwpwdWJsaWM6CiAgICBQb2ludCgpOwogICAgUG9pbnQoaW50IHhfYSxpbnQgeV9hKTsKICAgIGludCBnZXR4KCljb25zdDsKICAgIGludCBnZXR5KCljb25zdDsKICAgIHZvaWQgc2V0ZGF0YShpbnQgLGludCApOwogICAgZnJpZW5kIGlzdHJlYW0mIG9wZXJhdG9yPj4oaXN0cmVhbSAmaW5wdXQsIFBvaW50ICZwMSk7CiAgICBmcmllbmQgb3N0cmVhbSYgb3BlcmF0b3I8PChvc3RyZWFtICZvdXRwdXQsY29uc3Q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