#include <iostream>
#include <vector>

int main() {
    std::vector<int> arr = {1, 2, 2, 3, 4, 4, 5};
    std::vector<int> result;

    for (int num : arr) {
        bool isUnique = true;
        for (int uniqueNum : result) {
            if (num == uniqueNum) {
                isUnique = false;
                break;
            }
        }
        if (isUnique) {
            result.push_back(num);
        }
    }

    for (int num : result) {
        std::cout << num << " ";
    }
    return 0;
}

