#include <bits/stdc++.h>
using namespace std;

using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  auto begin = chrono::system_clock::now();
  
  int d;
  cin >> d;
  
  vector<int> c(26);
  for (int i = 0; i < 26; i++) cin >> c.at(i);
  
  vector<vector<ll>> s(d, vector<ll>(26));
  for (int i = 0; i < d; i++) {
    for (int j = 0; j < 26; j++) {
      cin >> s.at(i).at(j);
    }
  }
  
  // sが最大のものを貪欲
  vector<int> t(d);
  for (int i = 0; i < d; i++) {
    int it = 0;
    for (int j = 0; j < 26; j++) {
      if (s.at(i).at(j) > s.at(i).at(it)) it = j;
    }
    t.at(i) = it;
  }
  
  vector<vector<int>> dim(d, vector<int>(26, 1));
  ll suff = 0;
  for (int i = 0; i < d; i++) {
    suff += s.at(i).at(t.at(i));
    if (i > 0) {
      for (int j = 0; j < 26; j++) dim.at(i).at(j) = dim.at(i - 1).at(j) + 1;
    }
    dim.at(i).at(t.at(i)) = 0;
    for (int j = 0; j < 26; j++) {
      suff -= c.at(j) * dim.at(i).at(j);
    }
  }
  
  auto end = chrono::system_clock::now();
  auto time = chrono::duration_cast<chrono::microseconds>(end - begin).count();
  int dd = -1;
  while (time < 1000000) {
    dd = (dd + 1) % d;
    ll keepdelta = -10000, next = -1;
    for (int q = 0; q < 26; q++) {
      if (q == t.at(dd)) continue;
      vector<vector<int>> dim2 = dim;
      ll delta = s.at(dd).at(q) - s.at(dd).at(t.at(dd));
      for (int j = dd; j < d; j++) {
        delta += c.at(q) * dim2.at(j).at(q);
        delta += c.at(t.at(dd)) * dim2.at(j).at(t.at(dd));
      }
      dim2.at(dd).at(t.at(dd)) = 1; // 仮
      dim2.at(dd).at(q) = 0;
      for (int j = dd; j < d; j++) {
      if (dim2.at(j).at(t.at(dd)) > 0 && j > 0) dim2.at(j).at(t.at(dd)) = dim2.at(j - 1).at(t.at(dd)) + 1;
        if (dim2.at(j).at(q) > 0 && j > 0) dim2.at(j).at(q) = dim2.at(j - 1).at(q) + 1;
        delta -= c.at(q) * dim2.at(j).at(q);
        delta -= c.at(t.at(dd)) * dim2.at(j).at(t.at(dd));
      }
      if (delta > keepdelta) {
        keepdelta = delta;
        next = q;
      }
    }
    if (next == -1) continue;
    
    int q = next;
    dim.at(dd).at(t.at(dd)) = 1; // 仮
    dim.at(dd).at(q) = 0;
    for (int j = dd; j < d; j++) {
      if (dim.at(j).at(t.at(dd)) > 0 && j > 0) dim.at(j).at(t.at(dd)) = dim.at(j - 1).at(t.at(dd)) + 1;
      if (dim.at(j).at(q) > 0 && j > 0) dim.at(j).at(q) = dim.at(j - 1).at(q) + 1;
    }
    t.at(dd) = q;
    suff += keepdelta;
    end = chrono::system_clock::now();
    time = chrono::duration_cast<chrono::microseconds>(end - begin).count();
  }
  
  while (time < 1950000) {
    dd = (dd + 1) % d;
    ll keepdelta = -10000, next = -1;
    //for (int q = 0; q < 26; q++) {
      int q = rand() % 26;
      if (q == t.at(dd)) continue;
      vector<vector<int>> dim2 = dim;
      ll delta = s.at(dd).at(q) - s.at(dd).at(t.at(dd));
      for (int j = dd; j < d; j++) {
        delta += c.at(q) * dim2.at(j).at(q);
        delta += c.at(t.at(dd)) * dim2.at(j).at(t.at(dd));
      }
      dim2.at(dd).at(t.at(dd)) = 1; // 仮
      dim2.at(dd).at(q) = 0;
      for (int j = dd; j < d; j++) {
      if (dim2.at(j).at(t.at(dd)) > 0 && j > 0) dim2.at(j).at(t.at(dd)) = dim2.at(j - 1).at(t.at(dd)) + 1;
        if (dim2.at(j).at(q) > 0 && j > 0) dim2.at(j).at(q) = dim2.at(j - 1).at(q) + 1;
        delta -= c.at(q) * dim2.at(j).at(q);
        delta -= c.at(t.at(dd)) * dim2.at(j).at(t.at(dd));
      }
      if (delta > keepdelta) {
        keepdelta = delta;
        next = q;
      }
      else if ((double) rand() / RAND_MAX < 0.05) {
        keepdelta = delta;
        next = q;
      }
    //}
    if (next == -1) continue;
    
    q = next;
    dim.at(dd).at(t.at(dd)) = 1; // 仮
    dim.at(dd).at(q) = 0;
    for (int j = dd; j < d; j++) {
      if (dim.at(j).at(t.at(dd)) > 0 && j > 0) dim.at(j).at(t.at(dd)) = dim.at(j - 1).at(t.at(dd)) + 1;
      if (dim.at(j).at(q) > 0 && j > 0) dim.at(j).at(q) = dim.at(j - 1).at(q) + 1;
    }
    t.at(dd) = q;
    suff += keepdelta;
    end = chrono::system_clock::now();
    time = chrono::duration_cast<chrono::microseconds>(end - begin).count();
  }
  
  //cout << suff << endl;
  for (int i = 0; i < d; i++) cout << t.at(i) + 1 << '\n';
}

Measured memory_bytes: 3868