#include <iostream>
#include <string>
#include <experimental/optional>

std::experimental::optional<int> find_int_strtol( const std::string & s )
{
    for( const char *p = s.c_str(); *p != '\0'; p++ )
    {
        char *next;
        int value = std::strtol( p, &next, 10 );
        if( next != p ) {
            return value;
        }
    }
    return {};
}

int main()
{
	for( std::string line; std::getline( std::cin, line ); )
	{
		auto n = find_int_strtol( line );
		if( n )
		{
			std::cout << "Got " << n.value() << " in " << line << std::endl;
		}
	}
	return 0;
}
