//#define _CRT_DISABLE_PERFCRIT_LOCKS 1
#include <fstream>
#include <sstream>
#include <iostream>
#include <vector>

using namespace std;

int csv_len = 45;
string csv_entries[45];

int main()
{
    ifstream inFile("list.txt");
    ofstream outFile("nodup.txt", ios::out | ios::binary);
    //std::ios_base::sync_with_stdio(false);

    if (inFile.is_open()) {

        string line;

        while (getline(inFile, line)) {

            stringstream ss(line);

            for (int n = 0; n < csv_len; n++)
                getline(ss, csv_entries[n], ';');

            for (int n = 3; n < csv_len-1; n++) {

                for (int m = n+1; m < csv_len; m++) {
                    if (csv_entries[n] != "" && csv_entries[n] == csv_entries[m]) {
                        csv_entries[m] = "";
                    }
                }
            }

            for (int n = 0; n < csv_len; n++) {
                outFile << csv_entries[n] << ";";
            }

            outFile << "\n";
        }
    }   

    return 0;
}
