#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

vector<ll> C(26);
vector<vector<ll>> S;
ll D;

ll change_evaluation(vector<ll>& T,ll day) {
  day -= 1;
  vector<ll> last(26, -1);
  vector<ll> next(26, T.size());
  ll old = T.at(day) - 1;
  for (ll i = 0; i < day; ++i) {
    last.at(T.at(i) - 1) = i;
  }
  for (ll i = T.size() - 1; i > day; --i) {
    next.at(T.at(i) - 1) =  i;
  }
  ll max_t = 0, max_score = -INF;
  for (ll t = 0; t < 26; ++t) {
    ll score = S.at(day).at(t) - S.at(day).at(old);
    score += (next.at(t) - day) * (day - last.at(t)) * C.at(t);
    score -= (next.at(old) - day) * (day - last.at(old)) * C.at(old);
    if (score > max_score) {
      max_score = score;
      max_t = t;
    }
  }
  return max_t;
}

ll evaluation(ll t, ll day, vector<ll>& last, ll delay = 7) {
  ll score = 0;
  score += S.at(day).at(t);
  for (ll j = 0; j < 26; ++j) {
    score -= delay * (delay - 1) / 2 * C.at(j);
    if (j == t) {
      continue;
    }
    score -= delay * (day + 1 - last.at(j)) * C.at(j);
  }
  return score;
}

ll whole_evaluation(vector<ll>& T) {
  vector<ll> last(26, 0);
  ll score = 0;
  for (ll i = 0; i < D; ++i) {
    ll contest = T.at(i) - 1;
    last.at(contest) = i + 1;
    score += S.at(i).at(contest);
    for (ll j = 0; j < 26; ++j) {
      score -= (i + 1 - last.at(j)) * C.at(j);
    }
  }
  return score;
}

void gready_search(vector<ll>& T) {
  vector<ll> max_T = T;
  ll max_T_score = -INF;
  for (ll delay = 0; delay < 26; ++delay) {
    vector<ll> last(26, 0);
    for (ll day = 0; day < D; ++day) {
      ll max_contest = 0;
      ll max_score = -INF;
      for (ll contest = 0; contest < 26; ++contest) {
        ll temp_score = evaluation(contest, day, last);
        if (temp_score > max_score) {
          max_score = temp_score;
          max_contest = contest + 1;
        }
      }
      last.at(max_contest - 1) = day;
      T.at(day) = max_contest;
    }
    ll temp_T_score = whole_evaluation(T);
    if (temp_T_score > max_T_score) {
      max_T_score = temp_T_score;
      max_T = T;
    }
  }
  T = max_T;
}

void swap_search(vector<ll>& T) {
  ll itr_time = 100000;
  ll T0 = 2000, T1 = 400, Ti;
  random_device rnd;
  mt19937 mt(rnd());
  uniform_int_distribution<> rand(1, T.size());
  uniform_int_distribution<> rand_step(0, 1);
  uniform_int_distribution<> rand_place(0, T.size() - 1);
  uniform_int_distribution<> rand_dif(1, 16);
  for (ll i = 0; i < itr_time; ++i) {
    if (i % 100 == 0) {
      Ti = pow(T0, 1 - i / (double)itr_time) * pow(T1, i / (double)itr_time);
    }
    ll whitch = rand_step(mt);
    ll percent = rand_step(mt);
    if (whitch != 0) {
      ll random = rand(mt);
      ll max_t = change_evaluation(T, random);
      // cout << max_t << " rand" << "\n";
      T.at(random - 1) = max_t + 1;
    }
    else {
      vector<ll> temp_T = T;
      ll place = rand_place(mt);
      ll dif1 = rand_dif(mt);
      swap(temp_T.at(place), temp_T.at(min((ll)temp_T.size() - 1, place + dif1)));
      ll temp_score1 = whole_evaluation(temp_T);
      ll temp_score2 = whole_evaluation(T);
      if (temp_score1 > temp_score2) {
        T = temp_T;
      }
      else if (percent / 5.0 > pow(2.7, (temp_score2 - temp_score1) / (double)Ti)) {
        T = temp_T;
      }
    }
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  //-----------input-------------
  cin >> D;
  vector<ll> T(D);
  S = vector<vector<ll>>(D, vector<ll>(26));
  for (ll i = 0; i < 26; ++i) {
    cin >> C.at(i);
  }
  for (ll i = 0; i < D; ++i) {
    for (ll j = 0; j < 26; ++j) {
      cin >> S.at(i).at(j);
    }
  }
  //--------------------------------------
  gready_search(T);
  swap_search(T);
  // cout << score << "\n";

  for (ll i = 0; i < D; ++i) {
    cout << T.at(i) << "\n";
  }

  // vector<ll> ans = evaluation(C, S, T);
  // for (ll i = 0; i < ans.size(); ++i) {
  //   cout << ans.at(i) << "\n";
  // }
}


Measured memory_bytes: 4372