using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

public class Solver
{
    public const int MaxType = 26;
    public int Days;
    public long[] Downs;
    public long[][] Scores;
    public void Init()
    {
        Days = int.Parse(Console.ReadLine());
        Downs = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        Scores = new long[Days][];
        for (int i = 0; i < Days; i++)
        {
            Scores[i] = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        }
    }

    public long CalcScore(int[] plan)
    {
        long score = 0;
        var last = new int[MaxType];
        for (int d = 1; d <= Days; d++)
        {
            var i = d - 1;
            var type = plan[i];
            last[type] = d;
            score += Scores[i][type];
            score -= last.Select((la, index) => Downs[index] * (d - la)).Sum();
        }

        return score;
    }

    public int[] SolveByGreedy()
    {
        var plan = new int[Days];
        var last = new int[MaxType];
        for (int d = 1; d <= Days; d++)
        {
            var i = d - 1;
            var bestIndex = 0;
            var bestScore = long.MinValue;
            for (int t = 0; t < MaxType; t++)
            {
                var score = Scores[i][t];
                score -= last.Select((la, index) => Downs[index] * (index == t ? 0 : d - la)).Sum();
                if (bestScore < score)
                {
                    bestIndex = t;
                    bestScore = score;
                }
            }
            plan[i] = bestIndex;
            last[bestIndex] = d;
        }

        return plan;
    }

    Random random = new Random();

    public int[] SolveBySA(Stopwatch sw, int limit)
    {
        var saTimeCurrent = sw.ElapsedMilliseconds;
        var saTimeStart = saTimeCurrent;
        var saTimeEnd = limit;
        // 許容するスコアの悪化値
        double startTemp = 100;
        double endTemp = 0.01;
        int count = 0;

        //var plan = Enumerable.Range(0, Days).Select(_ => random.Next(MaxType)).ToArray();
        var plan = SolveByGreedy();
        var currentScore = CalcScore(plan);
        while (sw.ElapsedMilliseconds < limit)
        {
            saTimeCurrent = sw.ElapsedMilliseconds;
            double temp = startTemp + (endTemp - startTemp) * saTimeCurrent / (saTimeEnd - saTimeStart);

            // 近傍をセット
            var day = random.Next(Days);
            var newType = random.Next(MaxType);
            var prevType = plan[day];
            plan[day] = newType;

            var newScore = CalcScore(plan);
            var adopt = (newScore > currentScore);
            if (!adopt)
            {
                double probability = Math.Exp((newScore - currentScore) / temp);
                adopt = random.NextDouble() < probability;
            }

            if (adopt)
            {
                currentScore = newScore;
                continue;
            }

            // 近傍への移動をキャンセル
            plan[day] = prevType;
            count++;
        }
        return plan;
    }

    public int[] Solve()
    {
        var sw = Stopwatch.StartNew();
        //return SolveByGreedy();
        return SolveBySA(sw, 1800);
    }
}

public static class Solution
{
    public static void Main()
    {
        var solver = new Solver();
        solver.Init();
        var answer = solver.Solve();
        Console.WriteLine(string.Join(Environment.NewLine, answer.Select(i => i + 1)));
        //Console.Error.WriteLine($"sat:{solver.CalcScore(answer)}");
    }
}

Measured memory_bytes: 42112