#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 2000000000
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)



#define MAX_TIME 1.97

const int N = 26;

int D, C[33], S[33][444];

uint8_t a[444], best[444];


class _timer_t {
public:
  _timer_t() : st_(gettime()) {};

private:
  inline unsigned long long rdtsc()
  {
#ifdef __amd64
    unsigned long long a, d;

    __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));

    return (d << 32) | a;
#else
    unsigned long long x;

    __asm__ volatile ("rdtsc" : "=A" (x));

    return x;
#endif
  };

  inline double gettime()
  {
#ifndef LOCAL
    return rdtsc() / 3000000000.0;
#else
    return rdtsc() / 2500000000.0;
#endif
  };

public:
  inline double elapsed(double st) {
    return gettime() - st;
  };

  inline double operator()() {
    return elapsed(st_);
  };

private:
  double st_;
} timer;


template<class T>
class xor128_t {
};

template<>
class xor128_t<uint32_t> {
public:
  xor128_t() {
    uint32_t seed = 0;
  
    x_ = seed = 1812433253U * (seed ^ (seed >> 30)) + 1;
    y_ = seed = 1812433253U * (seed ^ (seed >> 30)) + 2;
    z_ = seed = 1812433253U * (seed ^ (seed >> 30)) + 3;
    w_ = seed = 1812433253U * (seed ^ (seed >> 30)) + 4;
  };

public:
  inline uint32_t operator()() {
    uint32_t t;

    t = x_ ^ (x_ << 11);

    x_ = y_;
    y_ = z_;
    z_ = w_;

    return w_ = w_ ^ (w_ >> 19) ^ (t ^ (t >> 8));
  };

public:
  inline static uint64_t max() {
    return UINT32_MAX;
  };

private:
  uint32_t x_;
  uint32_t y_;
  uint32_t z_;
  uint32_t w_;
};

template<>
class xor128_t<uint64_t> {
public:
  inline xor128_t() : s0_(1), s1_(2) {};

public:
  inline uint64_t operator()() {
    uint64_t s1 = s0_;
    uint64_t s0 = s0_ = s1_;

    s1 ^= s1 << 23;
    s1 ^= s1 >> 17;
    s1 ^= s0;
    s1 ^= s0 >> 26;

    return s0_ + (s1_ = s1);
  };

public:
  inline static uint64_t max() {
    return UINT64_MAX;
  };

private:
  uint64_t s0_;
  uint64_t s1_;
};


xor128_t<uint32_t> rng, rng2;


template<class T>
class runif_t {
public:
  inline double operator()() const {
    return rng() / (xor128_t<T>::max() + 1.0);
  };
};


runif_t<uint32_t> runif;


int score(uint8_t* a)
{
  int s = 0;

  int dp[33];

  memset(dp, -1, sizeof(dp));

  for (int d = 0; d < D; d ++) {
    uint8_t x = a[d];
    
    dp[x] = d;
    
    for (int i = 0; i < N; i ++)
      s -= (d - dp[i]) * C[i];
    
    s += S[x][d];
  }

  assert(s < INF);
  
  return s;
}


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  std::cin >> D;

  for (int i = 0; i < N; i ++)
    std::cin >> C[i];

  for (int j = 0; j < D; j ++)
    for (int i = 0; i < N; i ++)
      std::cin >> S[i][j];

  // Initial solution

  for (int d = 0; d < D; d ++) {
    int ip = -1, sp = -1, s;

    for (int i = 0; i < N; i ++)
      if ((s = S[i][d]) > sp) {
        sp = s;
        ip = i;
      }
    
    a[d] = ip;
  }

  memcpy(best, a, sizeof(a));

  int s = score(best), sp = s, C = 0;

  for ( ; ; C ++) {
    double et = timer(), perc = et / MAX_TIME;
    
    if (et > MAX_TIME)
      break;

    double Tinv = 1.0 / (4.0 * exp(- perc * 24.0) + 1.0);

    int d = rng() % D, i = rng() % 25, a0 = a[d];

    if (i == a0)
      i ++;

    a[d] = i;

    int ss = score(a), ds = ss - s;

#ifdef DEBUG
    if (runif() < 0.001)
      std::cerr << "C=" << C << " s=" << s << std::endl;
#endif

    double x;
    
    if (ds >= 0 || (((x = ds * Tinv) > -6.0) && runif() < exp(-x))) {
#ifdef DEBUG
      std::cerr << "C=" << C << " s=" << s << '*' << std::endl;
#endif

      if (ss > sp) {
        memcpy(best, a, sizeof(a));

        sp = ss;
      }
      
      s = ss;
    }
    else {
      a[d] = a0;
    }
  }

  std::cerr << "C=" << C << " sp=" << sp << std::endl;

  for (int d = 0; d < D; d ++)
    std::cout << best[d] + 1 << std::endl;

  return 0;
}


Measured memory_bytes: 3824