#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 ntype;
  int undo_idx, undo_idx2;
  int undo_a_idx, undo_b_idx;
  vector<int> undo_a, undo_b;
  
  void undo(){
    if(ntype == 1){
      ret[undo_idx] = undo_a_idx;
      now_score = prev_score;
      last_array[undo_a_idx] = undo_a;
      last_array[undo_b_idx] = undo_b;
    }else if(ntype == 2){
      ret[undo_idx] = undo_a_idx;
      ret[undo_idx2] = undo_b_idx;
      now_score = prev_score;
      last_array[undo_a_idx] = undo_a;
      last_array[undo_b_idx] = undo_b;
    }
  }

  ll move_1change(){
    ntype = 1;
    int r = xor128() % D;
    int z = xor128() % 26;
    int p = ret[r];
    if(z == p){
      ntype = 0;
      return 0;
    }
    
    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);
      }
      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);
      }
      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;
  }

  ll move_2swap(){
    ntype = 2;
    int r1 = xor128() % D;
    int r2 = xor128() % D;
    if(r1 > r2) swap(r1,r2);
    if(r1 == r2){
      ntype = 0;
      return 0;
    }
    int a = ret[r1];
    int b = ret[r2];
    
    prev_score = now_score;
    undo_idx = r1;
    undo_idx2 = r2;
    undo_a_idx = a;
    undo_b_idx = b;
    undo_a = last_array[a];
    undo_b = last_array[b];
    
    ret[r1] = b;
    ret[r2] = a;
    
    ll new_score = now_score;
    new_score -= satisfuction[r1][a];
    new_score += satisfuction[r2][a];
    new_score -= satisfuction[r2][b];
    new_score += satisfuction[r1][b];

    {
      int idx = 0;
      rep(i,last_array[a].size()){
        if(last_array[a][i] == r1){
          idx = i;
          break;
        }
      }
      ll prev = 0;
      if(idx-1 >= 0) prev = last_array[a][idx-1] + 1;
      ll next = D;
      if(idx+1 < last_array[a].size()) next = last_array[a][idx+1];
      {
        ll d = r1 - prev;
        new_score += cost[a] * (d*(d+1)/2);
      }
      {
        ll d = next - (r1+1);
        new_score += cost[a] * (d*(d+1)/2);
      }
      {
        ll d = next - prev;
        new_score -= cost[a] * (d*(d+1)/2);
      }
      last_array[a].erase(remove(ALLOF(last_array[a]),r1), last_array[a].end());
    }
    {
      int idx = 0;
      rep(i,last_array[b].size()){
        if(last_array[b][i] == r2){
          idx = i;
          break;
        }
      }
      ll prev = 0;
      if(idx-1 >= 0) prev = last_array[b][idx-1] + 1;
      ll next = D;
      if(idx+1 < last_array[b].size()) next = last_array[b][idx+1];
      {
        ll d = r2 - prev;
        new_score += cost[b] * (d*(d+1)/2);
      }
      {
        ll d = next - (r2+1);
        new_score += cost[b] * (d*(d+1)/2);
      }
      {
        ll d = next - prev;
        new_score -= cost[b] * (d*(d+1)/2);
      }
      last_array[b].erase(remove(ALLOF(last_array[b]),r2), last_array[b].end());
    }
    {
      int idx = last_array[a].size();
      rep(i,last_array[a].size()){
        if(r2 < last_array[a][i]){
          idx = i;
          break;
        }
      }
      ll prev = 0;
      if(idx-1 >= 0) prev = last_array[a][idx-1] + 1;
      ll next = D;
      if(idx < last_array[a].size()) next = last_array[a][idx];
      {
        ll d = next - prev;
        new_score += cost[a] * (d*(d+1)/2);
      }
      {
        ll d = r2 - prev;
        new_score -= cost[a] * (d*(d+1)/2);
      }
      {
        ll d = next - (r2+1);
        new_score -= cost[a] * (d*(d+1)/2);
      }
      if(idx != last_array[a].size()){
        last_array[a].insert(last_array[a].begin()+idx, r2);
      }else{
        last_array[a].push_back(r2);
      }
    }
    {
      int idx = last_array[b].size();
      rep(i,last_array[b].size()){
        if(r1 < last_array[b][i]){
          idx = i;
          break;
        }
      }
      ll prev = 0;
      if(idx-1 >= 0) prev = last_array[b][idx-1] + 1;
      ll next = D;
      if(idx < last_array[b].size()) next = last_array[b][idx];
      {
        ll d = next - prev;
        new_score += cost[b] * (d*(d+1)/2);
      }
      {
        ll d = r1 - prev;
        new_score -= cost[b] * (d*(d+1)/2);
      }
      {
        ll d = next - (r1+1);
        new_score -= cost[b] * (d*(d+1)/2);
      }
      if(idx != last_array[b].size()){
        last_array[b].insert(last_array[b].begin()+idx, r1);
      }else{
        last_array[b].push_back(r1);
      }
    }

    /*
    rep(i,undo_a.size()) cout << undo_a[i] << " "; cout << "->";
    rep(i,last_array[a].size()) cout << last_array[a][i] << " "; cout << endl;
    rep(i,undo_b.size()) cout << undo_b[i] << " "; cout << "->";
    rep(i,last_array[b].size()) cout << last_array[b][i] << " "; cout << endl;
    cout << "-----" << endl;
    */
    
    ll diff = new_score - now_score;
    now_score = new_score;
    return diff;    
  }
  
  ll move_neighbor(){
    if(xor128()%100 < 50){
      return move_1change();
    }else{
      return move_2swap();
    }
  }

  double calc_temp(double sec){
    double start_temp = 2000.0;
    double end_temp = 100.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;
    int cnt = 0;
    while(true){
      sec = timer.getSec();
      if(sec > TIME_LIMIT) break;
      cnt++;
      T = calc_temp(sec);
      bool undo_flag = false;
      
      ll delta = move_neighbor();
      if(delta < 0){
        if(exp(delta / T) >= frand()){
          ;
        }else{
          undo_flag = true;
        }
      }
      if(undo_flag){
        undo();
      }
    }

    cerr << now_score << endl;
    cerr << "cnt: " << cnt << 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: 4396