#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int arr[] = {1, 3, 3, 3, 6};
auto last = std::end(arr);
for (auto it = std::begin(arr); it < last; it++)
{
last = std::remove(std::next(it), last, *it);
}
for (auto it = std::begin(arr); it < last; it ++){
cout << *it << " ";
}
return 0;
}