#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define MOD (long long)(1e9+7)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; i <= (n); i++)

template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}


// 最大公約数
ll gcd(ll a, ll b)
{
  if(b == 0) return a;
  return gcd(b, a % b);
}

// mod m におけるa の逆元
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

#define CMAX 26
ll calc(ll D, vector<ll> &t, vector<vector<ll>> &s, vector<ll> &c, vector<vector<ll>> &last)
{
  ll sat = 0;
  ll dis;
  for(ll day = 1; day <= D; day++) {
    rep1(i, CMAX) last[day][i] = last[day - 1][i];
    ll con = t[day];
    sat += s[day][con];
    last[day][con] = day;
    dis = 0;
    rep1(i, CMAX) {
      dis += c[i] * (day - last[day][i]);
    }
    
    sat -= dis;

    //    cout << sat << endl;
  }
  /*
  cerr << "----------------------\n";
  rep1(day, D) {
    cerr << day << "] ";
    rep1(i, CMAX) {
      cerr << last[day][i] << " ";
    }
    cerr << endl;
  }
  */
  return sat;
}
ll recalc(ll sat, ll d, ll q, ll D, vector<ll> &t, vector<vector<ll>> &s, vector<ll> &c, vector<vector<ll>> &last )
{
  ll cnt = 0;
  ll oldq = t[d];
  t[d] = q;
  
  cnt = -s[d][oldq];
  //  cerr << s[d][oldq] << " ";
  for(ll i = d; i <= D; i++) {
    if(last[i][oldq] == d) {
      cnt += c[oldq] * (last[i - 1][oldq] - last[i][oldq]);
      last[i][oldq] = last[i - 1][oldq];
    } else {
      break;
    }
  }
  cnt += s[d][q];
  //  cerr << s[d][q] << " ";
  ll oldday = last[d][q];
  for(ll i = d; i <= D; i++) {
    if(last[i][q] == oldday) {
      cnt -= c[q] * (last[i][q] - d);
      last[i][q] = d;
    } else {
      break;
    }
  }
  
  /*
  for(ll day = 1; day <= D; day++) {
    rep1(i, CMAX) last[day][i] = last[day - 1][i];
    ll con = t[day];
    sat += s[day][con];
    last[day][con] = day;
    dis = 0;
    rep1(i, CMAX) {
      dis += c[i] * (day - last[day][i]);
    }
    sat -= dis;
  }
  */
  /*
  cerr << "----------------------\n";
  rep1(day, D) {
    cerr << day << "] ";
    rep1(i, CMAX) {
      cerr << last[day][i] << " ";
    }
    cerr << endl;
  }
  */
  return sat + cnt;
 
}

void solve()
{
  std::chrono::system_clock::time_point  start, end; // 型は auto で可
  start = std::chrono::system_clock::now(); // 計測開始時間
  
  ll D; cin >> D;
  vector<ll> c(CMAX + 1); rep1(i, CMAX) cin >> c[i];
  vector<vector<ll>> s(D + 1, vector<ll>(CMAX + 1));
  rep1(i, D) rep1(j, CMAX) cin >> s[i][j];


  vector<ll> t(D + 1);
  vector<vector<ll>> last(D + 1, vector<ll>(CMAX + 1, 0));

  // t[] を決める
  ll weight = 5000;
  rep1(day, D) {
    ll id;
    ll smax = 0;
    ll lmin = INF;
    vector<ll> cpoint(CMAX + 1);
    rep1(ct, CMAX) {
      cpoint[ct] = (day - last[day - 1][ct]) * weight + s[day][ct];
    }
    rep1(ct, CMAX) {
      if(cpoint[ct] > smax) {
	t[day] = ct;
	smax = cpoint[ct];
      }
    }
    last[day][t[day]] = day;
  }
 

  // 一度計算
  ll sat = calc(D, t, s, c, last);

  //cerr << sat << endl;
  ll old_sat = sat;
  double elapsed = 0;
  while(elapsed < 1800) {
    ll new_d, new_q;
    ll old_q;
    new_d = (rand() % D) + 1;
    new_q = (rand() % CMAX) + 1;
    old_q = t[new_d];
    old_sat = sat;
    sat =  recalc(sat, new_d, new_q, D, t, s, c, last);
    if(sat < old_sat) {
      t[new_d] = old_q;
      sat = old_sat;
    }
    //cerr << elapsed << " " << sat << endl;
    // 処理
    end = std::chrono::system_clock::now();  // 計測終了時間
    elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end-start).count(); //処理に要した時間をミリ秒に変換
  }
  rep1(i, D) {
    cout << t[i] << endl;
  }
  
}


int main(void)
{
  // ll t; cin >> t; rep(i, t)
  solve();
}


Measured memory_bytes: 3892