#include <iostream>
#include <sstream>
#include <string>

using namespace std;

int main(int argc, char** argv)
{
	stringstream stream;
	string input = "";

	//Read 4 numbers from user.
	cout << "Please enter the first number: ";
	int num1;
	getline(cin, input);
	stream.str(input);
	stream >> num1;
	stream.clear();

	cout << "Please enter the second number: ";
	int num2;
	getline(cin, input);
	stream.str(input);
	stream >> num2;
	stream.clear();

	cout << "Please enter the third number: ";
	int num3;
	getline(cin, input);
	stream.str(input);
	stream >> num3;
	stream.clear();

	cout << "Please enter the fourth number: ";
	int num4;
	getline(cin, input);
	stream.str(input);
	stream >> num4;
	stream.clear();

	int smallest;
	int largest;

	//Assume that num1 is the smallest and largest until we prove otherwise.
	smallest = num1;
	largest = num1;

	if (num2 < smallest)
	{
		//num2 is the new smallest value.
		smallest = num2;
	}

	if (num2 > largest)
	{
		largest = num2;
	}

	if (num3 < smallest)
	{
		smallest = num3;
	}

	if (num3 > largest)
	{
		largest = num3;
	}

	if (num4 < smallest)
	{
		smallest = num4;
	}

	if(num4 > largest)
	{
		largest = num4;
	}

	cout << "Smallest number is: " << smallest << endl << "Largest number is: " << largest << endl;
}