#include<assert.h>

typedef struct Node {
	struct Node* next;
	int value;
} Node;

void main () {
	Node a;
	Node b;
	Node* p;
	
	a.value = 4;
	a.next = &b;
	b.value = a.value+1; //b.value=5
	
	assert a.value == 4;
	assert b.value == 5;
	assert a.next->value == 5;
	
	p=&a;
	b.next = p; //b.next = a
	assert p->value == 4; //a.value = 4
	(*b.next).value = (*b.next).value-2; //a.value = a.value-2 (which should be 2)
	(*(*b.next).next).value = b.next->next->value + b.next->value; //b.value = b.value + a.value (which should be 7)
	
	assert p->value == 2;
	assert a.value == 2;
	assert b.value == 7;
	
}
