﻿using System;
using System.Collections.Generic;
using System.Text;

class P02_MagicWords
{
    static int GetLongestValue(List<string> words)
    {
        int maxLength = 0;

        for (int i = 0; i < words.Count; i++)
        {
            if (words[i].Length > maxLength)
            {
                maxLength = words[i].Length;
            }            
        }

        return maxLength;
    }

    static int GetFuturePosition(string word, int sizeOfArray)
    {
        return word.Length % (sizeOfArray + 1);
    }    

    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        List<string> words = new List<string>();
        int maxLength = int.MinValue;

        for (int i = 0; i < n; i++)
        {
            string word = Console.ReadLine();
            
            if (word.Length > maxLength)
            {
                maxLength = word.Length;
            }

            words.Add(word);
        }

        // reorder
        for (int i = 0; i < words.Count; i++)
        {
            string currentWord = words[i];
            int newPosition = currentWord.Length % (n + 1);
            words[i] = null;            
            words.Insert(newPosition, currentWord);
            words.Remove(null);
        }
        
        // to char array for fast work
        int counter = 0;

        char[] charArray = new char[n * maxLength];

        for (int i = 0; i < words.Count; i++)
        {
            string currentWord = words[i];
            int subCount = 0;

            for (int characterPos = 0; characterPos < currentWord.Length; characterPos++)
            {
                charArray[counter] = currentWord[characterPos];
                counter++;
                subCount++;
            }

            while (subCount < maxLength)
            {
                charArray[counter] = ' ';
                counter++;
                subCount++;
            }
        }
        
        // result calculation
        StringBuilder result = new StringBuilder();
        for (int i = 0; i < maxLength; i++)
        {
            for (int word = 0; word < words.Count; word++)
            {
                char toAdd = charArray[word * maxLength + i];
                if (toAdd != ' ')
                {
                    result.Append(toAdd);                    
                }
            } 
        }        

        Console.WriteLine(result);
    }
}