#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;
  v1 = v;
  it++;
  v2 = *it;
  it--;
  it--;
  v0 = *it;

  int l = ci*(v1 - v0);

  rtn = -l*(v2 - v1);
  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;
  v1 = v;
  v2 = *it;
  it--;
  v0 = *it;

  int l = ci*(v1 - v0);

  rtn = l*(v2 - v1);

  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]);
      deltaScrTmp += s[d1][tp];

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

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


  }

};





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

  input();

  init();

  solveClimb();
  output();

;






}


Measured memory_bytes: 4636