#include <string>
#include <iostream>
#include <vector>
//#include <fstream>
#include <sstream>
#include <algorithm>
using namespace std;

int main (){
	istream &infile = cin;
	/*ifstream infile("tested");
	if (!infile.is_open()){
		cout << "File did not open" << endl;
	}
	else*/{
		vector<int> vect;
		string line;
		while (getline(infile, line)) {
			istringstream iss(line);
			int x; char c;
			while (iss >> x) {
				cout << x + 1 << endl;
				vect.push_back(x);
				iss >> c;
			}
		}

		cout << "before sort" << endl;
		for (size_t i = 0; i < vect.size(); ++i){
			cout << vect[i] << endl;
		}

		sort(vect.begin(), vect.end());

		cout << "after sort" << endl;
		for (int j = 0; j < vect.size(); ++j){
			cout << vect[j] << endl;
		}

		cout << "end reached" << endl;
	}

	return 0;
}