#include <bits/stdc++.h>

using namespace std;

int D;
vector<int> C(26);
vector<vector<int>> S;
vector<vector<int>> last;
vector<int> answer;

double rdtsc() {
  uint32_t lo, hi;
  __asm__ volatile("rdtsc" : "=a" (lo) , "=d" (hi));
  return (int64_t)lo | ((int64_t)hi << 32);
}

static double sec_per_ticks = -1;
double elapsed_seconds() {
  static double start_ticks = rdtsc();
  static chrono::system_clock::time_point start_clock = chrono::system_clock::now();

  double now_ticks = rdtsc();
  double elapsed_ticks = now_ticks - start_ticks;

  if (sec_per_ticks > 0) {
    return (now_ticks - start_ticks) * sec_per_ticks;
  }

  chrono::system_clock::time_point now_clock = chrono::system_clock::now();
  double elapsed_seconds = static_cast<double>(chrono::duration_cast<chrono::microseconds>(now_clock - start_clock).count() / 1000000.0);

  if (elapsed_seconds > 0.1) {
    sec_per_ticks = elapsed_seconds / elapsed_ticks;
  }
  return elapsed_seconds;
}

int find_best_contest(int day) {
  int t = 0;
  for (int c = 0; c < 26; c++) {
    if (S[day][c] > S[day][t]) { t = c; }
  }
  return t;
}

int64_t greedy_satisfaction() {
  int64_t satisfaction = 0;
  for (int day = 1; day <= D; day++) {
    int target = answer[day];
    satisfaction += S[day][target];
    for (int c = 0; c < 26; c++) {
      satisfaction -= C[c] * (day - last[day][c]);
    }
  }
  return satisfaction;
}

int next_contest(int day, int contest) {
  for (int next = day + 1; next <= D; next++) {
    if (answer[next] == contest) return next;
  }
  return D + 1;
}

int prev_contest(int day, int contest) {
  for (int prev = day - 1; prev >= 1; prev--) {
    if (answer[prev] == contest) return prev;
  }
  return 0;
}

int64_t try_remove_contest(int day, int contest) {
  int64_t diff_satisfaction = -S[day][contest];

  int next = next_contest(day, contest);
  int prev = prev_contest(day, contest);
  diff_satisfaction -= (day - prev) * (next - day) * C[contest]; 

  return diff_satisfaction;
}

int64_t try_add_contest(int day, int contest) {
  int64_t diff_satisfaction = S[day][contest];

  int next = next_contest(day, contest);
  int prev = prev_contest(day, contest);
  diff_satisfaction += (day - prev) * (next - day) * C[contest]; 

  return diff_satisfaction;
}

int64_t try_replace_contest(int day, int target) {
  int current = answer[day];
  if (target == current) return 0;

  return try_remove_contest(day, current) + try_add_contest(day, target);
}

void exec_replace_contest(int day, int target) {
  int current = answer[day];
  if (target == current) return;

  answer[day] = target;
}

int64_t compute_score(int64_t satisfaction) {
  return max(1000000LL + satisfaction, 0LL);
}

int main() {
  cin >> D;
  S = vector<vector<int>>(D + 1, vector<int>(26));
  last = vector<vector<int>>(D + 1, vector<int>(26, 0));
  answer = vector<int>(D + 1);
  for (int i = 0; i < 26; i++) cin >> C[i];
  for (int d = 0; d < D; d++) for (int i = 0; i < 26; i++) cin >> S[d + 1][i];

  for (int day = 1; day <= D; day++) {
    int target = find_best_contest(day);
    answer[day] = target;
    for (int c = 0; c < 26; c++) {
      last[day][c] = (c != target) ? last[day - 1][c] : day;
    }
  }

  double temp_start = 10000.0;
  double temp_end = 1.0;
  double temperature = temp_start;

  double time_start = elapsed_seconds();

  double TIME_LIMIT = 1.8;
  double TIME_LIMIT_INV = 1.0 / TIME_LIMIT;

  double time_now = elapsed_seconds();
  int64_t satisfaction = greedy_satisfaction();
  for (int64_t i = 0; ; i++) {
    if ((i & 1023) == 0) {
      time_now = elapsed_seconds();
      if (time_now > TIME_LIMIT) {
	break;
      }

      temperature = temp_start - (temp_start - temp_end) * time_now * TIME_LIMIT_INV;
    }
    int day = 1 + random() % 365;
    int target = random() % 26;
    int64_t diff_satisfaction = try_replace_contest(day, target);
    if (diff_satisfaction <= 0) {
      double prob = exp(diff_satisfaction / temperature);
      if ((double)random() / RAND_MAX > prob) continue;
    }
    satisfaction += diff_satisfaction;
    exec_replace_contest(day, target);
  }

  if (0) {
    double time_end = elapsed_seconds();
    cerr << time_end << endl;
    for (int day = 1; day <= D; day++) {
      int target = answer[day];
      answer[day] = target;
      for (int c = 0; c < 26; c++) {
	last[day][c] = (c != target) ? last[day - 1][c] : day;
      }
    }
    cerr << greedy_satisfaction() << endl;
  }

  for (int i = 1; i <= D; i++) {
    cout << 1 + answer[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 4416