+
+#include <vector>
+#include <string>
+#include <iterator>
+#include <iostream>
+#include <algorithm>
+
+using namespace std;
+
+int pivote(vector<int>& v, int val, int ini, int fin)
+{
+ int i = ini + 1;
+ int p = fin - 1;
+ while (v[i] <= val && i < fin) ++i;
+ while (v[p] > val) --p;
+ while (i < p)
+ {
+ swap(v[i], v[p]);
+ while (v[i] <= val) ++i;
+ while (v[p] > val) --p;
+ }
+ swap(v[ini], v[p]);
+ return p;
+}
+
+void quicksort(vector<int>& v, int ini, int fin)
+{
+ if (ini < fin)
+ {
+ int p = pivote(v, v[ini], ini, fin);
+ quicksort(v, ini, p);
+ quicksort(v, p+1, fin);
+ }
+}
+
+int main()
+{
+ int n;
+ vector<int> v;
+ while (cin >> n)
+ {
+ v.push_back(n);
+ }
+ quicksort(v, 0, v.size());
+ copy(v.begin(), v.end(), ostream_iterator<int>(cout, " "));
+ return 0;
+}
+