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

class Program
{
    static void Main() => new Program().Solve();

    int D;
    int[] c;
    int[][] s;

    int[] t;
    int[][] l; // 最終開催日から何日たっているか

    public void Solve()
    {
        var sw = new Stopwatch();
        sw.Start();

        D = ReadInt();
        c = ReadInt(26).ToArray();
        s = new int[D][];
        for (int i = 0; i < D; i++) s[i] = ReadInt(26).ToArray();

        t = new int[D];
        l = new int[D][];
        for (int i = 0; i < D; i++) l[i] = new int[26];

        var r = new Random();
        for (int i = 0; i < D; i++) t[i] = r.Next(0, 26);

        long score = Calc();

        while (sw.ElapsedMilliseconds < 1500)
        {
            int d = r.Next(0, D);
            int q = r.Next(0, 26);
            if (TryChange(d, q, out var dl) > 0)
            {
                Change(d, q, dl);
            }
        }
        foreach (var x in t)
        {
            Console.WriteLine(x + 1);
        }
    }

    int Calc()
    {
        int score = 0;
        { // i = 0 のとき
            score += s[0][t[0]];
            for (int j = 0; j < 26; j++)
            {
                l[0][j] = 1;
            }
            l[0][t[0]] = 0;
            for (int j = 0; j < 26; j++)
            {
                score -= l[0][j] * c[j];
            }
        }
        for (int i = 1; i < D; i++)
        {
            score += s[i][t[i]];
            for (int j = 0; j < 26; j++)
            {
                l[i][j] = l[i - 1][j] + 1;
            }
            l[i][t[i]] = 0;
            for (int j = 0; j < 26; j++)
            {
                score -= l[i][j] * c[j];
            }
        }
        return score;
    }

    void Change(int d, int q, Dictionary<(int, int), int> dl)
    {
        t[d] = q;
        foreach (var x in dl)
        {
            l[x.Key.Item1][x.Key.Item2] = x.Value;
        }
    }

    int TryChange(int d, int q, out Dictionary<(int, int), int> dl)
    {
        dl = new Dictionary<(int, int), int>();
        int a = t[d]; // 本来開催されるはずだったコンテスト
        int diff = s[d][q] - s[d][a]; // 変動するスコア（戻り値）

        int x = (d == 0 ? 0 : l[d - 1][a]) + 1; // 前日の l
        { // i = 0 のとき
            diff -= (x - l[d][a]) * c[a];
            dl[(d, a)] = x;
        }
        for (int i = 1; d + i < D && l[d + i][a] != 0; i++)
        {
            diff -= (x + i - l[d + i][a]) * c[a];
            dl[(d + i, a)] = x + i;
        }

        int y = l[d][q];
        for (int i = 0; d + i < D && l[d + i][q] != 0; i++)
        {
            diff += y * c[q];
            dl[(d + i, q)] = i;
        }
        return diff;
    }
}

static class Scanner
{
    static Queue<string> que = new Queue<string>();
    public static string Read() { if (!que.Any()) foreach (var s in Console.ReadLine().Split()) que.Enqueue(s); return que.Dequeue(); }
    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());
    public static decimal ReadDecimal() => decimal.Parse(Read());
    public static IEnumerable<string> Read(long n) { for (long i = 0; i < n; i++) yield return Read(); }
    public static IEnumerable<int> ReadInt(long n) => Read(n).Select(int.Parse);
    public static IEnumerable<long> ReadLong(long n) => Read(n).Select(long.Parse);
    public static IEnumerable<double> ReadDouble(long n) => Read(n).Select(double.Parse);
    public static IEnumerable<decimal> ReadDecimal(long n) => Read(n).Select(decimal.Parse);
}

Measured memory_bytes: 47756