#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>
#include <sys/time.h>
 
using namespace std;
 
struct Timer {
  struct timeval start, cur;
  double limit;
	
  Timer() : limit(0) { gettimeofday(&start, NULL); }
  Timer(double l) : limit(l) { gettimeofday(&start, NULL); }
	
  bool isLimit() { return curTime() > limit; }
	
  double curTime() {
    gettimeofday(&cur, NULL);
    return (cur.tv_sec - start.tv_sec) + (cur.tv_usec - start.tv_usec) / 1e6;
  }
};
 
struct XorShift {
  unsigned int x, y, z, w;
 
  XorShift() { init(); }
  XorShift(unsigned int seed) { init(seed); }
 
  void init(unsigned int seed = 88675123) { x = 123456789; y = 362436069; z = 521288629; w = seed; }
 
  void setNext() {
    unsigned int t = x ^ (x << 11);
    x = y; y = z; z = w;
    w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
  }
  
  unsigned int nextUInt() { setNext(); return w; }
  unsigned int nextUInt(unsigned int n) { return nextUInt() % n; }
  double nextDouble() { return nextUInt() * (1.0 / 0xFFFFFFFFu); }
};
 
XorShift rnd(1953);
double T = 10000.0;
double COLD = 0.95;
 
bool next(long long diff) {
  if (diff >= 0) return true;
  else return rnd.nextDouble() < exp(diff / T);
}

int D;
int c[26];
vector<vector<int>> s;
vector<int> ans;

vector<set<int>> st;
vector<int> scoreOfContest;

 
// 初期解を生成
void generate_answer() {

  // 全部 0 にする
  /*
  for (int i = 0; i < D; i++) {
    ans[i] = 0;
  }
  */

  // 貪欲に一番いいやつを採用
  vector<int> last(26, 0);
  for (int i = 0; i < D; i++) {
    int val = -10101010;
    int id;
    for (int j = 0; j < 26; j++) {
      int tmp = s[i][j];
      for (int k = 0; k < 26; k++) {
        if (j == k) continue;
        tmp -= c[k] * (i + 1 - last[k]);
      }

      if (tmp > val) {
        id = j;
        val = tmp;
      }
    }

    last[id] = i + 1;
    ans[i] = id;
  }
}
 
// 答えを出力
void output_answer() {
  for (int i = 0; i < D; i++) {
    cout << ans[i] + 1 << endl;
  }
}

int getScore(vector<int> anss) {
  
  // 愚直にシミュレーションして得点計算
  // O(N * L + M * M)
  vector<int> last(26, 0);
  int score = 0;
  for (int i = 0; i < D; i++) {
    score += s[i][anss[i]];
    last[anss[i]] = i + 1;
    for (int j = 0; j < 26; j++) {
      score -= c[j] * (i + 1 - last[j]);
    }
  }

  return score;
}
 
int getScore() {
  
  // 愚直にシミュレーションして得点計算
  // O(N * L + M * M)
  vector<int> last(26, 0);
  int score = 0;
  for (int i = 0; i < D; i++) {
    score += s[i][ans[i]];
    last[ans[i]] = i + 1;
    for (int j = 0; j < 26; j++) {
      score -= c[j] * (i + 1 - last[j]);
    }
  }

  return score;
}

int scoreDiffNaive(vector<int> &before, vector<int> &after) {
  return getScore(after) - getScore(before);
}

int scoreDiff(int d, int q) {

  int u = q;
  int v = ans[d];
  auto tmpScoreOfContest = scoreOfContest;
  tmpScoreOfContest[u] = 0;
  tmpScoreOfContest[v] = 0;
  {
    int j = u;
    int last = 0;
    for (auto d : st[j]) {
      tmpScoreOfContest[j] += s[d][j];
      int delta = d - last;
      tmpScoreOfContest[j] -= (delta + 1) * delta / 2 * c[j];
      last = d + 1;
    }
    int delta = D - last;
    tmpScoreOfContest[j] -= (delta + 1) * delta / 2 * c[j];
  }
  {
    int j = v;
    int last = 0;
    for (auto d : st[j]) {
      tmpScoreOfContest[j] += s[d][j];
      int delta = d - last;
      tmpScoreOfContest[j] -= (delta + 1) * delta / 2 * c[j];
      last = d + 1;
    }
    int delta = D - last;
    tmpScoreOfContest[j] -= (delta + 1) * delta / 2 * c[j];
  }
  int ret = 0;
  for (int i = 0; i < 26; i++) {
    ret += tmpScoreOfContest[i];
  }

  return ret;
}
 
void yakinamashi() {
  
  Timer timer(283);
  while (timer.curTime() < 1.9) {
    size_t d = rnd.nextUInt() % D;
    int maxScoreDiff = -10101010;
    int q = -1;
    for (int j = 0; j < 26; j++) {
      int tmp = scoreDiff(d, j);
      if (tmp > maxScoreDiff) {
        maxScoreDiff = tmp;
        q = j;
      }
    }

    // cerr << "diff = " << maxScoreDiff << endl;
    
    assert(q != -1);
    if(next(maxScoreDiff)) ans[d] = q;
    T *= COLD;
    // cerr << T << " " << getScore() << endl;
  }
}

void init_set() {

  // cerr << "call init_set" << endl;
  for (int i = 0; i < D; i++) {
    // cerr << ans[i] << " " << st.size() << endl;
    st[ans[i]].insert(i);
  }
  // cerr << endl;

  for (int j = 0; j < 26; j++) {
    int last = 0;
    for (auto d : st[j]) {
      scoreOfContest[j] += s[d][j];
      int delta = d - last;
      scoreOfContest[j] -= (delta + 1) * delta / 2 * c[j];
      last = d + 1;
    }
    int delta = D - last;
    scoreOfContest[j] -= (delta + 1) * delta / 2 * c[j];
  }
}
 
int main() {
  
  // 入力受け取り
  cin >> D;
  for (int i = 0; i < 26; i++) {
    cin >> c[i];
  }

  s.resize(D);
  ans.resize(D);
  st.resize(26);
  scoreOfContest.resize(26);
  for (int i = 0; i < D; i++) {
    s[i].resize(26);
  }
  for (int i = 0; i < D; i++) {
    for (int j = 0; j < 26; j++) {
      cin >> s[i][j];
    }
  }
    
  // 初期解を生成
  generate_answer();
  init_set();
  
  // 時間いっぱい改善
  yakinamashi();
  // yamanobori();
 
  // 出力
  output_answer();
  // cout << getScore() << endl;
 
  return 0;
}


Measured memory_bytes: 4140