﻿using System;

class P03_ArrayLexicalCompare
{
    static void Main()
    {
        Console.Write("first array size: ");
        int firstSize = int.Parse(Console.ReadLine());
        int[] firstArray = new int[firstSize];

        for (int i = 0; i < firstSize; i++)
        {
            Console.Write("element at pos. {0}: ", i);
            firstArray[i] = int.Parse(Console.ReadLine());
        }

        Console.Write("second array size: ");
        int secondSize = int.Parse(Console.ReadLine());
        int[] secondArray = new int[secondSize];

        for (int i = 0; i < secondSize; i++)
        {
            Console.Write("element at pos. {0}: ", i);
            secondArray[i] = int.Parse(Console.ReadLine());
        }

        int shorterLength = Math.Min(firstSize, secondSize);

        for (int i = 0; i < shorterLength; i++)
        {
            if (firstArray[i] > secondArray[i])
            {
                Console.WriteLine("second array");
                return;
            }
            if (firstArray[i] < secondArray[i])
            {
                Console.WriteLine("first array");
                return;
            }
        }

        if (firstSize == secondSize)
        {
            Console.WriteLine("arrays equal");
        }

        else if (firstSize > secondSize)
        {
            Console.WriteLine("second array");
        }

        else
        {
            Console.WriteLine("first array");
        }

    }
}

