#include <iostream>

using namespace std;

class Node {
public:
  int data;
  Node *next;
};

class List {
public:
  Node *head;
  void insert(int a);
  void remove();
  void print();
  List();
  ~List();
};

void List::insert(int a) {
  Node *n = new Node();
  n->data = a;
  n->next = head;
  head = n;
}

void List::remove() {
  if (head == NULL)
    return;
  Node *second = head->next;
  delete head;
  head = second;
}

void List::print() {
  cout << "( ";
  for (Node *n = head; n != NULL; n = n->next)
    cout << n->data << " ";
  cout << ")\n";
}

List::List() {
  head = NULL;
}

List::~List() {
  while (head != NULL) {
    remove();
  }
}

int main() {
  List test;

  test.insert(5);
  test.insert(10);
  test.insert(4);
  test.print();

  test.remove();
  test.insert(7);
  test.insert(88);
  test.print();  

  return 0;
}

