using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Math;
using static System.Array;
using static AtCoder.Tool;

using System.Diagnostics;
namespace AtCoder
{
    class AC
    {
        const int MOD = 1000000007;
        const int INF = int.MaxValue / 2;
        const long SINF = long.MaxValue / 2;
        const double EPS = 1e-8;
        static readonly int[] dx = { 0, 1, 0, -1 };
        static readonly int[] dy = { 1, 0, -1, 0 };

        static int D;
        static long[] c;
        static long[][] s;
        static int[] ans;
        static Rand rnd = new Rand();


        static void Main(string[] args)
        {
            var Sw = new Stopwatch();

            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);
            var cin = new Scanner();

            D = int.Parse(Console.ReadLine());
            Sw.Start();
            var inputc = cin.SplitReadL();
            //Console.WriteLine(inputc.Length);
            c = new long[inputc.Length];
            for (var i = 0; i < inputc.Length; i++)
            {
                c[i] = inputc[i];
            }
            s = new long[D][];
            for (var i = 0; i < D; i++)
            {
                var inputs = cin.SplitReadL();
                s[i] = new long[inputs.Length];
                for (var j = 0; j < inputs.Length; j++)
                {
                    s[i][j] = inputs[j];
                }
            }
            ans = new int[D];
            for (var i = 0; i < D; i++) ans[i] = rnd.RandNum(0, 26);
            var now = Score(ans);
            while (Sw.ElapsedMilliseconds < 1890)
            {
                //Console.WriteLine("OK");
                var i = rnd.RandNum(0, D - 1);
                var j = rnd.RandNum(i + 1, D);
                var kepi = ans[i];
                var kepj = ans[j];

                ans[i] = rnd.RandNum(0, 26);
                ans[j] = rnd.RandNum(0, 26);
                var time = Sw.ElapsedMilliseconds;
                var nxans = Score(ans);
                if (nxans > now /*&& Prob(Temp(time), time) > rnd.RandDouble()*/)
                {
                    now = nxans;
                }
                else
                {
                    ans[i] = kepi;
                    ans[j] = kepj;
                }
            }
            /*Console.WriteLine(Score(ans));
            Console.WriteLine(now);*/
            for (var i = 0; i < D; i++) ans[i]++;
            Console.WriteLine(string.Join("\n", ans));
            /*var t = new int[D];
            for (var i = 0; i < D; i++) t[i] = int.Parse(Console.ReadLine()) - 1;*/





            //Console.Out.Flush();

        }
        static void swap(int a, int b)
        {
            var k = ans[a];
            ans[a] = ans[b];
            ans[b] = k;
        }
        struct Perm : IComparable<Perm>
        {
            public int[] order;
            public double score;
            public Perm(int[] o)
            {
                order = o;
                score = Score(o);
            }

            public int CompareTo(Perm other)
            {
                return score.CompareTo(other.score);
            }
        }

        static double Prob(double T, double d)
        {
            return Pow(E, (-d / T));
        }

        static double Temp(double time)
        {
            double Ts = 1000;
            double Te = 0.001;
            double t = time / 1900;
            //return Ts * (1 - t) + Te * t;
            return Pow(Ts, (1 - t)) * Pow(Te, t);
        }

        struct P : IComparable<P>
        {
            public double x;
            public double y;
            public P(double xi, double yi)
            {
                x = xi;
                y = yi;
            }

            public int CompareTo(P other)
            {
                return x.CompareTo(other.x);
            }
        }
        static long Score(int[] t)
        {
            long ret = 0;
            var last = new int[26];
            for (var i = 0; i < D; i++)
            {
                ret += s[i][t[i]];
                last[t[i]] = i + 1;
                for (var j = 0; j < 26; j++) ret -= c[j] * (i + 1 - last[j]);
                //Console.WriteLine(ret);
            }
            return ret;
        }

        static int[] Next(int inf, int lim)
        {
            /*var ret = (int[])a.Clone();

            int i = rnd.RandNum(a.Length);
            ret[i] = ret[(i + 1) % a.Length];
            ret[(i + 1) % a.Length] = a[i];

            return ret;*/
            int i = rnd.RandNum(inf, lim - 1);
            int j = rnd.RandNum(i + 1, lim);

            return new int[] { i, j };
        }



    }
    public class Rand
    {
        public int RandNum(int m, int M)
        {
            var rnd = new Random((int)DateTime.Now.Ticks);
            return rnd.Next(m, M);
        }

        public double RandDouble()
        {
            var rnd = new Random((int)DateTime.Now.Ticks);
            return rnd.NextDouble();
        }
    }


    public class Scanner
    {
        public int[] SplitRead()
        {
            int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return array;
        }
        public long[] SplitReadL()
        {
            long[] array = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return array;
        }
    }

    public static class Tool
    {
        static public void Initialize<T>(ref T[] array, T initialvalue)
        {
            for (var i = 0; i < array.Length; i++)
            {
                array[i] = initialvalue;
            }
        }
    }
}


Measured memory_bytes: 43804