#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using ll = long long;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
const ll INF = 1LL << 60;

ll score(vvl& s, vl& c, vvl& x, ll d) {
  ll total = 0;
  vl last(26, 0);
  rep (i, d) {
    rep (j , 26) {
      if (x[i][j] == 1) {
        last[j] = i + 1;
        total += s[i][j];
      } else {
        total += c[j] * (d + 1 - last[j]);
      }
    }
  }
  return total;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll d;
  cin >> d;
  vl c(26);
  rep(i,26) cin>>c[i];
  vvl s(d, vl(26));
  rep(i,d) {
    rep(j,26) {
      cin >> s[i][j];
    }
  }

  vl last(26, 0);
  vl ans(d);
  vvl x(d, vl(26, 0));
  vvl y(d, vl(26, 0));
  vvl xx(d, vl(26, 0));

  rep(i, d) {
    ll day = d + 1;
    vl cost(26, 0);
    vector<tuple<ll,ll,ll>> tmp(26);
    ll maxcost = -1;
    // ll sel = 0;
    rep(j, 26) {
      tmp[j] = {
        c[j] * (day - last[j]) + s[i][j],
        s[i][j],
        j
      };
    }
    sort(tmp.begin(), tmp.end(), [](const tuple<ll,ll,ll>& a, const tuple<ll,ll,ll>& b) {
      if (get<1>(a) > get<1>(b)) return true;
      if (get<1>(a) == get<1>(b) && get<0>(a) > get<0>(b)) return true;
      return false;
    });
    ll sel = get<2>(tmp[0]);
    last[sel] = day;
    ans[i] = sel;
    // cerr << sel + 1 << endl;
    x[i][sel] = 1;
  }
  xx = x;

  random_device rd;  //Will be used to obtain a seed for the random number engine
  mt19937 gen(rd()); //Standard mersenne_twister_engine seeded with rd()
  uniform_int_distribution<> distrib(0, d-1);
  ll maxscore = 0;
  rep(k, 50) {
    x = xx;
    rep(t, 10000) {
      ll i = distrib(gen);
      vl duration1(26, 0), duration2(26, 0), duration(26, 0);
      ll sel = -1;
      rep(j, 26) {
        if (x[i][j] == 1) {
          sel = j;
          break;
        }
      }
      // cerr << i << "," << sel << endl;
      // cerr << sel << endl;
      rep(j, 26) {
        for (ll ii = i-1; ii >= 0; ii--) {
          if (x[ii][j] == 0) duration1[j]++;
          else break;
        }
        REP(ii, i+1, d) {
          if (x[ii][j] == 0) duration2[j]++;
          else break;
        }
        duration[j] = duration1[j] + duration2[j] + 1;
      }

      ll maxj = sel;
      ll maxdiff = 0;
      ll minus = s[i][sel] + c[sel] * ((duration[sel] + 1) * duration[sel] / 2 - (duration1[sel] + 1) * duration1[sel] / 2 - (duration2[sel] + 1) * duration2[sel] / 2);
      rep(j, 26) {
        if (j == sel) continue;
        ll plus = s[i][j] + c[j] * ((duration[j] + 1) * duration[j] / 2 - (duration1[j] + 1) * duration1[j] / 2 - (duration2[j] + 1) * duration2[j] / 2);
        if (plus > minus && plus - minus > maxdiff) {
          maxj = j;
          maxdiff = plus - minus;
        } 
      }
      if (maxj != sel) {
        x[i][maxj] = 1;
        x[i][sel] = 0;
      }
    }
    ll ss = score(s, c, x, d);
    if (ss > maxscore) {
      y = x;
      maxscore = ss;
      // cerr << maxscore << endl;
    }
  }

  rep(i, d) {
    rep(j, 26) {
      if (y[i][j] > 0) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 3572