using System;
using System.Linq;

public static class Message
{
    public static string GetWordsShorterThan(string message, int n)
    {
        var words = message.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
        return string.Join(" ", words.Where(word => word.Length <= n));
    }

    public static string RemoveWordsEndingWith(string message, char symbol)
    {
        var words = message.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
        return string.Join(" ", words.Where(word => !word.EndsWith(symbol.ToString())));
    }

    public static string FindLongestWord(string message)
    {
        var words = message.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
        return words.OrderByDescending(w => w.Length).FirstOrDefault() ?? string.Empty;
    }
}

class Program1
{
    static void Main()
    {
        string text = "Hello world this is a test message with some words";
        
        Console.WriteLine("Слова не более 4 букв:");
        Console.WriteLine(Message.GetWordsShorterThan(text, 4));
        
        Console.WriteLine("\nУдалить слова, заканчивающиеся на 's':");
        Console.WriteLine(Message.RemoveWordsEndingWith(text, 's'));
        
        Console.WriteLine("\nСамое длинное слово:");
        Console.WriteLine(Message.FindLongestWord(text));
    }
}