using System.Linq;
using System.Text;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;

namespace AtCoder
{
    class Program
    {

        const int BiggestMod = 1000000007;

        public struct memory
        {

            public int previous;
            public int next;
            public int alphabets;

        }

        public static void Main()
        {

            int days = int.Parse(Console.ReadLine());
            const int alphabets = 26;
            var sw = new Stopwatch();

            sw.Start();
            
            var args = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var data = new KeyValuePair<int, int>[days][];
            var memo = new KeyValuePair<int, int>[days];
            var ans = new KeyValuePair<int, int>[days];


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

                var buf = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
                data[i] = new KeyValuePair<int, int>[alphabets];

                for (int j = 0; j < alphabets; j++)
                    data[i][j] = new KeyValuePair<int, int>(j + 1, buf[j]);

                Array.Sort(data[i], (left, right) => right.Value - left.Value);
                ans[i] = data[i][0];
            }

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

                int previous = 0;
                int next = days;

                for (int j = i - 1; 0 <= j; j--)
                    if (ans[i].Key == ans[j].Key)
                        previous = j + 1;

                for (int j = i + 1; j < days; j++)
                    if (ans[i].Key == ans[j].Key)
                        next = j + 1;

                memo[i] = new KeyValuePair<int, int>(previous, next);

            }

            for (int i = 1; i < alphabets; i++)
            {

                for (int j = 0; j < days; j++)
                {

                    // 比較用
                    var compare = data[j][1];

                    int compprevious = 0;
                    int compnext = days;

                    for (int k = j - 1; 0 <= k; k--)
                        if (ans[k].Key == compare.Key)
                            compprevious = k + 1;

                    for (int k = j + 1; k < days; k++)
                        if (ans[k].Key == compare.Key)
                            compnext = k + 1;

                    int comparemisssum =
                        args[compare.Key - 1] * ((compnext - j - 1) * (compnext - j - 2) +
                        (j + 1 - compprevious) * ((j + 1) - compprevious - 1) -
                        (compnext - compprevious) * (compnext - compprevious - 1));

                    int originalmisssum =
                        ans[j].Value - 1 * ((memo[j].Value - memo[j].Key) * (memo[j].Value - memo[j].Key - 1) -
                        (memo[j].Value - j - 1) * (memo[j].Value - j - 2) -
                        (j + 1 - memo[j].Key) * ((j + 1) - memo[j].Key - 1));

                    if (comparemisssum - originalmisssum > compare.Value - ans[j].Value)
                    {

                        ans[j] = compare;
                        memo[j] = new KeyValuePair<int, int>(compprevious, compnext);

                    }

                }

                sw.Stop();
                
                if (sw.ElapsedMilliseconds > 1500)
                    break;

                sw.Start();

            }

            foreach (var answer in ans)
                Console.WriteLine(answer.Key);

        }

    }

}

Measured memory_bytes: 29224