description: The city where Mocha lives in is called Zhijiang. There are n+1 villages and 2n-1 directed roads in this city. 
  
  There are two kinds of roads:
  
    * n-1 roads are from village i to village i+1, for all 1≤ i ≤ n-1. 
    * n roads can be described by a sequence a_1,…,a_n. If a_i=0, the i-th of these roads goes from village i to village n+1, otherwise it goes from village n+1 to village i, for all 1≤ i≤ n. 
  
  
  
  Mocha plans to go hiking with Taki this weekend. To avoid the trip being boring, they plan to go through every village exactly once. They can start and finish at any villages. Can you help them to draw up a plan? 
  
  Input
  
  Each test contains multiple test cases. 
  
  The first line contains a single integer t (1 ≤ t ≤ 20) — the number of test cases. Each test case consists of two lines.
  
  The first line of each test case contains a single integer n (1 ≤ n ≤ 10^4) — indicates that the number of villages is n+1.
  
  The second line of each test case contains n integers a_1, a_2, …, a_n (0 ≤ a_i ≤ 1). If a_i=0, it means that there is a road from village i to village n+1. If a_i=1, it means that there is a road from village n+1 to village i.
  
  It is guaranteed that the sum of n over all test cases does not exceed 10^4.
  
  Output
  
  For each test case, print a line with n+1 integers, where the i-th number is the i-th village they will go through. If the answer doesn't exist, print -1.
  
  If there are multiple correct answers, you can print any one of them.
  
  Example
  
  Input
  
  
  2
  3
  0 1 0
  3
  1 1 0
  
  
  Output
  
  
  1 4 2 3 
  4 1 2 3 
  
  Note
  
  In the first test case, the city looks like the following graph:
  
  <image>
  
  So all possible answers are (1 → 4 → 2 → 3), (1 → 2 → 3 → 4).
  
  In the second test case, the city looks like the following graph:
  
  <image>
  
  So all possible answers are (4 → 1 → 2 → 3), (1 → 2 → 3 → 4), (3 → 4 → 1 → 2), (2 → 3 → 4 → 1).
solution: import java.util.*;import java.io.*;import java.math.*;
  public class CF1559C
  {
      static boolean memory = true;
      static long mod = 998244353;
      static long MOD = 1000000007; 
      
      static void ruffleSort(int[] a) {
          int n = a.length;
          ArrayList<Integer> lst = new ArrayList<>();
          for(int i : a)
              lst.add(i);
          Collections.sort(lst);
          for(int i = 0; i < n; i++)
              a[i] = lst.get(i);
      }
  
      static void ruffleSort(long[] a) {
          int n = a.length; 
          ArrayList<Long> lst = new ArrayList<>();
          for(long i : a)
              lst.add(i);
          Collections.sort(lst);
          for(int i = 0; i < n; i++)
              a[i] = lst.get(i);
      }
  
      public static void process()throws IOException
      {
          int n = ni();
          int[] a = nai(n);
          int c = 0, pos = 0;
          for(int i : a){
              if(i == 1)
                  c++;
          }
          if(c == 0){
              for(int i = 0; i <= n; i++)
                  p((i+1)+" ");
              pn("");
              return;
          }
          for(int i = 0; i < n; i++){
              pos = i;
              if(a[i] == 1){
                  p((n+1)+" ");
                  break;
              }
              p((i+1)+" ");
          }
          for(int i = pos; i < n; i++)
              p((i+1)+" ");
          pn("");
      }
     
      static AnotherReader sc;
      static PrintWriter out;
  
      public static void main(String[] args) throws Exception{
          if(memory)new Thread(null, new Runnable() {public void run(){try{new CF1559C().run();}catch(Exception e){e.printStackTrace();System.exit(1);}}}, "1", 1 << 32).start();
          else new CF1559C().run();
      }
  
      void run()throws Exception
      {
          boolean oj = System.getProperty("ONLINE_JUDGE") != null;
          if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}
          else{sc=new AnotherReader(100);out=new PrintWriter("output.txt");}
          long s = System.currentTimeMillis();
          int t=1;
          t=ni();
          //int k = t;
          while(t-->0) {/*p("Case #"+ (k-t) + ": ")*/;process();}
          out.flush();
          System.err.println(System.currentTimeMillis()-s+"ms");
          out.close();
      }
  
      static long power(long k, long c, long mod){
          long y = 1;
          while(c > 0){
              if(c%2 == 1)
                  y = y * k % mod;
              c = c/2;
              k = k * k % mod;
          }
          return y;
      }
  
      static int power(int x, int y, int p){ 
          int res = 1;
          x = x % p;
          while (y > 0) {
              if (y % 2 == 1)
                  res = (res * x) % p;
              y = y >> 1;
              x = (x * x) % p;
          }
          return res;
      }
  
      static int log2(int N)
      {
          int result = (int)(Math.log(N) / Math.log(2));
          return result;
      }
  
   
      static void pn(Object o){out.println(o);}
      static void pn(int[] a){for(int i : a)out.print(i+" ");pn("");}
      static void pn(long[] a){for(long i : a)out.print(i+" ");pn("");}
      static void p(Object o){out.print(o);}
      static void YES(){out.println("YES");}
      static void NO(){out.println("NO");}
      static void yes(){out.println("yes");}
      static void no(){out.println("no");}
      static void p(int[] a){for(int i : a)out.print(i+" ");}
      static void p(long[] a){for(long i : a)out.print(i+" ");}
      static void pni(Object o){out.println(o);out.flush();}
      static int ni()throws IOException{return sc.nextInt();}
      static long nl()throws IOException{return sc.nextLong();}
      static double nd()throws IOException{return sc.nextDouble();}
      static String nln()throws IOException{return sc.nextLine();}
      static String ns()throws IOException{return sc.next();}
      static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}
      static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
      static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
      static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
      static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
      
  /////////////////////////////////////////////////////////////////////////////////////////////////////////
   
      static class AnotherReader{BufferedReader br; StringTokenizer st;
      AnotherReader()throws FileNotFoundException{
      br=new BufferedReader(new InputStreamReader(System.in));}
      AnotherReader(int a)throws FileNotFoundException{
      br = new BufferedReader(new FileReader("input.txt"));}
      String next()throws IOException{
      while (st == null || !st.hasMoreElements()) {try{
      st = new StringTokenizer(br.readLine());}
      catch (IOException  e){ e.printStackTrace(); }}
      return st.nextToken(); } int nextInt() throws IOException{
      return Integer.parseInt(next());}
      long nextLong() throws IOException
      {return Long.parseLong(next());}
      double nextDouble()throws IOException { return Double.parseDouble(next()); }
      String nextLine() throws IOException{ String str = ""; try{
      str = br.readLine();} catch (IOException e){
      e.printStackTrace();} return str;}}
  
  /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  }