#include <iostream>
#include <fstream>
using namespace std;

/*********************************************
 ** PROTOTYPES & STRUCT DEFINITIONS
 *********************************************/
struct point
{
  double x, y;
};
point readpoint(istream* pIN);
void writepoint(point p, ostream* pOUT);
point add(point a, point b);
point div(point P, double z);

struct Quad
{
  char label;
  point *vert;
};

int main()
{
  // Create quadrilateral S
  Quad S;
  S.vert = new point[4];

  // Read label and vertices
  cout << "Enter label and 4 vertices: ";
  cin >> S.label;
  for(int j = 0; j < 4; j++)
    S.vert[j] = readpoint(&cin);

  // Write label and vertices
  cout << "Your quadrilateral is " << S.label << " ";
  for(int j = 0; j < 4; j++)
  {
    writepoint(S.vert[j], &cout);
    cout << ' ';
  }
  cout << endl;

  return 0;
}

/*********************************************
 ** FUNCTION DEFINITIONS
 *********************************************/
point readpoint(istream* pIN)
{
  point p;
  char c;
  (*pIN) >> c >> p.x >> c >> p.y >> c;
  return p;
}

void writepoint(point p, ostream* pOUT)
{
  (*pOUT) << '(' << p.x << ',' << p.y << ')';
}

point add(point a, point b)
{
  point S;
  S.x = a.x + b.x;
  S.y = a.y + b.y;
  return S;
}

point div(point P, double z)
{
  point Q;
  Q.x = P.x / z;
  Q.y = P.y / z;
  return Q;
}