#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;
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 - 30;
  while (timer.elapsed() < LIMIT) {
    int d = xor128.rand(D);
    int mx = -INF, idx = -1, add = 0;
    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(i, N) {
      if (i == t[d]) continue;
      int tmp = add + s[d][i];
      it = last[i].emplace(d).first;
      tmp -= sub(i, *it - *prev(it) - 1);
      tmp -= sub(i, *next(it) - *it - 1);
      tmp += sub(i, *next(it) - *prev(it) - 1);
      last[i].erase(it);
      if (tmp > mx) {
        mx = tmp;
        idx = i;
      }
    }
    double p = exp(mx / (TEMP_S + (TEMP_T - TEMP_S) * timer.elapsed() / LIMIT));
    if (p > 1.0 * xor128.rand(INF) / INF) {
      last[t[d]].erase(d);
      last[idx].emplace(d);
      t[d] = idx;
      score += mx;
    }
  }
  output(t);
  return 0;
}


Measured memory_bytes: 4220