All positive divisors of a positive integer $N$ are written on a blackboard. Two players $A$ and $B$ play the following game taking alternate moves. In the firt move, the player $A$ erases $N$. If the last erased number is $d$, then the next player erases either a divisor of $d$ or a multiple of $d$. The player who cannot make a move loses. Determine all numbers $N$ for which $A$ can win independently of the moves of $B$.

[i](4th Middle European Mathematical Olympiad, Individual Competition, Problem 2)[/i]
1. **Initial Setup and Strategy for Perfect Squares:**
   - We need to show that if \( N = n^2 \), then player \( A \) can always win.
   - The divisors of \( N \) are \( 1, d_1, \dots, d_k, n, g_1, \dots, g_k, n^2 \), where \( g_i = \frac{n^2}{d_i} \).
   - Each \( d_i \) is a divisor of \( n \), and thus \( d_i \mid g_i \) for all \( i \).

2. **Partitioning the Divisors:**
   - After \( A \) erases \( N \) in the first move, we can partition the remaining numbers into \( k+1 \) pairs: \( (1, n), (d_1, g_1), \dots, (d_k, g_k) \).
   - For every move of \( B \), \( A \) will erase the remaining number in the chosen pair. This ensures that \( A \) always has a move and will eventually win.

3. **Non-Square Numbers:**
   - We need to show that if \( N \) is not a perfect square, then \( B \) can always win.
   - Consider \( N = p_1^{\alpha_1} p_2^{\alpha_2} \cdots p_k^{\alpha_k} \), where \( k \) is the number of distinct prime factors.
   - If \( N \) is not a perfect square, the number of divisors of \( N \) is even.

4. **Induction on the Number of Prime Factors:**
   - Base Case: For \( k = 1 \), \( N = p_1^{\alpha_1} \). If \( \alpha_1 \) is odd, \( N \) is not a perfect square, and the number of divisors is even.
   - Inductive Step: Assume the statement is true for \( k-1 \) prime factors. Consider \( N = g \cdot p_k^{\alpha_k} \), where \( g \) has \( k-1 \) prime factors.
   - Partition the divisors of \( N \) into sets \( A_0, A_1, \dots, A_{\alpha_k} \), where \( A_i \) contains the divisors of \( g \) multiplied by \( p_k^i \).

5. **Strategy for \( B \):**
   - If \( B \) has a winning strategy for \( A_0 \), he can apply the same strategy to \( A_i \) for all \( i \).
   - Since the number of divisors of \( N \) is even, \( B \) can always force \( A \) into a position where \( A \) has no valid moves.

Conclusion:
- If \( N \) is a perfect square, \( A \) can always win.
- If \( N \) is not a perfect square, \( B \) can always win.

The final answer is \( \boxed{ N } \) must be a perfect square.