#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <sstream>
#include <queue> 
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm> 
#include <numeric>  
#include <functional>
#include <cassert>
#include <bitset>
#include <cctype>  
#include <iomanip> 
#include <limits>  
#include <regex>
#include <random>
// std::numeric_limits<int>::max(), min()
// std::setprecision(X)
// std::islower(), std::isupper(), std::tolower, std::toupper
// std::accumulate(m.begin(), m.end(), 0LL);
// std::sort(begin(),end()) // 0, 1, 2, 3 ,4 (default, less);
// std::priority_queue<int, vector<int>, less<int>> que; // 4, 3, 2, 1 (defualt, less) : 
// if ( std::regex_match(S, std::regex("(dream|dreamer|erase|eraser)*")) ) std::cout << "YES" << std::endl;

#define rep(i,n)  for(int i = 0; i < (int)(n);    i++)
#define sz(x)     ((int)(x).size())
#define all(x)    (x).begin(),(x).end()

using ll = long long;

ll gcd ( ll a, ll b ) { if ( b == 0 ) return a; else return gcd ( b, a%b ); }
ll lcm ( ll a, ll b ) { return a * b / gcd(a, b); }

class AtcoderContestSchedule {
  public:
    int D;
    std::array<int,26> c;
    std::vector<std::array<int,26>> s;
    std::vector<ll> t;
    ll all;

    explicit AtcoderContestSchedule(void) {
      std::cin >> D;  s.resize(D);  t.resize(D);
      rep(i,26) std::cin >> c[i];
      rep(i,D) rep(j,26) std::cin >> s[i][j];
      rep(i,26) all += c[i];
    }

    int Score( const std::vector<int> &d ) {
      std::vector<int> last(26,0);
      int S = 0;
      rep(i, sz(d)) {
        S += s[i][d[i]-1];
        last[d[i]-1] = i+1;
        rep(j,26) S -= c[j] * ( (i+1) - last[j] );
      }
      return std::max<int>(1e6+S, 0);
    }

    void Print() {
      struct Edge {
        ll to;
        ll cost;
      };

      struct P {
        ll cost;
        int x;
        int y;
        ll c;
        P(ll cost_, int x_, int y_, ll c_) : cost(cost_), x(x_), y(y_), c(c_) { }

        bool operator>(const P& rhs) const {
          return this->cost > rhs.cost;
        }
        bool operator<(const P& rhs) const {
          return this->cost < rhs.cost;
        }
      };

      ll ans[26][26]; rep(i,26) rep(j,26) ans[i][j] = 1e15;
      int path[26][366][26];
      rep(i,26) rep(j,26) path[i][j][0] = 0;
      for(int start=0; start<26; start++) {
        std::vector<std::vector<ll>> cost(D+1, std::vector<ll>(26, 1e15));
        std::priority_queue<P, std::vector<P>, std::greater<P>> pq;
        pq.push( P(0,0,start,0) );
        cost[0][start] = 0;
        while( !pq.empty() ) {
          auto cur = pq.top(); pq.pop();
          auto d = cur.cost;
          auto vx = cur.x;
          auto vy = cur.y;
          auto cc = cur.c;
          if ( cost[vx][vy] < d ) continue;
          if ( vx == D ) continue;
          rep(b,26) {
            Edge e; 
            e.to = b;
            e.cost = -(s[vx][b] - (cc + all - c[b]));
            if ( cost[vx+1][e.to] > cost[vx][vy] + e.cost ) {
              cost[vx+1][e.to] = cost[vx][vy] + e.cost;
              pq.push( P(cost[vx+1][e.to], vx+1, e.to, cc + all - c[b]) );
              path[start][vx+1][e.to] = vy;
            }
          }
        }
        for(int end=0; end<26; end++) ans[start][end] = std::min<ll>(ans[start][end], cost[D][end]);
      }

      ll ansall = 1e15;
      rep(i,26) rep(j,26) ansall = std::min<ll>(ans[i][j], ansall);
      rep(i,26) rep(j,26) {
        if ( ansall != ans[i][j] ) continue;
        t.push_back(j);
        int n = D;
        std::queue<int> q;
        q.push(j);
        while(!q.empty()) {
          int cur = q.front(); q.pop();
          if ( n == 0 ) continue;
          t.push_back( path[i][n][cur] );
          n--;
          q.push(path[i][n][cur]);
        }
        goto FINISH;
      }
FINISH:
      std::reverse( all(t) );
      rep(i,D) std::cout << t[i]+1 << std::endl;
      return;
    }
};

int main (void) {
  std::cin.tie(0);  std::ios::sync_with_stdio(false);
  AtcoderContestSchedule sub;
  sub.Print();
  return 0;
}



Measured memory_bytes: 4808