//設定言語check
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <limits.h>
#include <algorithm>
#include <iomanip>
#include <math.h>
using namespace std;

int main(){
  int D, check = 0, count = 0, scoreA = 0, scoreB = 0, 
                               scoreC = 0, scoreD = 0, maxim = 0 ;
  int C[27] ;
  cin >> D ;
  int S[27][D+1], choiceA[D+1] = {}, choiceB[D+1] = {}, history[27] = {},
                  choiceC[D+1] = {}, choiceD[D+1] = {} ;
  for(int i=1;i<27;i++){
    cin >> C[i] ;
    history[i] = D ;
  }  
  for(int i=1;i<(D+1);i++){
    for(int j=1;j<27;j++){
      cin >> S[j][i] ;
    }
  }
  for(int i=1;i<27;i++){
    history[i] = 0 ;
  }
  for(int date=D;date>0;date--){ //B
    int search = 0, maxi = -1 ;
    for(int i=1;i<27;i++){
      if(maxi <= ( S[i][date] + (history[i] - date) * C[i] * 20 ) ){
        search = i ;
        maxi = S[i][date] + (history[i] - date) * C[i] ;
      }
    }
    choiceB[date] = search ;
    history[search] = date ;
  }
  for(int i=1;i<27;i++){
    history[i] = 0 ;
  }
  for(int date=1;date<(D+1);date++){ //A
    int search = 0, maxi = -1 ;
    for(int i=1;i<27;i++){
      if(maxi <= ( S[i][date] + (date - history[i] ) * C[i] * 20 ) ){
        search = i ;
        maxi = S[i][date] + (date - history[i] ) * C[i] ;
      }
    }
    choiceA[date] = search ;
    history[search] = date ; 
  }
  for(int i=1;i<27;i++){
    history[i] = 0 ;
  }
  for(int date=D;date>0;date--){ //D 
    int search = 0, maxi = -1 ;
    for(int i=1;i<27;i++){
      if(maxi <= ( S[i][date] + (history[i] - date) * C[i] * 10 ) ){
        search = i ;
        maxi = S[i][date] + (history[i] - date) * C[i] * 10 ;
      }
    }
    choiceD[date] = search ;
    history[search] = date ;
  }
  for(int i=1;i<27;i++){
    history[i] = 0 ;
  }
  for(int date=1;date<(D+1);date++){ //C
    int search = 0, maxi = -1 ;
    for(int i=1;i<27;i++){
      if(maxi <= ( S[i][date] + (date - history[i] ) * C[i] * 10 ) ){
        search = i ;
        maxi = S[i][date] + (date - history[i] ) * C[i] * 10 ;
      }
    }
    choiceC[date] = search ;
    history[search] = date ; 
  }
  for(int i=1;i<27;i++){
    history[i] = 0 ;
  }
  for(int date=1;date<(D+1);date++){ //calcu
    history[choiceA[date]] = date ;
    scoreA += S[choiceA[date]][date] ;
    for(int i=1;i<27;i++){
      scoreA -= C[i] * ( date - history[i]) ;
    }
  }
  for(int i=1;i<27;i++){
    history[i] = 0 ;
  }
  for(int date=1;date<(D+1);date++){
    history[choiceB[date]] = date ;
    scoreB += S[choiceB[date]][date] ;
    for(int i=1;i<27;i++){
      scoreB -= C[i] * ( date - history[i]) ;
    }
  }
  for(int i=1;i<27;i++){
    history[i] = 0 ;
  }
  for(int date=1;date<(D+1);date++){
    history[choiceC[date]] = date ;
    scoreC += S[choiceC[date]][date] ;
    for(int i=1;i<27;i++){
      scoreC -= C[i] * ( date - history[i]) ;
    }
  }
  for(int i=1;i<27;i++){
    history[i] = 0 ;
  }
  for(int date=1;date<(D+1);date++){
    history[choiceD[date]] = date ;
    scoreD += S[choiceD[date]][date] ;
    for(int i=1;i<27;i++){
      scoreD -= C[i] * ( date - history[i]) ;
    }
  }
  maxim = scoreA ;
  maxim = max(scoreB, maxim) ;
  maxim = max(scoreC, maxim) ;
  maxim = max(scoreD, maxim) ;
  if(scoreA == maxim){
    for(int date=1;date<(D+1);date++){
      cout << choiceA[date] << endl ;
    }
  }
  else if(scoreB == maxim){
    for(int date=1;date<(D+1);date++){
      cout << choiceB[date] << endl ;
    }
  }
  else if(scoreC == maxim){
    for(int date=1;date<(D+1);date++){
      cout << choiceC[date] << endl ;
    }
  }
  else if(scoreD == maxim){
    for(int date=1;date<(D+1);date++){
      cout << choiceD[date] << endl ;
    }
  }
  return 0 ;
}  

Measured memory_bytes: 3656