#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;

const int MAX_DEPTH = 37;
const int BEAM_WIDTH = 20;

int D;
vector<int> c;
vector<vector<int>> s;

class Node {
  public:
    int score, output;
    int last[26];

    Node(const Node &n){
      score = n.score;
      output = n.output;
      REP(i, 26){
        last[i] = n.last[i];
      }
    }

    Node(){
      score = 0;
      output = 0;
      REP(i, 26){
        last[i] = -1;
      }
    }
};

bool operator<(const Node &a, const Node &b){
  return a.score < b.score;
}
bool operator>(const Node &a, const Node &b){
  return a.score > b.score;
}

int score(vector<int> &t){
  vector<int> last(26, -1);

  int ans = 0;
  REP(i, D){
    ans += s[i][t[i]-1];
    last[t[i]-1] = i;

    REP(j, 26){
      ans -= (i-last[j])*c[j];
    }
  }
  return ans;
}


signed main() {
  cin >> D;

  c.resize(26);
  REP(i, 26) cin >> c[i];

  s = vector<vector<int>>(D, vector<int>(26));
  REP(i, D) REP(j, 26) cin >> s[i][j];

  vector<int> ans(D);

  auto eval = [&](Node n, int d, int i){
    int ret = s[d][i];
    REP(j, 26){
      if(i == j) continue;
      ret -= (i-n.last[j])*c[j];
    }
    return ret;
  };

  auto f = [&](Node now, int d){
    priority_queue<Node> nexts;
    nexts.push(now);

    for(int r = 0; r < MAX_DEPTH && d+r < D; r++){
      priority_queue<Node> tmp;
      for(int i = 0; i < BEAM_WIDTH && nexts.size() > 0; i++){
        tmp.push(nexts.top()); nexts.pop();
      }
      nexts = {};

      while(!tmp.empty()){
        Node cur = tmp.top(); tmp.pop();
        REP(i, 26){
          Node next = cur;
          next.score += eval(next, d+r, i);
          if(r == 0) next.output = i;
          nexts.push(next);
        }
      }
    }

    /* cout << nexts.top().score << "\n"; */
    return nexts.top();
  };

  Node now = Node();
  REP(i, D){
    now = f(now, i);
    ans[i] = now.output+1;
    cout << ans[i] << "\n";
  }

  /* cout << score(ans) << "\n"; */

  return 0;
}

Measured memory_bytes: 3784