#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cstdio>
#include <bitset>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <functional>
#include <stack>
#include <cmath>
#include <string>

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

constexpr int MOD = 1000000007;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

inline int popcount(ll x) { return __builtin_popcountll(x); }
inline int div2num(ll x) { return __builtin_ctzll(x); }
inline bool bit(ll x, int b) { return (x >> b) & 1; }

template <class T> string to_string(T s);
template <class S, class T> string to_string(pair<S, T> p);
string to_string(string s) { return s; }
string to_string(const char s[]) { return to_string(string(s)); }

template <class T> string to_string(T v) {
  if (v.empty())
    return "{}";
  string ret = "{";
  for (auto x : v)
    ret += to_string(x) + ",";
  ret.back() = '}';
  return ret;
}

template <class S, class T> string to_string(pair<S, T> p) {
  return "{" + to_string(p.first) + ":" + to_string(p.second) + "}";
}
void debug() { cerr << endl; }

template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

class RandInt {
public:
  int x = 8753, y = 239017, z = 1000000123;
  int next(int d) {
    int t = x ^ (x << 11);
    x = y;
    y = z;
    z ^= (z >> 19) ^ t ^ (t >> 8);
    return z % d;
  }
} ri;

class Timer {
  static constexpr double ONE_CLOCK = 0.000000333;
  unsigned long long get_cycle() {
    unsigned int low, high;
    __asm__ volatile("rdtsc" : "=a"(low), "=d"(high));
    return ((unsigned long long int)low) | ((unsigned long long int)high << 32);
  }

public:
  unsigned long long start_time;
  Timer() { start_time = get_cycle(); }
  int get_time() { return get_cycle() * ONE_CLOCK - start_time * ONE_CLOCK; }
} timer;

constexpr int dy[4] = {-1, 0, 1, 0}, dx[4] = {0, -1, 0, 1};

template <class StateClass>
StateClass anneal(StateClass first_state, int duration,
                  function<double(double, double, double)> accept) {
  int start_time = timer.get_time();
  int end_time = start_time + duration;
  StateClass state = first_state, best_state = first_state;
  int ct = 0;
  while (timer.get_time() < end_time) {
    double prev_score = state.score;
    state.modify();
    if (best_state.score < state.score)
      best_state.copy_answer(state);
    if (state.score < prev_score) {
      double T = (double)(end_time - timer.get_time()) / duration;
      if (ri.next(65536) / 65536.0 > accept(T, prev_score, state.score))
        state.cancel();
    }
    // ct++;
    if (0 && ct++ % 1200 == 0)
      debug(best_state.score);
  }
  // debug(ct);
  return best_state;
}

constexpr int D = 365;
int c[26];
int s[D][26];

struct State {
  int ans[D];
  int score;
  Pii last_change;
  int last_score;
  State() {}
  void init() {
    int last[26] = {};
    REP(d, D) {
      Pii best(-1, -1);
      REP(i, 26) {
        int t = s[d][i] + c[i] * (d + 1 - last[i]);
        best = max(best, Pii(t, i));
      }
      ans[d] = best.second;
      last[best.second] = d;
    }
  }
  void set_score() {
    score = 0;
    int last[26] = {};
    REP(d, D) {
      score += s[d][ans[d]];
      last[ans[d]] = d + 1;
      REP(i, 26) score -= c[i] * (d + 1 - last[i]);
    }
  }
  void modify() {
    int d = ri.next(D), i = ri.next(26);
    last_change = {d, ans[d]};
    last_score = score;
    ans[d] = i;
    set_score();
  }
  void cancel() {
    ans[last_change.first] = last_change.second;
    score = last_score;
  }
  void copy_answer(State &state) {
    REP(d, D) ans[d] = state.ans[d];
    score = state.score;
  }
  void print_answer() { REP(d, D) cout << ans[d] + 1 << endl; }
};

int main() {
  int _;
  cin >> _;
  REP(i, 26) cin >> c[i];
  REP(d, D) REP(i, 26) cin >> s[d][i];
  State state;
  state.init();
  state.set_score();
  state = anneal(state, 1500, [](double T, double prev, double now) {
    double diff = now - prev;
    // debug(diff, exp(diff / 8000 / T));
    return exp(diff / 1000 / T);
  });
  debug(state.score);
  state.print_answer();
  return 0;
}

Measured memory_bytes: 4432