﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ShortWordsSorted
{
    class Program
    {
        static void Main()
        {
            // Read a text, extract its words, find all short words (less than 5 characters) and print them alphabetically, in lowercase.
            // Use the following separators: . , : ; ( )[ ] " ' \ / ! ? (space).
            // Use case-insensitive matching.
            // Remove duplicated words.

            var input = Console.ReadLine()
                .ToLower()
                .Split(new char[] {'.',',',':',';','(',')','[',']','\'','\\','/','!','?',' '}, StringSplitOptions.RemoveEmptyEntries)
                .ToList()
                .Where(x => x.Length<5)
                .OrderByDescending(x => x)
                .Reverse()
                .Distinct();

            Console.WriteLine(String.Join(", ", input));
        }
    }
}
