#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd_(ll a,ll b){if(a%b==0)return b;return gcd_(b,a%b);}
ll lcm_(ll a,ll b){ll c=gcd_(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))
//tie(a,b,c) = make_tuple(10,9,87);
#define pop_(a) __builtin_popcount((a))
ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}




ll sum_(ll x,ll y){
  return (y-x-1)*(y-x)/2;
}

int main(){
  chrono::system_clock::time_point start, end;
  start = chrono::system_clock::now();
  mt19937 mt(1);
  uniform_real_distribution<double> rnd(0.00,1.00);

  ll D;
  cin >> D;
  vector<ll> c(26);
  FOR(i,0,26) cin >> c[i];
  vector<ll> last(26,0),s(26);
  vector<vector<ll>> S;
  vector<ll> t_(D);

  FOR(i,0,D){
    FOR(j,0,26){
      cin >> s[j];
    }
    S.push_back(s);
  }

  ll ans = 0;

  //FOR(i,0,D) cin >> t_[i];
  
  FOR(i,0,D){

    //FOR(j,0,26) cin >> s[j];
    ll score=-INF,res;
    ll sc = 0;
    FOR(j,0,26){
      sc -= c[j]*(i+1-last[j]);
    }
    FOR(j,0,26){
      ll sc_j = c[j]*(i+1-last[j]) + s[j];
      if(sc+sc_j >= score){
        score = sc + sc_j;
        res = j;
      }
    }
    last[res] = i+1;
    //cout << res+1 << endl;
    t_[i] = res+1;
    ll t = res+1;
    ans += S[i][t-1];
    last[t-1] = i+1;
    FOR(j,0,26){
      ans -= c[j] * (i+1 - last[j]);
    }
    //cout << ans << endl;
  }



  vector<set<ll>> use(26);//日にち
  FOR(i,0,26){
    use[i].insert(0);
    use[i].insert(D+1);
  }
  FOR(i,0,D){
    use[t_[i]-1].insert(i+1);
  }


  double T = 1e10;
  double R = 0.97;


  while(1){
    end = chrono::system_clock::now();
    double time = static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0);
    if(time >= 1970.0)break;

    ll d,q,b;
    //cin >> d >> q;
    d = (mt() % D) + 1;
    q = (mt() % 26) + 1; 


    b = t_[d-1];
    t_[d-1] = q;
    
    ll deff = S[d-1][q-1]-S[d-1][b-1];
    use[b-1].erase(d);
    use[q-1].insert(d);

    auto br = use[b-1].upper_bound(d);
    auto bl = use[b-1].upper_bound(d);
    bl--;

    auto qr = use[q-1].upper_bound(d);
    auto ql = use[q-1].upper_bound(d);
    ql--;ql--;

    deff += (sum_(*bl,d)+sum_(d,*br))*c[b-1];
    deff += sum_(*ql,*qr)*c[q-1];

    deff -= (sum_(*ql,d)+sum_(d,*qr))*c[q-1];
    deff -= sum_(*bl,*br)*c[b-1]; 

    //ans += deff;

    if(deff > 0 || rnd(mt)<=exp(deff/T) ){
      ans += deff;
      T *= R;
    }else{
      t_[d-1] = b;
      use[b-1].insert(d);
      use[q-1].erase(d);
    }


    //cout << ans << endl;
  }

  FOR(i,0,D){
    cout << t_[i] << endl;
  }

}



Measured memory_bytes: 4340