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

class Lista {
	struct Elem {
		int broj; Elem* sled;
		Elem (int b, Elem* s=0) { broj = b; sled = s; }
	};
	Elem* prvi;
	void kopiraj (const Lista& lst);
	void brisi ();
public:
	Lista () { prvi = 0; }
	Lista (int b) { prvi = new Elem (b); }
	Lista (const Lista& lst) { kopiraj(lst); }
	~Lista () { brisi(); }
	Lista& operator= (const Lista& lst) {
		if(this!=&lst) {
			brisi(); kopiraj(lst);
		}
		return *this;
	}
	int operator+ () ;
	Lista& operator+= (int b) ;
	friend Lista operator+ (Lista& lst, int b) ;
	Lista& operator-= (int b) ;
	friend Lista operator- (Lista& lst, int b) ;
	int operator% (int b) ;
	Lista& operator~ ();
	friend istream& operator >> (istream& d, Lista& lst);
	friend ostream& operator << (ostream& d, const Lista& lst);
	
	Lista& operator-- (int b);
};