There is a stone on each square of $n\times n$ chessboard. We gather $n^2$ stones and distribute them to the squares (again each square contains one stone)  such that any two adjacent stones are again adjacent. Find all distributions such that at least one stone at the corners remains at its initial square. (Two squares are adjacent if they share a common edge.)
1. **Understanding the Problem:**
   We start with an \( n \times n \) chessboard where each square initially contains one stone. We need to redistribute these stones such that each square again contains one stone, and any two stones that were adjacent in the initial configuration remain adjacent in the new configuration. Additionally, at least one stone at the corners must remain in its initial square.

2. **Analyzing the Constraints:**
   - Each stone must remain adjacent to its initially adjacent stones.
   - At least one corner stone must remain in its initial position.

3. **Case Analysis:**
   - **Case \( n = 1 \):**
     For a \( 1 \times 1 \) chessboard, there is only one stone and one square. The stone must remain in its initial position. Thus, there is only one possible distribution.
     \[
     \boxed{1}
     \]

   - **Case \( n = 2 \):**
     For a \( 2 \times 2 \) chessboard, the stones are initially placed as follows:
     \[
     \begin{array}{|c|c|}
     \hline
     A & B \\
     \hline
     C & D \\
     \hline
     \end{array}
     \]
     To satisfy the adjacency condition, the stones must remain in their initial positions. Thus, there is only one possible distribution.
     \[
     \boxed{1}
     \]

   - **Case \( n = 3 \):**
     For a \( 3 \times 3 \) chessboard, the stones are initially placed as follows:
     \[
     \begin{array}{|c|c|c|}
     \hline
     A & B & C \\
     \hline
     D & E & F \\
     \hline
     G & H & I \\
     \hline
     \end{array}
     \]
     The stones must remain adjacent to their initial neighbors. The only possible distributions are rotations and reflections of the initial configuration. There are 8 such configurations (4 rotations and 4 reflections).
     \[
     \boxed{8}
     \]

   - **Case \( n = 4 \):**
     For a \( 4 \times 4 \) chessboard, the stones are initially placed as follows:
     \[
     \begin{array}{|c|c|c|c|}
     \hline
     A & B & C & D \\
     \hline
     E & F & G & H \\
     \hline
     I & J & K & L \\
     \hline
     M & N & O & P \\
     \hline
     \end{array}
     \]
     The stones must remain adjacent to their initial neighbors. The only possible distributions are rotations and reflections of the initial configuration. There are 8 such configurations (4 rotations and 4 reflections). However, since \( n \) is even, we need to consider the additional constraint that at least one corner stone remains in its initial position. This reduces the number of valid configurations to 3.
     \[
     \boxed{3}
     \]

4. **Generalizing the Result:**
   - For odd \( n > 1 \), the number of valid distributions is 8.
   - For even \( n \), the number of valid distributions is 3.