// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



#ifdef LOCAL

#include "dump.hpp"

#else

#define dump(...)

#define dumpv(...)

#endif



#define rep(i, n) for (int i = 0; i < (n); i++)

#define mins(x, y) (x = min(x, y))

#define maxs(x, y) (x = max(x, y))

using ll = long long;

using vi = vector<int>;

using vl = vector<ll>;

using vvi = vector<vi>;

using vvl = vector<vl>;

using P = pair<ll, int>;

const int MOD = 1e9 + 7;

const int INF = 1001001001;

const ll LINF = 1001002003004005006ll;



void solve() {

  int d, n;

  n = 26;

  cin >> d;

  vi c(n);

  rep(i, n) cin >> c[i];

  vvi s(d, vi(n));

  rep(i, d) rep(j, n) cin >> s[i][j];

  vi l(n, -1);

  vector<vector<P>> g(d, vector<P>(n));

  vi ans(d);

  rep(i, d) {

    rep(j, n) {

      g[i][j].first = s[i][j];

      g[i][j].second = j;

      rep(k, n) {

        if (j != k) g[i][j].first -= (ll)c[k] * (i - l[k]);

      }

    }

    sort(g[i].rbegin(), g[i].rend());

    // dump(g[i]);

    int mi = g[i][0].second;

    l[mi] = i;

    ans[i] = mi;

  }

  auto score = [&] (vi& sel) {

    ll sc = 0;

    l.assign(n, -1);

    rep(i, d) {

      sc += s[i][sel[i]];

      l[sel[i]] = i;

      rep(k, n) sc -= (ll)c[k] * (i - l[k]);

    }

    return sc;

  };

  ll msc = score(ans);

  dump(msc, ans);

  rep(k, 20) {

    rep(i, d) {

      for (int j = 1; j < n; j++) {

        vi sel = ans;

        sel[i] = g[i][j].second;

        ll ss = score(sel);

        dump(i, ss, sel);

        if (msc < ss) {

          ans = sel;

          msc = ss;

        }

      }

    }

  }

  rep(i, d) cout << ans[i] + 1 << endl;

}



int main() {

  cin.tie(0);

  ios::sync_with_stdio(false);

  cout << fixed << setprecision(15);

  // freopen("temp.1", "r", stdin);

  solve();

  return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



#ifdef LOCAL

#include "dump.hpp"

#else

#define dump(...)

#define dumpv(...)

#endif



#define rep(i, n) for (int i = 0; i < (n); i++)

#define mins(x, y) (x = min(x, y))

#define maxs(x, y) (x = max(x, y))

using ll = long long;

using vi = vector<int>;

using vl = vector<ll>;

using vvi = vector<vi>;

using vvl = vector<vl>;

using P = pair<ll, int>;

const int MOD = 1e9 + 7;

const int INF = 1001001001;

const ll LINF = 1001002003004005006ll;



void solve() {

  int d, n;

  n = 26;

  cin >> d;

  vi c(n);

  rep(i, n) cin >> c[i];

  vvi s(d, vi(n));

  rep(i, d) rep(j, n) cin >> s[i][j];

  vi l(n, -1);

  vector<vector<P>> g(d, vector<P>(n));

  vi ans(d);

  rep(i, d) {

    rep(j, n) {

      g[i][j].first = s[i][j];

      g[i][j].second = j;

      rep(k, n) {

        if (j != k) g[i][j].first -= (ll)c[k] * (i - l[k]);

      }

    }

    sort(g[i].rbegin(), g[i].rend());

    // dump(g[i]);

    int mi = g[i][0].second;

    l[mi] = i;

    ans[i] = mi;

  }

  auto score = [&] (vi& sel) {

    ll sc = 0;

    l.assign(n, -1);

    rep(i, d) {

      sc += s[i][sel[i]];

      l[sel[i]] = i;

      rep(k, n) sc -= (ll)c[k] * (i - l[k]);

    }

    return sc;

  };

  ll msc = score(ans);

  dump(msc);

  rep(k, 5) {

    rep(i, d) {

      int ix = i;

      for (int j = 1; j < n; j++) {

        vi sel = ans;

        sel[ix] = g[ix][j].second;

        ll ss = score(sel);

        // dump(i, ss, sel);

        if (msc < ss) {

          ans = sel;

          msc = ss;

        }

      }

    }

    dump(k, msc);

  }

  rep(i, d) {

    int j = ans[i];

    g[i][j].first = s[i][j];

    g[i][j].second = j;

    rep(k, n) {

      if (j != k) g[i][j].first -= (ll)c[k] * (i - l[k]);

    }

    sort(g[i].rbegin(), g[i].rend());

  }

  rep(k, 3) {

    rep(i, d) {

      int ix = i;

      for (int j = 1; j < 5; j++) {

        vi sel = ans;

        sel[ix] = g[ix][j].second;

        ll ss = score(sel);

        // dump(i, ss, sel);

        if (msc < ss) {

          ans = sel;

          msc = ss;

        }

      }

    }

    dump(k, msc);

  }

  rep(i, d) cout << ans[i] + 1 << endl;

  dump(msc);

}



int main() {

  cin.tie(0);

  ios::sync_with_stdio(false);

  cout << fixed << setprecision(15);

  // freopen("temp.1", "r", stdin);

  solve();

  return 0;

}

// Fastest known solution for this problem: