#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;

const int MAX_D = 365;
const int C_SIZE = 26;

typedef vector<int> State;
typedef pair<int, State>CostState;

map<int,int> BIT_TABLE;

unsigned int seed128[4];

inline void init_xorshift(unsigned int s){
  for (unsigned int i=0;i<4;++i) seed128[i]=s=1812433253U*(s^(s>>30))+i;
}

inline unsigned int xorshift128(){
  unsigned int *a = seed128;
  unsigned int  t = (a[0]^(a[0]<<11));
  a[0]=a[1]; a[1]=a[2]; a[2]=a[3];
  return( a[3]=(a[3]^(a[3]>>19))^(t^(t>>8)) );
}

int decreaseSatisfaction(const vector<int>&vec_c, vector<int>&last,  int d) {
  int res = 0;
  for(int i = 0 ; i < C_SIZE ; i++){
    res += vec_c[i] * (d - last[i]);
  }
  return res;
}

int calcCost(const int D, State state, const vector<int>& vec_c, const vector<vector<int> >vec_s){
  int res = 0;
  vector<int>last;
  for(int i = 0 ; i < C_SIZE ; i++){
    last.push_back(0);
  }

  for(int i = 0 ; i < D ; i++){
    res += vec_s[i][BIT_TABLE[i]];
    last[BIT_TABLE[i]] = i;
    res -= decreaseSatisfaction(vec_c, last, i);
  }
  return res;
}

CostState createCostState(const int D, State state, const vector<int>& vec_c, const vector<vector<int> >vec_s){
  return CostState(calcCost(D, state, vec_c, vec_s),state);
}

void input(int& D, vector<int>&vec_c, vector<vector<int> >& vec_s){
  cin >> D;
  for(int i = 0 ; i <  C_SIZE ; i++){
    int c; cin >> c; vec_c.push_back(c);
  }
  for(int i = 0 ; i < D ; i++){
    vector<int>vec;
    for(int j = 0 ; j < C_SIZE ; j++){
      int s; cin >> s;
      vec.push_back(s);
    }
    vec_s.push_back(vec);
  }
}

void init(const int D, State& state){
  for(int i = 0 ; i < D ; i++){
    int bit = 0;
    for(int j = 0 ; j < C_SIZE ; j++){
      if(i%C_SIZE == j){
        bit = (1 << j);
      }
    }
    state.push_back(bit);
  }
  for(int i = 0 ; i < C_SIZE ; i++){
    BIT_TABLE[(1 << i)] = i+1;
  }
}

void output(const State& res){
  for(int i = 0 ; i < res.size() ; i++){
    for(int j = 0 ; j < C_SIZE ; j++){
      if((res[i] >> j)&1) {
        cout << (j+1) << endl;
      }
    }
  }
}

string createBits(int num){
  string ret;
  for(int i = 0 ; i < C_SIZE; i++){
    if((num >> i)&1){
      ret += '1';
    }
    else {
      ret += '0';
    }
  }
  return ret;
}

void displayState(State state){
  for(int i = 0 ; i < state.size() ; i++){
    cout << createBits(state[i]) << endl;
  }
}

void StateShuffle(State& state){
  int pos1 = xorshift128()%C_SIZE;
  int pos2 = xorshift128()%C_SIZE;
  swap(state[pos1],state[pos2]);
}

State solve(const int D, const vector<int>& vec_c, const vector<vector<int> >vec_s){
  vector<vector<int> > res;
  State state;
  init(D, state);
  const int SHUFFLE_COUNT = 50;
  const int GENERATE_COUNT = 10;
  const int LIMIT = 10;
  const int TURN = 10;

  vector<CostState>states;
  states.push_back(createCostState(D, state, vec_c, vec_s));

  for(int i = 0 ; i < TURN ; i++){
    vector<CostState>candidates;
    for(int j = 0 ; j < states.size() && j < LIMIT; j++) {
      for(int k = 0 ; k < GENERATE_COUNT ; k++){
        CostState cstate = states[j];
        State state = cstate.second;
        for(int l = 0 ; l < SHUFFLE_COUNT ;  l++){
          StateShuffle(state);
        }
        candidates.push_back(cstate);
        candidates.push_back(createCostState(D, state, vec_c, vec_s));
      }
    }
    sort(candidates.begin(), candidates.end());
    states = candidates;
  }
  return state;
}

int main(){
  int D;
  vector<int>vec_c;
  vector<vector<int> >vec_s;
  input(D, vec_c, vec_s);
  output(solve(D, vec_c, vec_s));
  return 0;
}


Measured memory_bytes: 4072