#include <iostream>
#include <sstream>
using namespace std;

int main() {
	stringstream a("123");
	stringstream b("hello");
	int x;
	a >> x;
	if (!a.fail()) {
		cout << "a is fine: " << x << endl;
	} else {
		cout << "a is bad" << endl;
	}
	b >> x;
	if (!b.fail()) {
		cout << "b is fine: " << x << endl;
	} else {
		cout << "b is bad" << endl;
	}
	return 0;
}