#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;
//typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
//typedef tuple<int, int, int> T;
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++)
#define REP(i,x) FOR(i,0,x)
#define ALL(c) c.begin(), c.end()
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = {0, 1, 0, -1};

const ll mod = 1e9 + 7;

using std::chrono::system_clock;

int D;
int C[26];
std::vector<std::vector<int>> S;
const int INF = 1e9;

std::vector<int> T;
std::set<int> T2[26];
int calced_score;

system_clock::time_point start;

void init() {
  std::cin >> D;
  REP(i, 26) std::cin >> C[i];
  S.resize(D);
  REP(i, D) {
    S[i].resize(26);
    REP(j, 26) std::cin >> S[i][j];
  }

  T.resize(D, -1);
}

std::vector<int> prev_days;

int calc_score(std::vector<int> &contests, bool verbose = false) {
  int score = 0;
  prev_days.assign(26, -1);
  REP(i, contests.size()) {
    prev_days[contests[i]] = i;
    if (verbose) {
      for (int d : prev_days) std::cerr << d << ' ';
      std::cerr << endl;
    }
    REP(j, 26) {
      score -= C[j] * (i - prev_days[j]);
    }
    score += S[i][contests[i]];
    if (verbose) {
      std::cerr << score << std::endl;
    }
  }
  return score;
}

void output() {
  for (int t : T) std::cout << t + 1 << '\n';
}

void greedy() {
  std::vector<int> contests;
  REP(d, D) {
    int max_score = -INF, max_con = -1;
    REP(i, 26) {
      contests.emplace_back(i);
      int new_score = calc_score(contests);
      if (new_score > max_score) {
        max_score = new_score;
        max_con = i;
      }
      contests.pop_back();
    }
    contests.emplace_back(max_con);
  }
  T = contests;
  calced_score = calc_score(T);
  std::cerr << calced_score << endl;
}

void init_set() {
  REP(i, D) T2[T[i]].insert(i);
}

inline int score_day_diff(int day1, int day2) {
  return (day2 - day1) * (day2 - day1 - 1) / 2;
}

void show_set() {
  for (int d : T) std::cerr << d << ' ';
  std::cerr << std::endl;
  REP(i, 26) {
    std::cerr << i << ": {";
    for (int d : T2[i]) std::cerr << d << ',';
    std::cerr << '}' << std::endl;
  }
}

int calc_updated_score(int day, int con1, int con2) {
  // ある日 day を con1 から con2 に変更したときのスコア
  //std::cerr << day << ':' << con1 << "->" << con2 << std::endl;
  int score = calced_score;

  auto it = T2[con1].find(day);
  assert(it != T2[con1].end());
  int prev_day = -1;
  if (it != T2[con1].begin()) {
    prev_day = *prev(it);
  }
  int next_day = D;
  auto next_it = next(it);
  if (next_it != T2[con1].end()) {
    next_day = *next_it;
  }
  //std::cerr << prev_day << "," << next_day << std::endl;
  //std::cerr << "prev/next" << std::endl;

  score += (score_day_diff(prev_day, day)
            + score_day_diff(day, next_day)
            - score_day_diff(prev_day, next_day)) * C[con1] - S[day][con1];

  T2[con1].erase(it);
  it = T2[con2].lower_bound(day);
  prev_day = -1;
  if (it != T2[con2].begin()) {
    prev_day = *prev(it);
  }
  next_day = D;
  if (it != T2[con2].end()) {
    next_day = *it;
  }

  score += (score_day_diff(prev_day, next_day)
            - score_day_diff(prev_day, day)
            - score_day_diff(day, next_day)) * C[con2] + S[day][con2];
  //std::cerr << prev_day << "," << next_day << std::endl;

  T2[con1].insert(day);
  //std::cerr << "prev/next" << std::endl;

  return score;
}

bool update_greedy() {
  int score = calced_score;
  bool is_updated = false;
  int day = -1, cont = -1;
  REP(d, D) {
    REP(i, 26) {
      int new_score = calc_updated_score(d, T[d], i);
      /*
      int tmp = T[d];
      T[d] = i;
      std::cerr << new_score << ' ' << calc_score(T) << std::endl;
      T[d] = tmp;
      */
      if (new_score > score) {
        score = new_score;
        is_updated = true;
        day = d, cont = i;
      }
    }
  }
  //std::cerr << std::endl;
  if (is_updated) {
    T2[T[day]].erase(day);
    T2[cont].insert(day);
    T[day] = cont, calced_score = score;
  }
  return is_updated;
}

void greedy2() {
  init_set();
  while (true) {
    double diff = std::chrono::duration_cast<std::chrono::milliseconds>(
        system_clock::now() - start).count() / 1000.;
    if (diff > 1.9) break;
    //show_set();
    if (not update_greedy()) {
      break;
    }
  }
  std::cerr << calc_score(T) << ' ' << calced_score << endl;
}

int main() {
  start = system_clock::now();

  // use scanf in CodeForces!
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  init();

  greedy();
  greedy2();

  output();

  return 0;
}


Measured memory_bytes: 3740