#include <iostream>
#include <list>
#include <string>

using namespace std;

int
main()
{
   list< string > l;
   for(int i = 0; i < 3; i++) {
      l.push_front("LOVE");
      l.push_front("LOVE");
      l.push_front("LOVE");
      l.push_back("HATE");
      l.push_back("HATE");
      l.push_back("HATE");
      list< string >::iterator ptr1 = l.begin();
      list< string >::iterator ptr2 = l.end();
      ptr1++;
      ptr1++;
      ptr1++;
      l.insert(ptr1, "GOD");
      ptr1 = l.begin();
      ptr1++;
      ptr2 = l.end();
      ptr2--;
      l.erase(ptr1, ptr2);
      for(ptr1 = l.begin(); ptr1 != l.end(); ptr1++) 
         cout << "DATA=" << (*ptr1) << endl;
      cout << "---" << endl;
   }
   return 0;
}
