// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)

#define ll long long

#define umap unordered_map

using graph = vector<vector<int>>;

using graph2 = vector<vector<pair<int, int>>>;

#define oorret true //std::out_of_rangeが返された時

#define oor(x) [&](){try{x;} catch(const std::out_of_range& oor){return oorret;} return x;}()

double pi = 3.141592653589793238;

ll mod(ll x, ll y){if(x>=0||x%y==0) return x%y;return y+x%y;} //mod including minus

ll dv0(ll x, ll y){if(x>=0||x%y==0)return x/y;return x/y-1;} //rnd down

ll dv1(ll x, ll y){if(x%y==0) return dv0(x,y);return dv0(x,y)+1;} //rnd up

int D;

void calculate(vector<int> c, vector<vector<int>> s, int contest,int day, vector<int> &t, ll &score){

    ll p=0;

    int a[26];

    rep(i, 26){

        a[i]=0;

    }

    rep(i, D){

        rep(j, 26){

            p-=c[j]*(i+1-a[j]);

        }

        if(i!=day){

            p+=s[i].at(t[i])+c[t[i]]*(i+1-a[t[i]]);

            a[t[i]]=i+1;

        }else{

            p+=s[day].at(contest)+c[contest]*(day+1-a[contest]);

            a[contest]=i+1;

        }

        

    }

    if(score<p){

        score=p;

        t[day]=contest;

    }

}



