#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define STRINGIFY(n) #n
#define TOSTRING(n) STRINGIFY(n)
#define PREFIX "#" TOSTRING(__LINE__) "| "
#define debug(x) \
{ \
  std::cerr << PREFIX << #x << " = " << x << std::endl; \
}

std::ostream& output_indent(std::ostream& os, int ind) {
  for(int i = 0; i < ind; i++) os << " ";
  return os;
}

template<class S, class T> std::ostream& operator<<(std::ostream& os, const std::pair<S, T>& p);
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& v);

template<class S, class T> std::ostream& operator<<(std::ostream& os, const std::pair<S, T>& p) {
  return (os << "(" << p.first << ", " << p.second << ")");
}
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  os << "[";
  for(int i = 0;i < v.size();i++) os << v[i] << ", ";
  return (os << "]");
}

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) { return std::vector<T>(n, std::forward<T>(val)); }
template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}
template<class Cond> struct chain {
  Cond cond; chain(Cond cond) : cond(cond) {}
  template<class T> bool operator()(T& a, const T& b) const { if(cond(a, b)) { a = b; return true; } return false; }
};
template<class Cond> chain<Cond> make_chain(Cond cond) { return chain<Cond>(cond); }

std::mt19937 mt(188888888);
 
struct Timer {
  chrono::high_resolution_clock::time_point st;
  Timer() { st = now(); }
  chrono::high_resolution_clock::time_point now() { return chrono::high_resolution_clock::now(); }
  chrono::milliseconds::rep span() {
    auto ed = now();
    return chrono::duration_cast<chrono::milliseconds>(ed - st).count();
  }
};

const i64 M = 26;
i64 D;
vector<i64> C;
vector<vector<i64>> S;

i64 gen_rand(i64 N) {
  return mt() % N;
}

struct range {
  int ans;
  int left;
  int is_center;
  int right;
};

int range_sum(int n) {
  return n * (n + 1) / 2;
}

range merge_range(const range& a, const range& b) {
  if(a.is_center && b.is_center) {
    return range { a.ans + b.ans + range_sum(a.right + b.left), a.left, 1, b.right };
  }
  else if(a.is_center && !b.is_center) {
    return range { a.ans , a.left, 1, a.right + b.left };
  }
  else if(!a.is_center && b.is_center) {
    return range { b.ans, a.left + b.left, 1, b.right };
  }
  else {
    return range { 0, a.left + b.left, 0, 0 };
  }
}

int range_ans(const range& a) {
  return a.ans + range_sum(a.left) + range_sum(a.right);
}

#include <vector>
using i64 = long long;

struct segment_tree {
  using T = range;
  range Ide = range { 0, 0, 0, 0 };
 
  i64 n;
  std::vector<T> node;

  segment_tree(const std::vector<T>& init) {
    n = 1;
    while(n < init.size()) n *= 2;
    node.resize(2 * n, Ide);
    for(int i = 0;i < init.size();i++) node[i + n] = init[i];
    for(int i = n - 1; i >= 1;i--) node[i] = merge_range(node[i * 2], node[i * 2 + 1]);
  }
 

  void update(i64 i, T x) {
    i += n;
    node[i] = x;
    while(i > 1) {
      i = i / 2;
      node[i] = merge_range(node[i * 2], node[i * 2 + 1]);
    }
  }


  i64 sum() const {
    return range_ans(node[1]);
  }
};

range none_range = { 0, 1, 0, 0 };
range contest_range = { 0, 0, 1, 0 };

vector<i64> solve() {

  vector<i64> best(D, 0);
  i64 best_score = -1e17;

  Timer timer;

  vector<i64> ans(D);
  vector<segment_tree> segs(M, segment_tree(std::vector<range>(D, none_range)));
  i64 ans_score = 0;
  rep(i,0,D) {
    ans[i] = gen_rand(M);
    ans_score += S[i][ans[i]];
    segs[ans[i]].update(i, contest_range);
  }
  rep(i,0,M) {
    ans_score -= C[i] * segs[i].sum();
  }

  i64 q = 0;
  const i64 init_cnt = 8000;
  i64 else_cnt = init_cnt;
  i64 noupdate_cnt = 0;
  for(q = 0; timer.span() < 1900; q++) {
    if(else_cnt >= init_cnt) {
      else_cnt = 0;
      if(ans_score > best_score) {
        best = ans;
        best_score = ans_score;
      }
      /* ans_score = 0;
      const i64 CHANGE = 3;
      rep(i,0,CHANGE) {
        i64 d = gen_rand(D);
        i64 m = gen_rand(M);
      }
      rep(k,0,M) {
        Sigma[k] = calc_score(k, ans);
        ans_score += Sigma[k];
      } */
      {
        const i64 CHANGE = 3;
        rep(i,0,CHANGE) {
          i64 d = gen_rand(D);
          i64 m = gen_rand(M);
          i64 b = ans[d];
          if(m == b) continue;
          ans[d] = m;
          ans_score += C[m] * segs[m].sum();
          ans_score += C[b] * segs[b].sum();
          ans_score -= S[d][b];
          segs[m].update(d, contest_range);
          segs[b].update(d, none_range);
          ans_score -= C[m] * segs[m].sum();
          ans_score -= C[b] * segs[b].sum();
          ans_score += S[d][m];
        }
      }
    }
    i64 d = gen_rand(D);
    i64 m = gen_rand(M);
    i64 b = ans[d];
    if(m == b) continue;

    i64 res_score = ans_score;

    res_score += C[m] * segs[m].sum();
    res_score += C[b] * segs[b].sum();
    res_score -= S[d][b];
    segs[m].update(d, contest_range);
    segs[b].update(d, none_range);
    res_score -= C[m] * segs[m].sum();
    res_score -= C[b] * segs[b].sum();
    res_score += S[d][m];

    if(res_score > ans_score) {
      ans[d] = m;
      std::swap(res_score, ans_score);
    }
    else {
      segs[m].update(d, none_range);
      segs[b].update(d, contest_range);
      else_cnt++;
    }
  }
  if(ans_score > best_score) {
    std::swap(best, ans);
    std::swap(best_score, ans_score);
  }
  cerr << best_score << endl;
  cerr << q << endl;
  cerr << noupdate_cnt << endl;
  return best;
}

int main() {
  cin >> D;
  C.resize(M);
  rep(i,0,M) {
    cin >> C[i];
  }
  S.resize(D);
  rep(i,0,D) {
    S[i].resize(M);
    rep(j,0,M) {
      cin >> S[i][j];
    }
  }

  vector<i64> ans = solve();
  rep(i,0,D) {
    cout << ans[i] + 1 << endl;
  }
}



Measured memory_bytes: 3832