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

namespace Task5Strings
{
    class Program
    {
        static void Main(string[] args)
        {
            string head =Console.ReadLine();
            string combCount = Console.ReadLine();
            bool isOverlap = false;
            string bestComb = string.Empty;

            for (int i = 0; i < ; i++)
            {

            }



        }
    }
}
