import base.Scientist;
import senior.SeniorScientist;
import junior.JuniorScientist;
import engineer.Engineer;

import java.util.ArrayList;

public class Main {
    public static void main(String[] args) {
        Scientist s1 = new SeniorScientist(1000, 10);
        Scientist s2 = new SeniorScientist(1000, 10);
        Scientist j1 = new JuniorScientist(800, 5);
        Scientist j2 = new JuniorScientist(900, 6);
        Scientist j3 = new JuniorScientist(800, 5);
        Scientist e1 = new Engineer(700, 4);
        Scientist e2 = new Engineer(700, 4);
        Scientist e3 = new Engineer(750, 3);
        Scientist s3 = new SeniorScientist(1100, 8);
        Scientist j4 = new JuniorScientist(950, 7);

        Scientist[] allScientists = { s1, s2, j1, j2, j3, e1, e2, e3, s3, j4 };

        ArrayList<Scientist> uniqueScientists = new ArrayList<>();
        for (Scientist sc : allScientists) {
            if (!uniqueScientists.contains(sc)) {
                uniqueScientists.add(sc);
            }
        }

        System.out.println("Уникальные научные сотрудники:");
        for (Scientist sc : uniqueScientists) {
            System.out.println(sc.toString());
        }
    }
}
