#include<cstdio>
#include<set>
#include<cstdlib>
#include<chrono>
#include<vector>
#include<utility>

using namespace std;

int d, c[100], s[400][100];
set<int> app[100];

int last(int d, int i) {
  return *(--app[i].upper_bound(d));
}

int next(int d, int i) {
  return *app[i].upper_bound(d);
}

int random(int x, int y) {
  return rand() % (y - x + 1) + x;
}

pair<int, vector<int>> init() {
  int sat = 0;
  vector<int> t(1);
  for (int i = 1; i <= 26; i++) {
    app[i].clear();
    app[i].insert(0);
    app[i].insert(d+1);
  }
  for (int i = 1; i <= d; i++) {
    int best = -2e9, best_j = 0;
    for (int j = 1; j <= 26; j++) {
       int tmp = 0;
       tmp += s[i][j];
       for (int k = 1; k <= 26; k++) {
         if (j == k) {
           continue;
         }
         tmp -= c[k] * (i - last(i, k));
       }
       if (tmp > best) {
         best = tmp;
         best_j = j;
       }
    }
    t.push_back(best_j);
    sat += s[i][t[i]];
    app[t[i]].insert(i);
    for (int j = 1; j <= 26; j++) {
      sat -= c[j] * (i - last(i, j));
    }
  }
  return {sat, t};
}

pair<int, vector<int>> init2() {
  int sat = 0;
  vector<int> t(1);
  for (int i = 1; i <= 26; i++) {
    app[i].clear();
    app[i].insert(0);
    app[i].insert(d+1);
  }
  for (int i = 1; i <= d; i++) {
    int best = -2e9, best_j = 0;
    for (int j = 1; j <= 26; j++) {
       int tmp = 0;
       tmp += s[i][j];
       for (int k = 1; k <= 26; k++) {
         if (j == k) {
           continue;
         }
         tmp -= c[k] * (i - last(i, k)) * 2;
       }
       if (tmp > best) {
         best = tmp;
         best_j = j;
       }
    }
    t.push_back(best_j);
    sat += s[i][t[i]];
    app[t[i]].insert(i);
    for (int j = 1; j <= 26; j++) {
      sat -= c[j] * (i - last(i, j));
    }
  }
  return {sat, t};
}

pair<int, vector<int>> climb(auto start, int sat, vector<int> t) {
  auto end = chrono::steady_clock::now();
  while (chrono::duration_cast<chrono::nanoseconds>(end - start).count() < 1.9e9) {
    int best = -2e9, best_i = 0, best_j = 0;
    for (int i = 1; i <= d; i++) {
      for (int j = 1; j <= 26; j++) {
        if (j == t[i]) {
          continue;
        }
        int tmp = 0;
        tmp -= s[i][t[i]];
        tmp -= c[t[i]] * (next(i, t[i]) - i) * (i - last(i - 1, t[i]));

        tmp += s[i][j];
        tmp += c[j] * (next(i, j) - i) * (i - last(i, j));
        if (tmp > best) {
          best = tmp;
          best_i = i;
          best_j = j;
        }
      }
    }
    if (best > 0) {
      app[t[best_i]].erase(best_i);
      app[best_j].insert(best_i);
      t[best_i] = best_j;
      sat += best;
    } else {
      break;
    }
    end = chrono::steady_clock::now();
  }
  return {sat, t};
}

int main() {
  scanf("%d", &d);
  for (int i = 1; i <= 26; i++) {
    scanf("%d", &c[i]);
  }
  for (int i = 1; i <= d; i++) {
    for (int j = 1; j <= 26; j++) {
      scanf("%d", &s[i][j]);
    }
  }
  auto start = chrono::steady_clock::now();
  auto tmp = init();
  auto res = climb(start, tmp.first, tmp.second);
  auto tmp2 = init2();
  auto res2 = climb(start, tmp2.first, tmp2.second);
  auto ans = res;
  if (res2.first > res.first) {
    ans = res2;
  }
  for (int i = 1; i <= d; i++) {
    printf("%d\n", ans.second[i]);
  }
}


Measured memory_bytes: 3520