using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const char White = '.';
    const char Black = '#';
    const long Mod = 1000000007;

    static void Main(string[] args) {
        checked {
#if DEBUG
            MyDebugger.Test(process, "../TextFile1.txt");
            //TestCaseMaker.MakeTestCase1("../TextFile2.txt");
            //MyDebugger.Test(process, "../TextFile2.txt");
#else
            object ret = process(new StreamReader(Console.OpenStandardInput()));
            //Console.WriteLine(ret);
#endif
        }
    }

    public const int QN = 26;
    static int n;
    static int[][] ss;
    static int[] cc;

    static object process(TextReader input) {
        n = int.Parse(input.ReadLine());
        cc = ToIntArray(input.ReadLine(), QN);

        ss = new int[n][];
        for (int i = 0; i < ss.Length; i++) {
            ss[i] = ToIntArray(input.ReadLine(), QN);
        }

        var lasts = new int[QN];
        List<int> ans = new List<int>();

        for (int day = 1; day <= n; day++) {
            long max = long.MinValue;
            int maxJ = 0;

            for (int j = 0; j < QN; j++) {
                var x = UpVal(day, lasts, j);
                if (x > max || (x == max && cc[j] > cc[maxJ])) {
                    max = x;
                    maxJ = j;
                }
            }

            lasts[maxJ] = day;
            ans.Add(maxJ);
        }

        var ra = new Random();
        var score = Score(ans, n);

        for(int i=0; i < 30000; i++) {
            var di = ra.Next(0, n-1);
            var va = ra.Next(0, QN-1);

            var prev = ans[di];
            ans[di] = va;
            
            var newscore = Score(ans, n);
            if(newscore <= score) {
                ans[di] = prev;
            } else {
                score = newscore;
            }
        }

        StringBuilder sb = new StringBuilder();
        foreach (var x in ans) {
            sb.AppendLine((x + 1).ToString());
        }
        Console.WriteLine(sb.ToString());

        //Debug.WriteLine($"socre:{Score(ans, n)}");

        return null;
    }

    static long Score(List<int> ans, int day) {
        long y = 0;
        var lasts = new int[QN];

        for (int i=0; i<day; i++) {
            y += ss[i][ans[i]];
            lasts[ans[i]] = i+1;
            y -= DownVal(i+1, lasts);
        }
        return y;
    }

    static long UpVal(int day, int[] lasts, int si) {
        long up = ss[day-1][si];

        var prev = lasts[si];
        lasts[si] = day;
        var down = DownVal(day, lasts);
        lasts[si] = prev;
        
        return up - down;
    }

    static long DownVal(int day, int[] lasts) {
        long y = 0;
        for(int i=0; i < QN; i++) {
            y += cc[i] * (day - lasts[i]);
        }
        return y;
    }

    static int[] ToIntArray(string strs, int n) {
        var ret = new int[n];
        if (n == 0) return ret;
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++)
            ret[i] = int.Parse(spl[i]);
        return ret;
    }
}


Measured memory_bytes: 32192