#include <iostream>

using namespace std;

void Foo() {
	cout << "Hello World!" << endl;
}

int main(int argc, char** argv) {
	char input = 0;
	
	cout << "Hello! This is a console application." << endl;
	cout << "Press q to quit, press a to execute foo." << endl;	
	while(1) {
		cin >> input;
		if(input == 'a') {
			Foo();
		} else if(input == 'q') {
			break;
		}
	}

	return 0;
}