void main() {
  problem();
}

void problem() {
  enum CONTESTS = 26;
  const days = scan!int;
  const dec = scan!long(CONTESTS);
  const inc = days.iota.map!(x => scan!long(CONTESTS)).array;

  long solve() {
    long[CONTESTS] desat;
    long sat;
    long prevSat;

    long decideNextContest(long day, const long[] inc, long[] dec) {
      long contestCanditate;
      long score = long.min;
      const sumDec = dec.sum;

      foreach(c; 0..CONTESTS) {
        long testScore = inc[c] + dec[c] - sumDec;
        if (score < testScore) {
          contestCanditate = c;
          score = testScore;
        }
      }
      return contestCanditate;
    }

    foreach(i; 0..days) {
      auto c = decideNextContest(i, inc[i], desat);
      (c + 1).writeln;

      sat += inc[i][c];
      foreach(o; 0..CONTESTS) {
        desat[o] = c == o ? 0 : desat[o] + dec[o];
        sat -= desat[o];
      }

      deb(["satisfaction", prevSat.to!string, "->", sat.to!string]);
      prevSat = sat;
    }
    
    return sat;
  }

  solve();
}

// ----------------------------------------------

import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");

// -----------------------------------------------
