In every row of a grid $100 \times n$ is written a permutation of the numbers $1,2 \ldots, 100$. In one move you can choose a row and swap two non-adjacent numbers with difference $1$. Find the largest possible $n$, such that at any moment, no matter the operations made, no two rows may have the same permutations.
1. **Graph Construction**: Construct an undirected graph \( G \) with \( 100! \) vertices, each representing a permutation of the numbers \( 1, 2, \ldots, 100 \). Connect two vertices \( \tau_1 \) and \( \tau_2 \) if it is possible to convert \( \tau_1 \) into \( \tau_2 \) by swapping two non-adjacent numbers with a difference of 1.

2. **String Assignment**: For each permutation \( \tau \), assign a unique string \( S(\tau) = s_1s_2 \dots s_{99} \) of length 99, consisting of characters \( \{<, >\} \). The string \( S(\tau) \) is defined such that the statements:
   \[
   \tau_i ~~s_i ~~\tau_{i+1}
   \]
   are true for \( 1 \leq i \leq 99 \).

3. **Claim 1**: If \( u \) and \( v \) are connected in \( G \), then \( S(u) = S(v) \).

   **Proof**: Suppose we swap numbers \( m \) and \( m+1 \) to convert \( u \) into \( v \). Since \( m \) is surrounded by numbers either \( \geq m+2 \) or \( \leq m-1 \), changing \( m \) to \( m+1 \) does not affect \( S(v) \) in that character. Similarly, since \( m+1 \) is surrounded by numbers either \( \geq m+2 \) or \( \leq m-1 \), \( S(v) \) remains unchanged. This uses the fact that \( m \) and \( m+1 \) are not adjacent. \(\blacksquare\)

4. **Connected Components**: It follows that over each connected component of \( G \), the string \( S(u) \) is fixed. We next show that any two permutations \( \tau_1 \) and \( \tau_2 \) with the same \( S \)-value are in the same connected component.

5. **Algorithm for Permutation Construction**: For each string \( s_1s_2\dots s_{99} \in \{<, >\}^{99} \), assign a permutation \( \tau(s) \) using the following algorithm:
   - Step 1: Initialize a variable \( n = 1 \).
   - Step 2: Consider the longest string of \( > \) characters. Suppose it has length \( m \) (this may be zero).
   - Step 3: Assign the next \( m+1 \) values unassigned to \( \tau \) (in left to right order) the values \[m+n, m+n-1, \dots, n\]
   - Step 4: Replace \( n \) with \( n+m+1 \). If \( n \geq 101 \), stop. Otherwise, go to Step 2.

6. **Validity of Algorithm**: The above algorithm creates a valid permutation with its \( S \)-value being \( s_1s_2 \dots s_{99} \).

7. **Conversion to Target Permutation**: Show that each permutation \( \sigma \) of \( [100] \) can be converted to \( \tau\left(S(\sigma)\right) \) after a sequence of operations. Fix any permutation \( \sigma \) and consider the following:
   - If there are two integers \( m \) and \( m+1 \) such that \( m+1 \) appears before \( m \) in \( \sigma \) and are not adjacent, swap them.
   - Else, stop.

8. **Termination of Process**: The above process cannot go on indefinitely. If it did, some number in \( [100] \) would move back infinitely often, which is impossible since there are only 100 places it could have been in. Thus, we stop at some stage and \( \sigma \) becomes some new permutation \( \sigma' \).

9. **Claim 2**: \( \sigma' \equiv \tau\left(S(\sigma)\right) \).

   **Proof**: We will use induction. Let the location of \( 1 \) in the permutation \( \sigma' \) be in the \( i \)-th position. Now \( 2 \) is either after \( 1 \) or before \( 1 \). Suppose \( 2, 3, \dots, m \) all lie to the left of \( 1 \) consecutively with \( m \) maximal. We show that \( \sigma' \) starts with \( m \) and thus we may induct down to the permutation after \( 1 \) by shifting all the values down by \( m \). Suppose there are numbers before \( m \) and let \( n \) be the smallest among them. Then \( n-1 \) lies to the right of the \( [m, \dots, 1] \) block and we could have swapped \( n \) for \( n-1 \); a contradiction. Thus, we can induct down and prove the claim. \(\blacksquare\)

10. **Conclusion**: With the two claims in hand, it is clear that each connected component of \( G \) is described by the string value each vertex has. It follows that the number of connected components of \( G \) is the number of strings in \( \{<, >\}^{99} \), which is \( 2^{99} \).

The final answer is \( \boxed{ 2^{99} } \).