//pragma
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

#define YOU using
#define DONT namespace
#define SAY std

YOU DONT SAY;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef pair<int,ll> pil;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define REPP(i,a,b,d) for(int i=a;i<=b;i+=d)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,d) for(int i=a;i>=b;i-=d)
#define REV(i,a,b) REVV(i,a,b,1)

#define FOR(i,a) for(int i=0; i<a; i++)
#define FORD(i,a) for(int i=(int)a-1; i>=0; i--)

#define pb push_back
#define F first
#define S second

const int OO = 1e9;
const ll INF = 1e18;

const int irand(int lo,int hi){
	return ((double)rand()/(RAND_MAX + 1.0)) * (hi-lo+1) + lo;
}

const ll lrand(ll lo,ll hi){
	return ((double)rand()/(RAND_MAX + 1.0)) * (hi-lo+1) + lo;
}

#define getc getchar
template<typename T>
T getnum(){
	int sign = 1;
	T ret = 0;
	char c;

	do{
		c = getc();
	}while(c == ' ' || c == '\n');
	if(c == '-')sign = -1;
	else ret = c-'0';
	while(1){
		c = getc();
		if(c < '0' || c > '9')break;
		ret = 10*ret + c-'0';
	}
	return sign * ret;
}

inline void ini(int& x){
	x = getnum<int>();
}

inline void scani(int& x){
	scanf("%d",&x);
}

//end of macro

const int N = 26;
const int D = 365;

int d;

int c[N];
int s[D][N];

vi ans;
vi ansbest;

int last[N];
int evaluate(const vi& t){
    memset(last, 0, sizeof last);
    int ret = 0;
    FOR(i,t.size()){
        ret += s[i][t[i]];
        last[t[i]] = i+1;

        FOR(j,N){
            ret -= c[j] * (i+1 - last[j]);
        }
    }
    return ret;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #define endl '\n'
    cout.setf(ios::fixed);
    cout.setf(ios::showpoint);
    cout.precision(10);

    cin>>d;
    FOR(i,N)cin>>c[i];
    FOR(i,d){
    	FOR(j,N){
    		cin>>s[i][j];
    	}
    }

    FOR(i,d){
        // bruteforce
        int best = -1, vbest = -OO;
        FOR(j,N){
            ans.pb(j);
            int v = evaluate(ans);
            if(v > vbest){
                vbest = v;
                best = j;
            }
            ans.pop_back();
        }

        ans.pb(best);
    }

    int cbest = evaluate(ans);
    ansbest = ans;
    int cansbest = cbest;

    // hill climb
    REP(i,1,200000){
        int a, b;
        a = irand(0, d-1);
        b = irand(0, N-1);

        swap(ans[a], b);
        int tv = evaluate(ans);
        // cerr << "test " << tv << endl;
        if(tv > cbest){
            cbest = tv;
            if(tv > cansbest){
                cansbest = tv;
                ansbest = ans;
            }
        }else{
            // chance to still do it anyway
            int diff = cbest - tv;
            double ldiff = log(diff);
            ldiff = max(ldiff, 2.0);

            ll ch = lrand(1, (ll)ldiff*i);
            if(ch == 1){ // do
                cbest = tv;
            }else{ // revert
                swap(ans[a], b);
            }
        }
    }

    FOR(i,d){
        cout << ansbest[i]+1 << endl;
    }


    cerr << "final: " << evaluate(ansbest) << endl;

    return 0;
}


Measured memory_bytes: 4008