class sllist {
 private:
  class consCell {
  private:
    int data;
    consCell *next;
  public:
    consCell(int d): data(d),next(NULL) {}
    consCell(int d, consCell* n) : data(d),next(n) {}
    consCell(const consCell& c) { next = c.next; data = c.data; } // coppyu constructor

    consCell* cdr() {return next;}
    int car() {return data;}
  };

  consCell *head;

 public:
  sllist() : head(NULL) {}

  void cons(int n) { head = new consCell(n, head); }
  void cdr() { consCell *temp;  temp=head; head=head->next; delete(temp);}
  int car() { return head->data; }
};

  

