static boolean nqHelper(int i, boolean[][]u, int[]b, List<String[]>rel) {
		int n=u[0].length;
		if (i==n) {
			String[]s=new String[n];
			char[] row=new char[n];
			Arrays.fill(row, '.');
			for (int k=0;k<n;++k) {
				row[b[k]]='Q';
				s[k]=new String(row);
				row[b[k]]='.';
			}
			rel.add(s);
			return true;
		}
		for (int j=0;j<n;++j) {
			if (u[0][j]||u[1][i+j]||u[2][n-i-1+j])
				continue;
			u[0][j]=u[1][i+j]=u[2][n-i-1+j]=true;
			b[i]=j;
			nqHelper(i+1, u, b, rel);
			u[0][j]=u[1][i+j]=u[2][n-i-1+j]=false;
		}
		return false;
	}