#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

static const double TIME_LIMIT = 1.95;

unsigned int xor128(){
  static unsigned int x=123456789, y=362436069, z=521288629, w=88675123;
  unsigned int t;
  t=(x^(x<<11));
  x=y; y=z; z=w;
  return w=(w^(w>>19))^(t^(t>>8));
}
inline double frand(){
  return xor128()%UINT_MAX/static_cast<double>(UINT_MAX);
}

class Timer {
  double start_time;
  double getNow(){
    unsigned long long a, d;
    __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
    return (d << 32 | a) / 3000000000.0;
  }
public:
  void start(){
    start_time = getNow();
  }
  double getSec(){
    return getNow()-start_time;
  }
};

class Solver {
  Timer timer;

  int D;
  vector<ll> cost;
  vector<vector<ll>> satisfuction;
  vector<int> ret;
  vector<int> last_array[30];
  ll now_score;

  ll prev_score;
  int undo_idx;
  int undo_a_idx, undo_b_idx;
  vector<int> undo_a, undo_b;
  
  void undo(){
    ret[undo_idx] = undo_a_idx;
    now_score = prev_score;
    last_array[undo_a_idx] = undo_a;
    last_array[undo_b_idx] = undo_b;
  }
  
  ll move_neighbor(){
    int r = xor128() % D;
    int z = xor128() % 26;
    int p = ret[r];

    prev_score = now_score;
    undo_idx = r;
    undo_a_idx = p;
    undo_b_idx = z;
    undo_a = last_array[p];
    undo_b = last_array[z];

    ret[r] = z;
    
    ll new_score = now_score;
    new_score -= satisfuction[r][p];
    new_score += satisfuction[r][z];
    
    {
      int idx = 0;
      rep(i,last_array[p].size()){
        if(last_array[p][i] == r){
          idx = i;
          break;
        }
      }
      ll prev = 0;
      if(idx-1 >= 0) prev = last_array[p][idx-1] + 1;
      ll next = D;
      if(idx+1 < last_array[p].size()) next = last_array[p][idx+1];
      {
        ll d = r - prev;
        new_score += cost[p] * (d*(d+1)/2);
      }
      {
        ll d = next - (r+1);
        new_score += cost[p] * (d*(d+1)/2);
      }
      {
        ll d = next - prev;
        new_score -= cost[p] * (d*(d+1)/2);
      }
      /*
      vector<int> tmp;
      rep(i,last_array[p].size()){
        if(last_array[p][i] == r) continue;
        tmp.push_back(last_array[p][i]);
      }
      last_array[p] = tmp;
       */
      last_array[p].erase(remove(ALLOF(last_array[p]),r), last_array[p].end());
    }
    {
      int idx = last_array[z].size();
      rep(i,last_array[z].size()){
        if(r < last_array[z][i]){
          idx = i;
          break;
        }
      }
      ll prev = 0;
      if(idx-1 >= 0) prev = last_array[z][idx-1] + 1;
      ll next = D;
      if(idx < last_array[z].size()) next = last_array[z][idx];
      {
        ll d = next - prev;
        new_score += cost[z] * (d*(d+1)/2);
      }
      {
        ll d = r - prev;
        new_score -= cost[z] * (d*(d+1)/2);
      }
      {
        ll d = next - (r+1);
        new_score -= cost[z] * (d*(d+1)/2);
      }
      /*
      last_array[z].push_back(r);
      sort(ALLOF(last_array[z]));
       */
      if(idx != last_array[z].size()){
        last_array[z].insert(last_array[z].begin()+idx, r);
      }else{
        last_array[z].push_back(r);
      }
    }

    ll diff = new_score - now_score;
    now_score = new_score;
    return diff;
  }

  double calc_temp(double sec){
    double start_temp = 2000.0;
    double end_temp = 1000.0;
    double now_temp = start_temp + (end_temp - start_temp) * sec / TIME_LIMIT;
    return now_temp;
  }
public:
  vector<int> solve(int day, const vector<ll>& c, const vector<vector<ll>>& s){
    timer.start();
    D = day;
    cost = c;
    satisfuction = s;
    now_score = 0;
    
    ret.resize(D);
    rep(i,D){
      int t = i%26;
      ret[i] = t;
      now_score += satisfuction[i][t];
      last_array[t].push_back(i);
    }
    rep(i,26){
      ll l = 0;
      rep(j,last_array[i].size()){
        ll d = last_array[i][j] - l;
        now_score -= cost[i] * (d*(d+1)/2);
        l = last_array[i][j]+1;
      }
      ll d = D - l;
      now_score -= cost[i] * (d*(d+1)/2);
    }

    cerr << now_score << endl;

    double sec = 0.0;
    double T = 0.0;
    while(true){
      sec = timer.getSec();
      if(sec > TIME_LIMIT) break;
      T = calc_temp(sec);
      bool undo_flag = false;
      
      ll delta = move_neighbor();
      //cerr << delta << endl;
      if(delta < 0){
        if(exp(delta / T) >= frand()){
          ;
        }else{
          undo_flag = true;
        }
      }
      if(undo_flag) undo();
    }

    cerr << now_score << endl;
    
    return ret;
  }
};


int main(){
  ios::sync_with_stdio(false);
  
  Solver solver;

  int D;
  cin >> D;
  vector<ll> c;
  rep(i,26){
    ll x;
    cin >> x;
    c.push_back(x);
  }
  vector<vector<ll>> s;
  rep(i,D){
    vector<ll> tmp;
    rep(j,26){
      ll x;
      cin >> x;
      tmp.push_back(x);
    }
    s.push_back(tmp);
  }

  vector<int> ret = solver.solve(D, c, s);

  rep(i,ret.size()){
    cout << ret[i]+1 << endl;
  }
  
  return 0;
}



Measured memory_bytes: 4440