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

using namespace std;

typedef long long ll;

typedef long double ld;

typedef vector<ll> vi;

typedef vector<vi> vvi;

#define INF (1e9)



int D = 365;

vi c, ans;

vvi s;



void input() {

  cin >> D;

  c = vi(26);

  s = vvi(D, vi(26));

  for (int i = 0; i < 26; i++) {

    cin >> c[i];

  }

  for (int i = 0; i < D; i++) {

    for (int j = 0; j < 26; j++) {

      cin >> s[i][j];

    }

  }

}



void output() {

  for (int i = 0; i < D; i++) {

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

  }

}



int simulate(vi a, int day) {

  int sum = 0;

  vi last(26, 0);

  for (int i = 0; i <= day; i++) {

    sum += s[i][a[i]];

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

    for (int j = 0; j < 26; j++) {

      sum -= c[j] * (i - last[j] + 1);

    }

  }

  return sum;

  // return max((int)1e6 + sum, 0);

}



int simulate(vi a) { return simulate(a, D - 1); }



void solve() {

  int best = simulate(ans);



  //

  {

    vi a = ans;

    for (int i = 0; i < D; i++) {

      int bst = -INF, idx = 0;

      for (int j = 0; j < 26; j++) {

        a[i] = j;

        int x = simulate(a, i);

        if (x > bst) {

          bst = x;

          idx = j;

        }

      }

      a[i] = idx;

    }

    if (best < simulate(a)) ans = a, best = simulate(ans);

  }



  //

  srand((unsigned)time(NULL));

  int loop = 20;

  bool lastIsNew = true;

  while (loop--) {

    vi a = ans;

    if (!lastIsNew) {

      int change = D / 2;

      while (change--) {

        a[rand() % D] = rand() % 26;

      }

    }



    for (int i = 0; i < D; i++) {

      vi b = a;

      int idx = 0, bst = simulate(b);

      for (int j = 0; j < 26; j++) {

        b[i] = j;

        int x = simulate(b);

        if (x > bst) {

          bst = x;

          idx = j;

        }

      }

      a[i] = idx;

    }



    lastIsNew = false;

    int x = simulate(a);

    if (x > best) {

      best = x;

      ans = a;

      lastIsNew = true;

    }

  }

}



int main() {

  input();

  ans = vi(D, 0);

  solve();

  output();

}


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

using namespace std;

typedef long long ll;

typedef long double ld;

typedef vector<ll> vi;

typedef vector<vi> vvi;

#define INF (1e9)



int D = 365;

vi c, ans;

vvi s;



void input() {

  cin >> D;

  c = vi(26);

  s = vvi(D, vi(26));

  for (int i = 0; i < 26; i++) {

    cin >> c[i];

  }

  for (int i = 0; i < D; i++) {

    for (int j = 0; j < 26; j++) {

      cin >> s[i][j];

    }

  }

}



void output() {

  for (int i = 0; i < D; i++) {

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

  }

}



int simulate(vi a, int day) {

  int sum = 0;

  vi last(26, 0);

  for (int i = 0; i <= day; i++) {

    sum += s[i][a[i]];

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

    for (int j = 0; j < 26; j++) {

      sum -= c[j] * (i - last[j] + 1);

    }

  }

  return sum;

  // return max((int)1e6 + sum, 0);

}



int simulate(vi a) { return simulate(a, D - 1); }



void solve() {

  int best = simulate(ans);



  //

  {

    vi a = ans;

    for (int i = 0; i < D; i++) {

      int bst = -INF, idx = 0;

      for (int j = 0; j < 26; j++) {

        a[i] = j;

        int x = simulate(a, i);

        if (x > bst) {

          bst = x;

          idx = j;

        }

      }

      a[i] = idx;

    }

    if (best < simulate(a)) ans = a, best = simulate(ans);

  }



  //

  srand((unsigned)time(NULL));

  int loop = 1000;

  while (loop--) {

    vi a = ans;

    int change = D / 2;

    while (change--) {

      int idx = rand() % (D - 1);

      int tmp = a[idx + 1];

      a[idx + 1] = a[idx];

      a[idx] = tmp;

    }



    int x = simulate(a);

    if (x > best) {

      best = x;

      ans = a;

    }

  }

}



int main() {

  input();

  ans = vi(D, 0);

  solve();

  output();

}


// Fastest known solution for this problem: