#include <algorithm>
#include <iostream>
#include <vector>
int main()
{
int arr[] = {1, 1, 1, 2, 1, 2, 2, 1, 3, 3, 1, 2, 1, 3, 1};
std::vector<int> v(arr, arr + sizeof(arr)/sizeof(int));
std::copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout, " "));
std::cout << std::endl;
std::sort(v.begin(), v.end());
v.erase(std::unique(v.begin(), v.end()), v.end());
std::copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout, " "));
return 0;
}