/* STL */
#include <algorithm>
#include <deque>
#include <functional>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
/* STD */
#include <iostream>
#include <string>
#include <cstdlib>
#include <math.h>
using namespace std;

int main (int argc, char *argv[]) {
    vector<int> v;
    int x;
    cout << "Enter positive integers, followed by 0:\n";
    while (cin >> x, x !=0) v.push_back(x);
    sort(v.begin(), v.end());
    cout << "After sorting: \n";
    vector<int>::iterator i;
    for (i=v.begin(); i != v.end(); ++i)
	cout << *i << " ";
    cout << endl;
    return 0;
}
