#include <iostream> 

class point{
public:
  int getX(){return x;}
  int getY(){return y;}
  void setX(int xVal){x = xVal;}
  void setY(int yVal){y = yVal;}
private:
  int x;
  int y;
};

void swapPoints(point & p, point & q)
{
  point t;
  t = p;
  p = q;
  q = t;
}

point p1, p2;
void main()
{
  int tmp;
  cout << "Input co-ordinates of points p1 and p2 (as 4 integers)" << endl;
  cin >> tmp;  p1.setX(tmp);
  cin >> tmp;  p1.setY(tmp);
  cin >> tmp;  p2.setX(tmp);
  cin >> tmp;  p2.setY(tmp);

  cout << "p1 = (" << p1.getX() << "," << p1.getY() <<")" << endl;
  cout << "p2 = (" << p2.getX() << "," << p2.getY() <<")" << endl;
  cout << endl;

  swapPoints(p1, p2);

  cout << "p1 = (" << p1.getX() << "," << p1.getY() <<")" << endl;
  cout << "p2 = (" << p2.getX() << "," << p2.getY() <<")" << endl;
}
 
