#include <iostream>
#include <sstream>
void use(int) { }
int main()
{
std::istringstream stream("3 4 -");
int n;
while (stream) { stream >> n; use(n); }
if (stream.fail()) std::cerr << "choked on bad input\n";
if (stream.bad()) std::cerr << "could not read the input\n";
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3N0cmVhbT4KCnZvaWQgdXNlKGludCkgeyB9CgppbnQgbWFpbigpCnsKCXN0ZDo6aXN0cmluZ3N0cmVhbSBzdHJlYW0oIjMgNCAtIik7CglpbnQgbjsKCXdoaWxlIChzdHJlYW0pIHsgc3RyZWFtID4+IG47IHVzZShuKTsgfQogICAgaWYgKHN0cmVhbS5mYWlsKCkpIHN0ZDo6Y2VyciA8PCAiY2hva2VkIG9uIGJhZCBpbnB1dFxuIjsKICAgIGlmIChzdHJlYW0uYmFkKCkpIHN0ZDo6Y2VyciA8PCAiY291bGQgbm90IHJlYWQgdGhlIGlucHV0XG4iOwp9