// introstl.cpp: Introduction to STL
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main() {

	vector<string> v;
	cout << " Enter lines of text to be sorted,\n";
	cout << " followed by the word stop:\n";

	for (;;) {
		string s;
		getline(cin, s);
		if (s == "stop")
			break;
		v.push_back(s);
		}
	sort(v.begin(), v.end());
	cout << " The same lines after sorting:\n";
	for (int i=0; i<v.size(); ++i)
		cout << v[i] << endl;
	return 0;
	}
