package com.javarush.task.pro.task05.task0508;
import java.util.Scanner;

/*
Удаляем одинаковые строки
*/

public class Solution {
    public static String[] strings;

    public static void main(String[] args) {
        //напишите тут ваш код
        strings = new String[6];
        Scanner console = new Scanner(System.in);

        for (int i = 0; i < strings.length; i++) {
            strings[i] = console.nextLine();
        }

        for (int i = 0; i < strings.length; i++) {
            int count = 0;
            for (int j = 0; j < strings.length; j++) {
                if (i != j && strings[i] != null && strings[j] != null && strings[i].equals(strings[j])) {
                    strings[j] = null;
                    count++;
                }
                if (count > 0) {
                    strings[i] = null;
                }
            }
        }

        for (
                int i = 0;
                i < strings.length; i++) {
            System.out.print(strings[i] + ", ");
        }
    }
}