#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
#include <functional>
using namespace std;
typedef long long ll;

#define fi first
#define se second
#define rep(i, n) for (ll i = 0; i < n; i++)
#define debugA cerr << "AAAAA" << endl
#define debug_ cerr << "-------------" << endl
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    cout << #v << endl;                \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;
#define debug_vec2(v)                         \
    cout << #v << endl;                       \
    for (int i = 0; i < v.size(); i++)        \
    {                                         \
        for (int j = 0; j < v[i].size(); j++) \
        {                                     \
            cout << v[i][j] << " ";           \
        }                                     \
        cout << endl;                         \
    }

template <typename T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool chmin(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

using Graph = vector<vector<int>>;
using P = pair<int, int>;
using P1 = pair<int, pair<int, int>>; // クラスカル法とかで、{cost, {from, to}}的に使う。
const ll LINF = 1001002003004005006ll;
const ll INF = 1001001001;
const double pi = acos(-1);

ll ans1 = 0;

vector<int> guchoku(int d, vector<vector<int>> &s, vector<int> &c)
{
    vector<int> vec(d);
    for (int i = 0; i < d; i++)
    {
        int index = 0;
        int MAX = 0;
        for (int j = 0; j < 26; j++)
        {
            if (chmax(MAX, s[i][j]))
            {
                index = j + 1;
            }
        }
        vec[i] = index;
    }
    vector<int> last(26, 0);
    for (int i = 0; i < d; i++)
    {
        ans1 += c[vec[i] - 1] * (d - last[vec[i] - 1]);
        last[vec[i] - 1] = i + 1;
    }

    return vec;
}

int main()
{
    int d;
    cin >> d;
    vector<int> c(26);
    for (int i = 0; i < 26; i++)
    {
        cin >> c[i];
    }
    vector<vector<int>> s(d, vector<int>(26));
    for (int i = 0; i < d; i++)
    {
        for (int j = 0; j < 26; j++)
        {
            cin >> s[i][j];
        }
    }

    vector<ll> last(d, 0);
    ll ans = 0;
    vector<ll> vec(d);
    for (ll i = 0; i < d - 1; i++)
    {
        // ll day = i;
        // last[day] = i + 1;
        ll true_day = 0;
        ll tmp = -1001001001;
        for (int day = 0; day < 26; day++) // 実際に選ぶひにち。
        {
            ll sad = 0;
            ll score = s[i][day];
            for (int j = 0; j < 26; j++)
            {
                if (day == j)
                {
                    continue;
                }
                sad += c[j] * (i + 1 - last[j]);
            }
            for (int day1 = 0; day1 < 26; day1++)
            {
                ll score1 = s[i + 1][day1];
                ll sad1 = 0;
                for (int j = 0; j < 26; j++)
                {
                    if (day1 == j)
                    {
                        continue;
                    }
                    if (j == day)
                    {
                        sad1 += c[j];
                    }
                    else
                    {
                        sad1 += c[j] * (i + 2 - last[j]);
                    }
                }
                if (chmax(tmp, score + score1 - sad - sad1))
                {
                    true_day = day;
                }
            }
        }
        if (i % 10000 == 0)
        {
            true_day = 5;
        }
        last[true_day] = i + 1;
        vec[i] = true_day + 1;
    }

    ll true_day = 0;
    ll tmp = -1001001001;
    for (int day = 0; day < 26; day++) // 実際に選ぶひにち。
    {
        ll sad = 0;
        ll score = s[d - 1][day];
        for (int j = 0; j < 26; j++)
        {
            if (day == j)
            {
                continue;
            }
            sad += c[j] * (d - last[j]);
        }
        if (chmax(tmp, score - sad))
        {
            true_day = day;
        }
    }
    vec[d - 1] = true_day + 1;

    for (int i = 0; i < d; i++)
    {
        cout << vec[i] << endl;
    }

    return 0;
}


Measured memory_bytes: 3680