#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

int used[26];
int last[26];

unsigned Rand(){ 
	static unsigned x=123456789;
	static unsigned y=362436069;
	static unsigned z=521288629;
	static unsigned w=88675123; 
	unsigned t=x^(x<<11);
	x=y; y=z; z=w;
 
	return w=(w^(w>>19))^(t^(t>>8));
}


class IHC{
public:
	vector<int> solve(int _D, vector<int> _c, vector<vector<int>> _s){
		init(_D,_c,_s);

		//geneRes();
        //greedy();
        greedy2();
		int score = calcScore(res);
//		cerr << "score: " << score << endl;

		return makeSolution(res);
	}
		
private:
	int D;
	vector<int> c;
	vector<vector<int>> s;
	vector<int> res;

    void greedy2(void){
        rep (i, D / 26 + 1){
            vector<P> sorted; sorted.clear();
            for (int d = 26 * i; d < 26 * i + 26 && d < D; d++){
                rep (j, 26){
                    sorted.push_back(P(-s[d][j], d * 100 + j));
                } // end rep
            } // end for
            sort(ALL(sorted));
            memset(used, -1, sizeof(used));
            rep (j, 26){
                P curr = sorted[j];
                int d = curr.second / 100;
                int ind = curr.second % 100;
                if (used[ind] == -1){
                    used[ind] = d;
                    res[d] = ind;
                } // end if
            } // end rep
            for (int d = 26 * i; d < 26 * i + 26 && d < D; d++){
                if (res[d] == -1){
              	    int maxV = 0;
            	    int ind = -1;
            	    rep (j, 26){
            	        if (used[j] == -1 && s[d][j] > maxV){
            	            maxV = s[d][j];
            	            ind = j;
            	        } // end if
            	    } // end rep
            	    res[d] = ind;
            	} // end if                  
            } // end for
         }
    }

	void greedy(void){
		vector<P> sorted; sorted.clear();
		rep (i, D){
			rep (j, 26){
				sorted.push_back(P(-s[i][j], i * 100 + j));
			} // end rep
		} // end rep
		sort(ALL(sorted));
		memset(used, -1, sizeof(used));
		rep (i, D){
			P curr = sorted[i];
			int d = curr.second / 100;
			int index = curr.second % 100;
			used[index] = d;
			res[d] = index;
		} // end rep

        	rep (i, D){
            	if (res[i] == -1){
            	    int maxV = 0;
            	    int ind = -1;
            	    rep (j, 26){
            	        if (s[i][j] > maxV){
            	            maxV = s[i][j];
            	            ind = j;
            	        } // end if
            	    } // end rep
            	    res[i] = ind;
            	} // end if
        	} // end rep
	}

	int calcScore(vector<int> res){

		int sat = 0;
		memset(last, 0, sizeof(last));
		rep (d, D){
			int j = res[d];
			last[j] = d + 1;
			rep (i, 26){
				sat -= (d + 1 - last[i]) * c[i];
			} // end rep
			sat += s[d][j];
		} // end rep
		cerr << "sat: " << sat << endl;
		int score = max(0, (int)1e6 + sat);
		cerr << "score: " << score << endl;

		return score;
	}

	vector<int> makeSolution(vector<int> res){
		vector<int> ret(D, 0);
		rep (i, D){
			ret[i] = res[i] + 1;
		} // end rep
		return ret;
	}

	void geneRes(void){
		memset(used, -1, sizeof(used));
		rep (i, D){
			res[i] = Rand() % 26;
			used[res[i]] = i;
		} // end rep
	}

	void init(int _D, vector<int> _c, vector<vector<int>> _s){
		D = _D;
		c = _c;
		s = _s;
		res.clear(); res.resize(D, -1);
	}
};

int main()
{
	IHC ihc;

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int D; cin >> D;
	vector<int> c(26, 0);
	rep (i, 26){
		cin >> c[i];
	} // end rep
	vector<vector<int>> s(D, vector<int>(26, 0));
	rep (i, D){
		rep (j, 26){
			cin >> s[i][j];
		} // end rep
	} // end rep

	vector<int> ret = ihc.solve(D,c,s);
	rep (i, (int)ret.size()){
		cout << ret[i] << endl;
	} // end rep

	return 0;
}


Measured memory_bytes: 3848