#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

struct Timer {
  Timer() { reset(); }
  void reset() { beg = chrono::high_resolution_clock::now(); }
  ll elapsed() const {
    chrono::high_resolution_clock::time_point en = chrono::high_resolution_clock::now();
    return chrono::duration_cast<chrono::milliseconds>(en - beg).count();
  }
private:
  chrono::high_resolution_clock::time_point beg;
} timer;

struct Xor128 {
  int rand() {
    unsigned t = x ^ (x << 11);
    x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
    return static_cast<int>(w);
  }
  int rand(int ub) {
    int res = rand() % ub;
    return res < 0 ? res + ub : res;
  }
  int rand(int lb, int ub) { return lb + rand(ub - lb); }
  ll randll() {
    unsigned long long res = static_cast<unsigned long long>(rand()) << 32;
    return static_cast<ll>(res | rand());
  }
  ll randll(ll ub) {
    ll res = randll() % ub;
    return res < 0 ? res + ub : res;
  }
  ll randll(ll lb, ll ub) { return lb + randll(ub - lb); }
private:
  unsigned x = 123456789, y = 362436069, z = 521288629, w = static_cast<unsigned>(time(nullptr));
} xor128;

const int D = 365, N = 26, TL = 2000, TEMP_S = 1600, TEMP_T = 1, SZ = 10;
int c[N], s[D][N];

void input() {
  int d; cin >> d;
  REP(i, N) cin >> c[i];
  REP(i, D) REP(j, N) cin >> s[i][j];
}

void output(const vector<int> &t) {
  // freopen("output.txt", "w", stdout);
  REP(i, D) cout << t[i] + 1 << '\n';
}

int calc_score(const vector<int> &t) {
  vector<int> last(N, -1);
  int score = 0;
  REP(d, D) {
    score += s[d][t[d]];
    last[t[d]] = d;
    REP(i, N) score -= c[i] * (d - last[i]);
  }
  return score;
  // return max(score + 1000000, 0);
}

vector<int> greedy() {
  vector<int> t(D), last(N, -1);
  REP(d, D) {
    int minus = 0;
    REP(i, N) minus += c[i] * (d - last[i]);
    int mx = -INF, idx;
    REP(i, N) {
      int tmp = s[d][i] + c[i] * (d - last[i]);
      if (tmp > mx) {
        mx = tmp;
        idx = i;
      }
    }
    t[d] = idx;
    last[idx] = d;
  }
  return t;
}

int sub(int idx, int len) {
  return c[idx] * len * (len + 1) / 2;
}

int main() {
  input();
  vector<int> t = greedy();
  vector last(N, set<int>{-1, D});
  int score = 0;
  REP(i, D) {
    score += s[i][t[i]];
    last[t[i]].emplace(i);
  }
  REP(i, N) {
    for (auto it = next(last[i].begin()); it != last[i].end(); ++it) {
      score -= sub(i, *it - *prev(it) - 1);
    }
  }
  // assert(calc_score(t) == score);
  const int LIMIT = TL - 300;
  vector ts{make_pair(t, score)};
  while (timer.elapsed() < LIMIT) {
    int d = xor128.rand(D);
    vector<tuple<int, int, int>> good;
    for (int i = 0; i < SZ && i < ts.size(); ++i) {
      const vector<int> &t = ts[i].first;
      int score = ts[i].second, add = 0;
      good.emplace_back(score, t[d], i);
      add -= s[d][t[d]];
      auto it = last[t[d]].lower_bound(d);
      add += sub(t[d], *it - *prev(it) - 1);
      add += sub(t[d], *next(it) - *it - 1);
      add -= sub(t[d], *next(it) - *prev(it) - 1);
      REP(j, N) {
        if (j == t[d]) continue;
        int tmp = add + s[d][j];
        it = last[j].emplace(d).first;
        tmp -= sub(j, *it - *prev(it) - 1);
        tmp -= sub(j, *next(it) - *it - 1);
        tmp += sub(j, *next(it) - *prev(it) - 1);
        last[j].erase(it);
        good.emplace_back(score + tmp, j, i);
      }
    }
    sort(ALL(good), greater<tuple<int, int, int>>());
    vector<pair<vector<int>, int>> nx;
    REP(i, SZ) {
      auto [nx_score, nx_idx, ts_idx] = good[i];
      vector<int> nx_t = ts[ts_idx].first;
      if (nx_t[d] != nx_idx) nx_t[d] = nx_idx;
      nx.emplace_back(nx_t, nx_score);
    }
  }
  output(ts[0].first);
  return 0;
}


Measured memory_bytes: 3720