#include <iostream>
using namespace std;



int main() {
	// your code goes here
	
	for (int i = 0; i < 1000; i++)
	{ cout << (i%256) << " ";}
	
	cout << '\n' << "Now negatives: ";
	for (int i = 0; i > -1000; i--)
	{
		int altered_i = i;
		while (altered_i < 0)
		{
			altered_i += 256;
		}
		
		
		cout << (altered_i%256) << " ";}


	return 0;
}