#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 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) {
  ll D = T.size();
  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 swap_search(vector<ll>& T) {
  random_device rnd;
  mt19937 mt(rnd());
  uniform_int_distribution<> rand(1, T.size());
  uniform_int_distribution<> rand_step(0, 5);
  uniform_int_distribution<> rand_place(0, T.size() - 1);
  uniform_int_distribution<> rand_dif(1, 16);
  for (ll i = 0; i < 100000; ++i) {
    ll whitch = 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 dif2 = rand_dif(mt);
      swap(temp_T.at(place), temp_T.at(min((ll)temp_T.size() - 1, place + dif2)));
      ll temp_score2 = whole_evaluation(temp_T);
      ll temp_score3 = whole_evaluation(T);
      if (temp_score1 > temp_score2) {
        if (temp_score1 > temp_score3) {
            swap(temp_T.at(place), temp_T.at(min((ll)temp_T.size() - 1, place + dif2)));
            T = temp_T;
        }
      }
      else if (temp_score2 > temp_score3) {
        T = temp_T;
      }
    }
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  //-----------input-------------
  ll D;
  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);
    }
  }
  //--------------------------------------
  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;
  swap_search(T);

  vector<ll> new_T = T;
  max_T_score = -INF;
  for (ll delay = 0; delay < 26; ++delay) {
    vector<ll> last(26, 0);
    for (ll day = D - 1; day >= 0; --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;
      new_T.at(day) = max_contest;
    }
    ll temp_T_score = whole_evaluation(new_T);
    if (temp_T_score > max_T_score) {
      max_T_score = temp_T_score;
      max_T = new_T;
    }
  }
  swap_search(new_T);


  ll score_T = whole_evaluation(T);
  ll score_new_T = whole_evaluation(new_T);
  if (score_new_T > score_T) {
    T = new_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: 3776