#include <bits/stdc++.h>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr<<#x"="<<x<<endl

bool IsTimeOut(clock_t start_timer){
  clock_t current_timer = clock();
  double T = static_cast<double>(current_timer - start_timer) / CLOCKS_PER_SEC;
  return T > 1.98;
}

unsigned long XorShift(){
    static unsigned long x=123456789,y=362436069,z=521288629,w=88675123;
    unsigned long t;
    t=(x^(x<<11));x=y;y=z;z=w; return( w=(w^(w>>19))^(t^(t>>8)) );
}

inline int penalty_func(int delta, int c) {
  return delta * (delta - 1) * c / 2;
}

int main(){

  clock_t start_timer = clock();

  const int N = 26;
  int D;
  scanf("%d", &D);
  vector<int> C(N);
  rep(i,N)scanf("%d", &C[i]);
  vector<vector<int>> S(D, vector<int>(N));
  rep(i,D)rep(j,N)scanf("%d", &S[i][j]);

  vector<int> schedule_table(D, 0), current_penalty(N, 0);
  int current_score = 0;
  rep(i,D){
    rep(j,N){
      current_penalty[j] += C[j];
    }

    int mx = 0;
    rep(j,N){
      if(S[i][mx]+current_penalty[mx]<S[i][j]+current_penalty[j])mx=j;
    }

    schedule_table[i] = mx;

    current_score+=S[i][mx];
    current_penalty[mx]=0;
    rep(j,N){
      current_score-=current_penalty[j];
    }
  }
  /*vector<vector<int>> last_table(D + 1, vector<int>(N, 0));
  repl(i,1,D+1){
    rep(j,N){
      if(schedule_table[i]==j) last_table[i][j]=i;
      else last_table[i][j]=last_table[i-1][j];
    }
  }*/

  while(!IsTimeOut(start_timer)) {
    int a = (int)(XorShift() % (unsigned long) D);
    int b = (int)(XorShift() % (unsigned long) D);
    int ca = schedule_table[a], cb = schedule_table[b];
    if(a == b || schedule_table[a] == schedule_table[b]) continue;
    if(a > b) swap(a, b);

    int next_score = current_score;
    // vector<int> next_schedule_table = schedule_table;
    // swap(next_schedule_table[a], next_schedule_table[b]);
    int cacnt = 0, cbcnt = 0;
    rep(i,D){
      if(schedule_table[i] == ca) {
        next_score += penalty_func(cacnt, C[ca]);
        next_score -= S[i][ca];
        cacnt = 0;
      } else {
        cacnt++;
      }
      if(schedule_table[i] == cb) {
        next_score += penalty_func(cbcnt, C[cb]);
        next_score -= S[i][cb];
        cbcnt = 0;
      } else {
        cbcnt++;
      }
    }
    next_score += penalty_func(cacnt, C[ca]);
    next_score += penalty_func(cbcnt, C[cb]);
    //dbg(next_score);

    cacnt = cbcnt = 0;
    rep(i,D){
      if((schedule_table[i] == ca && i != a) || i == b) {
        next_score -= penalty_func(cacnt, C[ca]);
        next_score += S[i][ca];
        cacnt = 0;
      } else {
        cacnt++;
      }
      if((schedule_table[i] == cb && i != b) || i == a) {
        next_score -= penalty_func(cbcnt, C[cb]);
        next_score += S[i][cb];
        cbcnt = 0;
      } else {
        cbcnt++;
      }
    }
    next_score -= penalty_func(cacnt, C[ca]);
    next_score -= penalty_func(cbcnt, C[cb]);

    if(current_score < next_score) {
      current_score = next_score;
      //schedule_table = next_schedule_table;
      swap(schedule_table[a], schedule_table[b]);
    }
  }
  rep(i,D)cout<<schedule_table[i]+1<<"\n";
  dbg(current_score);

  return 0;
}


Measured memory_bytes: 3760