int main(){

cin>>D;

vector<int> c(26);

rep(i, 26){

    cin>>c[i];

}

vector<vector<int>> s(D);

int r;

rep(i, D){

    rep(j, 26){

        cin>>r;

        s[i].push_back(r);

    }

}

int M2=0,M3=0,M4=0,M5=0,M6=0,M7=0,M8=0;

vector<int> m2(D);

vector<int> m3(D);

vector<int> m4(D);

vector<int> m5(D);

vector<int> m6(D);

vector<int> m7(D);

vector<int> m8(D);

vector<int> a(26);

vector<int> m(D);



rep(i, 26){

    a[i]=0;

}

int M=0;

rep(i, D){

}

vector<int> t(D);



ll score=0;

rep(i, D){

    M=0;

    rep(j, 26){

        score-=c[j]*(i+1-a[j]);

        if(s[i].at(j)+c[j]*(i+1-a[j])>M){

            M8=M7;

            M7=M6;

            M6=M5;

            M5=M4;

            M4=M3;

            M3=M2;

            M2=M;

            M=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=m5[i];

            m5[i]=m4[i];

            m4[i]=m3[i];

            m3[i]=m2[i];

            m2[i]=m[i];

            m[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M2){

            M8=M7;

            M7=M6;

            M6=M5;

            M5=M4;

            M4=M3;

            M3=M2;

            M2=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=m5[i];

            m5[i]=m4[i];

            m4[i]=m3[i];

            m3[i]=m2[i];

            m2[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M3){

            M8=M7;

            M7=M6;

            M6=M5;

            M5=M4;

            M4=M3;

            M3=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=m5[i];

            m5[i]=m4[i];

            m4[i]=m3[i];

            m3[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M4){

            M8=M7;

            M7=M6;

            M6=M5;

            M5=M4;

            M4=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=m5[i];

            m5[i]=m4[i];

            m4[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M5){

            M8=M7;

            M7=M6;

            M6=M5;

            M5=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=m5[i];

            m5[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M6){

            M8=M7;

            M7=M6;

            M6=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=j;

        }

        else if(s[i].at(j)+c[j]*(i+1-a[j])>M7){

            M8=M7;

            M7=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M8){

            M8=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=j;

        }

    }

    score+=M;

    a[m[i]]=i+1;

    t[i]=m[i];

}

rep(j, 30){

rep(i, D){

    calculate(c, s, m2[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m3[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m4[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m5[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m6[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m7[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m8[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m[i], i, t, score);

}

}

rep(i, D){

    cout<<t[i]+1<<endl;

}

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)

#define ll long long

#define umap unordered_map

using graph = vector<vector<int>>;

using graph2 = vector<vector<pair<int, int>>>;

#define oorret true //std::out_of_rangeが返された時

#define oor(x) [&](){try{x;} catch(const std::out_of_range& oor){return oorret;} return x;}()

double pi = 3.141592653589793238;

ll mod(ll x, ll y){if(x>=0||x%y==0) return x%y;return y+x%y;} //mod including minus

ll dv0(ll x, ll y){if(x>=0||x%y==0)return x/y;return x/y-1;} //rnd down

ll dv1(ll x, ll y){if(x%y==0) return dv0(x,y);return dv0(x,y)+1;} //rnd up

int D;

void calculate(vector<int> c, vector<vector<int>> s, int contest,int day, vector<int> &t, ll &score){

    ll p=0;

    int a[26];

    rep(i, 26){

        a[i]=0;

    }

    rep(i, D){

        rep(j, 26){

            p-=c[j]*(i+1-a[j]);

        }

        if(i!=day){

            p+=s[i].at(t[i])+c[t[i]]*(i+1-a[t[i]]);

            a[t[i]]=i+1;

        }else{

            p+=s[day].at(contest)+c[contest]*(day+1-a[contest]);

            a[contest]=i+1;

        }

        

    }

    if(score<p){

        score=p;

        t[day]=contest;

    }

}



int main(){

cin>>D;

vector<int> c(26);

rep(i, 26){

    cin>>c[i];

}

vector<vector<int>> s(D);

int r;

rep(i, D){

    rep(j, 26){

        cin>>r;

        s[i].push_back(r);

    }

}

int M2=0,M3=0,M4=0,M5=0,M6=0,M7=0,M8=0;

vector<int> m2(D);

vector<int> m3(D);

vector<int> m4(D);

vector<int> m5(D);

vector<int> m6(D);

vector<int> m7(D);

vector<int> m8(D);

vector<int> a(26);

vector<int> m(D);



rep(i, 26){

    a[i]=0;

}

int M=0;

rep(i, D){

}

vector<int> t(D);



ll score=0;

rep(i, D){

    M=0;

    M2=0;

    M3=0;

    M4=0;

    M5=0;

    M6=0;

    M7=0;

    M8=0;

    rep(j, 26){

        score-=c[j]*(i+1-a[j]);

        if(s[i].at(j)+c[j]*(i+1-a[j])>M){

            M8=M7;

            M7=M6;

            M6=M5;

            M5=M4;

            M4=M3;

            M3=M2;

            M2=M;

            M=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=m5[i];

            m5[i]=m4[i];

            m4[i]=m3[i];

            m3[i]=m2[i];

            m2[i]=m[i];

            m[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M2){

            M8=M7;

            M7=M6;

            M6=M5;

            M5=M4;

            M4=M3;

            M3=M2;

            M2=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=m5[i];

            m5[i]=m4[i];

            m4[i]=m3[i];

            m3[i]=m2[i];

            m2[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M3){

            M8=M7;

            M7=M6;

            M6=M5;

            M5=M4;

            M4=M3;

            M3=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=m5[i];

            m5[i]=m4[i];

            m4[i]=m3[i];

            m3[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M4){

            M8=M7;

            M7=M6;

            M6=M5;

            M5=M4;

            M4=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=m5[i];

            m5[i]=m4[i];

            m4[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M5){

            M8=M7;

            M7=M6;

            M6=M5;

            M5=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=m5[i];

            m5[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M6){

            M8=M7;

            M7=M6;

            M6=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=m6[i];

            m6[i]=j;

        }

        else if(s[i].at(j)+c[j]*(i+1-a[j])>M7){

            M8=M7;

            M7=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=m7[i];

            m7[i]=j;

        }else if(s[i].at(j)+c[j]*(i+1-a[j])>M8){

            M8=s[i].at(j)+c[j]*(i+1-a[j]);

            m8[i]=j;

        }

    }

    score+=M;

    a[m[i]]=i+1;

    t[i]=m[i];

}

rep(j, 20){

rep(i, D){

    calculate(c, s, m2[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m3[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m4[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m5[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m6[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m7[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m8[i], i, t, score);

}

rep(i, D){

    calculate(c, s, m[i], i, t, score);

}

}

rep(i, D){

    cout<<t[i]+1<<endl;

}

}


// Fastest known solution for this problem: