/************************************************
Grundlegende Algorithmen mit Java,
http://algorithmen-und-problemloesungen.de/
Copyright @2007-2008 by Doina Logofatu
************************************************/

import java.io.*;
import java.util.*;

public class P02MapColoring {
  private static final String FileInputName = "map.in";
  private static final String FileOutputName = "colors.out";

  public static void main(String[] args) throws IOException {
    Scanner scanner = null;
    PrintStream out = null;
    try {
      scanner = new Scanner(new File(FileInputName));
      if (!scanner.hasNextInt())
        return;
      int n = scanner.nextInt();
      int a[][] = new int[n][n];
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
          if (!scanner.hasNext())
            return;
          a[i][j] = scanner.nextInt();
        }
      }
      int col[] = new int[n];
      col[0] = 0;
      for (int i = 1; i < n; i++) {
        int j = -1;
        boolean ok = false;
        do {
          j++;
          ok = true;
          for (int k = 0; ok && k < i; k++)
            if (1 == a[k][i] && col[k] == j)
              ok = false;
        } while (!ok);
        col[i] = j;
      }
      out = new PrintStream(new File(FileOutputName));
      for (int i = 0; i < n; i++) {
        out.print(col[i] + 1);
        out.print("  ");
      }
    } finally {
      if (scanner != null) scanner.close();
      if (out != null) out.close();
    }
  }
}

