private void put(ArrayList<String[]> res, int level) {
		if (level == n) {
			String[] sol = new String[n];
			for (int i = 0; i < n; i++) {
				char[] line = new char[n];
				for (int j = 0; j < n; j++) {
					if (j == selection[i])
						line[j] = 'Q';
					else
						line[j] = '.';
				}
				sol[i] = String.copyValueOf(line);
			}
			res.add(sol);
			return;
		}
		for (int i = 0; i < n; i++) {
			if (orth[i] == false && orth[level+n] == false
				&& diag[i+level] == false && diag[i-level + 3*n] == false) {
				orth[i] = true;
				orth[n+level] = true;
				diag[i+level] = true;
				diag[i-level + 3*n] = true;
				selection[level] = i;
				put(res, level+1);
				orth[i] = false;
				orth[n+level] = false;
				diag[i+level] = false;
				diag[i-level + 3*n] = false;
			}
		}
	}