#include <bits/stdc++.h>
#include <unistd.h>

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

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

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

template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  REP(i, SZ(v)) {
    if (i) os << " ";
    os << v[i];
  }
  return os;
}

struct Elm {
  int d = -1;
  vi last;
  int val = -1;
  int sel = -1;

  Elm() {last.resize(26);}
  Elm(int d, vi last, int val, int sel): d(d), val(val), last(last), sel(sel) {}
};

bool operator<(Elm e1, Elm e2) {
  return make_tuple(e1.val, e1.d, e1.sel, e1.last) < make_tuple(e2.val, e2.d, e2.sel, e2.last);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int d;
  cin >> d;
  int n = 26;
  vi c(n);
  REP(i, n) {
    cin >> c[i];
  }

  vvi s(n, vi(d));
  REP(i, n) {
    REP(j, d) {
      cin >> s[i][j];
    }
  }

  map<Elm, Elm> prev;
  map<Elm, int> dp;

  vector<priority_queue<Elm>> pq(d+1);
  vi init(n);
  pq[0].push(Elm(0, init, 0, -1));
  dp[Elm(0, init, 0, -1)] = 0;

  int ma = 10;

  priority_queue<Elm> ans;

  REP(k, d) {
    while (!pq[k].empty()) {
      auto now = pq[k].top();
      pq[k].pop();
      //cerr << now.d << " " << now.val << "\n";
      vi last = now.last;
      int nowd = now.d;
      if (nowd == d) {
        ans.push(now);
        continue;
      }
      if (nowd > d) continue;
      int nxtd = nowd + 1;
      int nowval = now.val;
      now.val = 0;
      if (nowval < dp[now]) continue;
      now.val = nowval;
      REP(i, n) {
        int nxtval = nowval;
        REP(j, n) {
          if (i != j) nxtval -= c[j] * (nxtd - last[j]);
        }
        nxtval += s[i][nowd];

        int prevlast = last[i];
        last[i] = nxtd;
        if (dp.find(Elm(nxtd, last, 0, i)) == dp.end() || dp[Elm(nxtd, last, 0, i)] < nxtval) {
          dp[Elm(nxtd, last, 0, i)] = nxtval;
          auto nxt = Elm(nxtd, last, nxtval, i);
          pq[k+1].push(nxt);
          last[i] = prevlast;
          prev[nxt] = now;
        }
      }
      while (SZ(pq[k+1]) > ma) {
        //cerr << pq.top().val << endl;
        pq[k+1].pop();
      }
    }
  }

  auto now = pq[d].top();

  vi hukugen(d);

  while(now.d > 0) {
    //cerr << now.d << endl;
    hukugen[now.d-1] = now.sel+1;
    //cerr << now.d << ":" << now.sel << endl;
    if(prev.count(now) == 0) break;
    auto it = prev.find(now);
    if(it == prev.end()) break;
    assert(it->second.d == now.d - 1);
    now = prev[now];
  }
  //cerr << SZ(hukugen) << endl;

  //cerr << hukugen << endl;

  int beg = SZ(hukugen)-1;

  REP(i, d) {
    cout << hukugen[i] << endl;
  }

  //cerr << hukugen[0] << endl;


}








Measured memory_bytes: 55724