#include <iostream>

int main()
{
	int x;
	while((std::cin >> x) && x > 0)
	{
		std::cout << x << " ";
	}
	std::cout << "end" << std::endl;
}
