#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define SIZE(x) ((ll)(x).size()) 
#define MAX(x) *max_element(ALL(x)) 
#define MIN(x) *min_element(ALL(x)) 
#define ALL(x) (x).begin(),(x).end() 

#define inf 1000000000000 
#define mod 1000000007 
#define MAXR 100000 

#define PB push_back 
#define MP make_pair 
#define F first 
#define S second 

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
    // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
bool is_prime(ll n){
    int a = sqrt(n);
    if(n == 1 || n == 2 || n == 3) return true;
    else{
        bool frag = true;
        FOR(i, 2, a+1){
            if(n % i == 0) frag = false;
        }
        return frag;
    }
}

struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    vector<int> c(26), ld(26), lld(26), tmp(365), t(365);
    vector<vector<int>> s(365, vector<int>(26));
    int nazo;
    cin >> nazo;
    REP(i, 26) cin >> c[i];
    REP(i, 365) REP(j, 26) cin >> s[i][j];
    REP(i, 365) t[i] = max_element(s[i].begin(), s[i].end()) - s[i].begin() + 1;
    REP(i, 365) tmp[i] = t[i];
    ll m, mm;
    ll f, ff;
    REP(i, 365){
        m += s[i][t[i]-1];
        ld[t[i]-1] = i+1;
        REP(j, 26){
            m -= c[j] * (i+1-ld[j]);
        }
        f += m;
    }
    REP(_, 200000){
        ff = 0;
        REP(i, 26) lld[i]= 0;
        REP(i, 365) tmp[i] = t[i];
        int d = rand() % 26;
        int q = rand() % 365;
        tmp[q] = d+1;
        // New Culc
        REP(i, 365){
            mm += s[i][tmp[i]-1];
            lld[tmp[i]-1] = i+1;
            REP(j, 26){
                mm -= c[j] * (i+1-lld[j]);
            }
            ff += mm;
        }
        if(ff > f){t[q] = d+1;f = ff;}
    }
  REP(i, 365) cout << t[i] << endl;
}


Measured memory_bytes: 3716