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


int main()
{
	std::list<int> mylist { 11, -22, -33, 44, -55 };
    std::list<int>::iterator i, j;
    for (i = mylist.begin(); ++i != mylist.end(); )
        if (*i < 0)
            printf("%d ",*--(j=i));
    printf("\n");
}