#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<random>
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;

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;
  }
}

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[state[i]]];
    last[BIT_TABLE[state[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){
  //displayState(state);
  //cout << calcCost(D, state, vec_c, vec_s) << endl;
  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(int D, const State& res){
  for(int i = 0 ; i < D ; i++){
    for(int j = 0 ; j < C_SIZE ; j++){
      if((res[i] >> j)&1) {
        cout << (j+1) << endl;
      }
    }
  }
}

void StateShuffle(const int D, State& state){
  int bit = 1 << rand()%C_SIZE;
  int day = rand()%D;
  state[day] = bit;
}

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(D, state);
        }
        //cout << "display" << endl;
        //displayState(states[i].second);
        candidates.push_back(cstate);
        candidates.push_back(createCostState(D, state, vec_c, vec_s));
      }
    }
    sort(candidates.begin(), candidates.end());
    reverse(candidates.begin(), candidates.end());
    states = candidates;
  }
  return states[0].second;
}

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


Measured memory_bytes: 4012