#include <iostream>
#include <string>
#include <queue>
#include <sstream>

using namespace std;

queue<int> uniq(queue<int> q);

#ifndef IOSTACKFUNCTIONS
#define IOSTACKFUNCTIONS

queue<int> readQueue(string s)
{
    istringstream mycin(s);
    queue<int> q;
    int x;
    while (mycin >> x)
        q.push(x);
    return q;
}

void writeQueue(queue<int> q)
{
    bool writespace = false;
    while (not q.empty()) {
        if (writespace) cout << " ";
        cout << q.front();
        q.pop();
        writespace = true;
    }
    
    cout << endl;
}
#endif

int main()  
{
    string s;

    while (getline(cin, s)) 
    {
        queue<int> q = readQueue(s);
        writeQueue(uniq(q));
    }
    
    return 0;
}
