#include <iostream>
#include <sstream>
#include <stdexcept>
#include <vector>
#include <string>
#include <cstdlib>
using namespace std;

/**
 * main function
 */
int main() {
	string word;
	vector<string> words;
	
	// ==========================================
	// read string from keyboard
	// terminate input with ^D
	// ==========================================
	
	// read words and put them into a vector
	while (cin >> word) {
		words.push_back(word);
	} 
	
	// display what was read from keyboard
	ostringstream oss;
	for (int i=0; i<words.size(); ++i) {
		oss << i << ": " << words[i] << endl;
	}
	cout << oss.str() << endl;
	
	// ==========================================
	// use of istringstream 
	// distinguish between strings and numbers
	// ==========================================
	
	string str = "  exemple 2 phrase à  étudier 123  ";
	istringstream iss(str);
	int n = 1;
  	while (iss >> word) {
  		if (isdigit(word[0])) {
  			cout << "number : " << atoi(word.c_str()) << endl;
  		} else {
		    cout << n << ": " << word << endl;
		}
    	++n;
  	}	
	return 0;
}
