#include <iostream>
#include <stdexcept>

int addition();

int main()
{
	try //we can deal with exceptions that are thrown here
	{
		while(true)
		{
			std::cout << addition() << std::endl;
		}
	}
	catch(std::exception &e) 
	{
		std::cerr << "Exception caught in main: " << e.what() << std::endl;
	}
}

int addition()
{
    int x, y;
    if(!(std::cin >> x >> y)) //check if the input operation succeeds
    {
    	//throw an exception if it failed, since we can't do anything here
    	throw std::runtime_error{"unable to read two integers"};
    }
    //otherwise, return normally
    return x + y;
}