// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



struct dat {

  int d;

  vector<int> c;

  vector<vector<int>> s;

};



int calc(const dat &a, const vector<int> &last, int day, int t) {

  int v = 0;

  v += a.s.at(day - 1).at(t);

  for (int i = 0; i < 26; i++) {

    if (i == t) continue;

    v -= a.c.at(i) * (day - last.at(i));

  }

  return v;

}



int main() {

  int d;

  cin >> d;

  vector<int> c(26);

  vector<vector<int>> s(d, vector<int>(26));

  for (int i = 0; i < 26; i++) {

    cin >> c.at(i);

  }

  for (int i = 0; i < d; i++) {

    for (int j = 0; j < 26; j++) {

      cin >> s.at(i).at(j);

    }

  }

  dat a = {d, c, s};

  

  int w = 26;

  vector<vector<int>> last(w, vector<int>(26)), ans(w);

  vector<int> score(w);

  for (int i = 0; i < d; i++) {

    vector<tuple<int, int, int>> idx;

    for (int j = 0; j < w; j++) {

      vector<int> best(w, -1e9), best_t(w);

      for (int t = 0; t < 26; t++) {

        int v = calc(a, last.at(j), i + 1, t);

        if (v > best.at(w - 1)) {

          best.at(w - 1) = v;

          best_t.at(w - 1) = t;

        }

        for (int k = w - 1; k > 0; k--) {

          if (best.at(k - 1) < best.at(k)) {

            swap(best.at(k - 1), best.at(k));

            swap(best_t.at(k - 1), best_t.at(k));

          }

        }

      }

      for (int k = 0; k < w; k++) {

        idx.emplace_back(score.at(j) + best.at(k), j, best_t.at(k));

      }

    }

    sort(idx.rbegin(), idx.rend());

    vector<vector<int>> newlast(w, vector<int>(26)), newans(w);

    for (int j = 0; j < w; j++) {

      int k = get<1>(idx.at(j)), t = get<2>(idx.at(j));

      score.at(j) = get<0>(idx.at(j));

      newans.at(j) = ans.at(k);

      newlast.at(j) = last.at(k);

      newans.at(j).push_back(t);

      newlast.at(j).at(t) = i + 1;

    }

    ans = newans;

    last = newlast;

  }

  for (int i = 0; i < d; i++) {

    cout << ans.at(0).at(i) + 1 << endl;

  }

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



struct dat {

  int d;

  vector<int> c;

  vector<vector<int>> s;

};



int calc(const dat &a, const vector<int> &last, int day, int t) {

  int v = 0;

  v += a.s.at(day - 1).at(t);

  for (int i = 0; i < 26; i++) {

    if (i == t) continue;

    v -= a.c.at(i) * (day - last.at(i));

  }

  return v;

}



int main() {

  int d;

  cin >> d;

  vector<int> c(26);

  vector<vector<int>> s(d, vector<int>(26));

  for (int i = 0; i < 26; i++) {

    cin >> c.at(i);

  }

  for (int i = 0; i < d; i++) {

    for (int j = 0; j < 26; j++) {

      cin >> s.at(i).at(j);

    }

  }

  dat a = {d, c, s};

  

  int w = 10;

  vector<vector<int>> last(w, vector<int>(26)), ans(w);

  vector<int> score(w);

  for (int i = 0; i < d; i++) {

    vector<tuple<int, int, int>> idx;

    for (int j = 0; j < w; j++) {

      vector<int> best(w, -4e4), best_t(w);

      for (int t = 0; t < 26; t++) {

        int v = calc(a, last.at(j), i + 1, t);

        if (v > best.at(w - 1)) {

          best.at(w - 1) = v;

          best_t.at(w - 1) = t;

        }

        for (int k = w - 1; k > 0; k--) {

          if (best.at(k - 1) < best.at(k)) {

            swap(best.at(k - 1), best.at(k));

            swap(best_t.at(k - 1), best_t.at(k));

          }

        }

      }

      for (int k = 0; k < w; k++) {

        if (best.at(k) == -4e4) continue;

        idx.emplace_back(score.at(j) + best.at(k), j, best_t.at(k));

      }

    }

    sort(idx.rbegin(), idx.rend());

    vector<vector<int>> newlast(w, vector<int>(26)), newans(w);

    for (int j = 0; j < w; j++) {

      if (j >= idx.size()) break;

      int k = get<1>(idx.at(j)), t = get<2>(idx.at(j));

      score.at(j) = get<0>(idx.at(j));

      newans.at(j) = ans.at(k);

      newlast.at(j) = last.at(k);

      newans.at(j).push_back(t);

      newlast.at(j).at(t) = i + 1;

    }

    ans = newans;

    last = newlast;

  }

  for (int i = 0; i < d; i++) {

    cout << ans.at(0).at(i) + 1 << endl;

  }

}


// Fastest known solution for this problem: