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

typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;

#define rep(i,n) for(int i=0;i<n;i++)
#define repf(i,f,n) for(int i=f;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define ALL(obj) (obj).begin(), (obj).end()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }


const int64_t CYCLES_PER_SEC = 2800000000;

struct Timer {
  int64_t start;
  Timer() { reset(); }
  void reset() { start = getCycle(); }
  void plus(double a) { start -= (a * CYCLES_PER_SEC); }
  inline double get() { return (double)(getCycle() - start) / CYCLES_PER_SEC; }
  inline int64_t getCycle() {
    uint32_t low, high;
    __asm__ volatile ("rdtsc" : "=a" (low), "=d" (high));
    return ((int64_t)low) | ((int64_t)high << 32);
  }
};

class XorShift {
public:
  unsigned int x, y, z, w;
  double nL[65536];

  XorShift()
  {
    init();
  }

  void init()
  {
    x = 314159265; y = 358979323; z = 846264338; w = 327950288;
    double n = 1 / (double)(2 * 65536);
    for (int i = 0; i < 65536; i++) {
      nL[i] = log(((double)i / 65536) + n);
    }
  }
  void setSeed(int seed) {
    x = 314159265; y = 358979323; z = 846264338; w = 327950288 + seed;
    for (int i = 0; i < 500; i++) {
      next();
    }
  }
  inline unsigned int next()
  {
    unsigned int t = x ^ x << 11; x = y; y = z; z = w; return w = w ^ w >> 19 ^ t ^ t >> 8;
  }

  inline double nextLog() {
    return nL[next() & 0xFFFF];
  }

  inline int nextInt(int m)
  {
    return (int)(next() % m);
  }


  int nextInt(int min, int max)
  {
    return min + nextInt(max - min + 1);
  }


  double nextDouble()
  {
    return (double)next() / ((long long)1 << 32);
  }


};



// グローバル変数
Timer timer;
XorShift rnd;

int D;
vector<int> c(26,0);
vector<vector<int>> s;

vector<int> bestState;
int bestScr;
vector<set<int>> date(26);



void input(){
  cin>>D;
  rep(i,26) cin>>c[i];
  s.resize(D, vector<int>(26,0));
  rep(i,D)rep(j,26) cin>>s[i][j];

  bestState.resize(D);
  rep(i,26){
    date[i].insert(0);
    date[i].insert(366);
  }
};

void output(){
  for(auto e:bestState) cout<<e<<endl;
};

int eval(){
  return 1;
}

void init(){
  vector<int> last(26,-1);
  rep(i,D){
    int mxVal = 0;
    int mxIdx = 0;
    rep(j,26){
      if(chmax(mxVal, s[i][j] + c[j]*(i - last[j]))) mxIdx = j;
    }
    bestState[i] = mxIdx + 1;
    last[mxIdx] = i;
    date[mxIdx].insert(i+1);
    // if(i+1 == 333) cout<<"***"<<mxIdx<<endl;
  }
}

int f(set<int> &s, int v, int ci){
  // puts("f");
  // cout<<v<<" "<<ci<<endl;
  // cout<<"f: s.size() = "<<s.size()<<endl;
  int rtn;
  auto it = s.find(v);
  assert(it != s.end());
  int v0,v1,v2,v3;
  v2 = v;
  it++;
  if(it != s.end()) v3 = *it;
  else v3 = 366;
  it--;
  if(it == s.begin()){
    v0 = v1 = 0;
  }else{
    it--;
    v1 = *it;
    if(it == s.begin()) v0 = 0;
    else{
      it--;
      v0 = *it;
    }
  }

  int l1 = ci*(v1 - v0);
  int l2 = ci*(v2 - v0);

  rtn = -( l1*(v2 - v1) + l2*(v3 - v2) );
  s.erase(v);
  return rtn;
}

int g(set<int> &s, int v, int ci){
  // sにvを入れる時のスコア変化
  // puts("g");
  // cout<<v<<" "<<ci<<endl;
  int rtn;
  auto it = s.upper_bound(v);
  int v0,v1,v2,v3;
  v3 = *it;
  it--;
  v1 = *it;
  v2 = v;
  if(it == s.begin()) v0 = 0;
  else{
    it--;
    v0 = *it;
  }

  int l1 = ci*(v1 - v0);
  int l2 = ci*(v2 - v0);

  rtn = l1*(v2 - v1) + l2*(v3 - v2);

  return rtn;
}

void solveClimb(){
  double ti;
  double T;
  double T0 = 100; // 調整する
  double rem;

  // int cnt = 0;


  double TIMELIMIT = 1.98;
  double st = timer.get();

  while(true){
    ti = timer.get();
    // cnt++;
    // cout<<cnt<<endl;

    if(ti > TIMELIMIT){
      // cout<<"break"<<endl;
      break;
    }
    // rem = (TIMELIMIT - ti) / (TIMELIMIT - st);
    // T = rem * T0;

    // 日付を一つ選んでタイプを変える。タイプは全探索
    int d1 = rnd.nextInt(0,D-1);
    // int orgTp = bestState[d1] - 1;
    f(date[bestState[d1]-1], d1+1, c[bestState[d1]-1]);
    int deltaScr = -(INT_MAX-100);

    int newTp = -1;
    rep(tp, 26){
      // int deltaScrTmp = deltaScr;
      int deltaScrTmp = g(date[tp], d1+1, c[tp]);

      if(chmax(deltaScr, deltaScrTmp)) newTp = tp;
    }
    assert(newTp != -1);

    // cout<<deltaScr<<endl;

    bestState[d1] = newTp+1;
    date[newTp].insert(d1+1);

    // if(deltaScr == 0) continue;
    // cout<<deltaScr<<endl;

    // puts("");
    // break;

    // cout<<ti<<" "<<rem<<endl;

  }

};





int main() {
  cout<<fixed<<setprecision(12);

  input();

  init();

  solveClimb();
  output();

  // set<int> a;
  // a.insert(0);
  // auto it = a.lower_bound(2);

  // cout<<(int)(it == a.end())<<" "<<(int)(it == a.begin())<<endl;

;






}


Measured memory_bytes: 4636