In an $n$-element set $S$, several subsets $A_1, A_2, \ldots , A_k$ are distinguished, each consists of at least two, but not all elements of $S$. What is the largest $k$ that it’s possible to write down the elements of $S$ in a row in the order such that we don’t find all of the element of an $A_i$ set in the consecutive elements of the row? 
To solve this problem, we need to determine the largest number \( k \) such that we can order the elements of an \( n \)-element set \( S \) in a row without having all elements of any distinguished subset \( A_i \) appearing consecutively. Each subset \( A_i \) contains at least two but not all elements of \( S \).

We will show that the largest \( k \) is \( n-2 \) by using induction.

### Base Case:
For \( n = 2 \), there are no subsets \( A_i \) that meet the criteria (since each subset must have at least two elements but not all elements of \( S \)). Thus, \( k = 0 \), which is \( n-2 \).

### Inductive Step:
Assume that for a set \( S \) with \( n \) elements, the largest \( k \) is \( n-2 \). We need to show that for a set \( S' \) with \( n+1 \) elements, the largest \( k \) is \( (n+1)-2 = n-1 \).

#### Case 1: There exists an element \( s_i \) that is not part of any 2-element subset.
1. **Subcase 1.1:** \( s_i \) is not in any set \( A_i \).
   - Remove \( s_i \) and any subset \( A_j \) that contains \( s_i \).
   - By the inductive hypothesis, we can order the remaining \( n \) elements such that no subset \( A_j \) (without \( s_i \)) appears consecutively.
   - Insert \( s_i \) somewhere between two elements of \( A_j \). This ensures that \( A_j \) is not consecutive.

2. **Subcase 1.2:** \( s_i \) is in some set \( A_j \).
   - Remove \( s_i \) and the subset \( A_j \).
   - By the inductive hypothesis, we can order the remaining \( n \) elements such that no subset \( A_j \) (without \( s_i \)) appears consecutively.
   - Insert \( s_i \) at one end of the permutation, far from the elements of \( A_j \). This ensures that \( A_j \) is not consecutive.

#### Case 2: Each element \( s_i \) is in some 2-element subset.
1. There must be at least one element \( s_i \) that is in exactly one 2-element subset (otherwise, there would be too many subsets, at least \( n \)).
   - Remove \( s_i \) and the 2-element subset containing \( s_i \).
   - By the inductive hypothesis, we can order the remaining \( n \) elements such that no subset \( A_j \) appears consecutively.
   - Insert \( s_i \) anywhere else far from the other element of the 2-element subset. This ensures that the subset is not consecutive.

By induction, we have shown that the largest \( k \) for an \( n \)-element set \( S \) is \( n-2 \).

The final answer is \( \boxed{ n-2 } \).