To create a test case generator for the "Iron Bars" problem, we need to generate the input format that matches the constraints and structure of the problem statement. Below is a Python function that generates random valid input for this problem:

```python
import random

def tcgen():
    # Constants for constraints
    N_min, N_max = 6, 6000
    L_min, L_max = 1, 6000
    B_min, B_max = 1, 3000

    # Randomly generate N and M such that 0 ≤ M ≤ N and 6 ≤ N ≤ 6000
    N = random.randint(N_min, N_max)
    M = random.randint(0, N)

    # X and Y must satisfy the equation 2X + Y = 12
    X_options = [x for x in range(7) if (12 - 2*x) <= (N - x) and (12 - 2*x) >= 0 and x <= M]
    if not X_options:
        return tcgen()  # Retry if no valid X options found

    X = random.choice(X_options)
    Y = 12 - 2 * X

    # Generate N lengths for the bars (1 ≤ a_i ≤ 6000)
    lengths = [random.randint(L_min, L_max) for _ in range(N)]

    # Generate M bend positions for the first M bars (1 ≤ b_i ≤ 3000 and 1 ≤ a_i - b_i ≤ 3000)
    bends = [random.randint(B_min, min(L_max, lengths[i] - B_min)) for i in range(M)]

    # Prepare the input format
    input_data = f"{N} {M} {X} {Y}\n"
    input_data += "\n".join(map(str, lengths)) + "\n"
    input_data += "\n".join(map(str, bends)) + "\n"

    return input_data

# Example usage
print(tcgen())
```

### Explanation

1. **Constraints**: Ensure that the generated values for `N`, `M`, `X`, and `Y` respect the problem's constraints.
    - \(N\) is between 6 and 6000.
    - \(M\) is between 0 and \(N\).
    - \(X\) and \(Y\) must satisfy \(2X + Y = 12\).
    - \(X\) must be less than or equal to `M`.
    - \(X\) and \(Y\) must sum up to less than or equal to `N`.

2. **Lengths of Bars**: Each bar length \(a_i\) is between 1 and 6000.

3. **Bend Positions**: For the first \(M\) bars, generate a bend position \(b_i\) such that \(1 \leq b_i \leq 3000\) and \(1 \leq a_i - b_i \leq 3000\).

4. **Input Format**: Combine all the generated values in the specified input format.

This generator will create random, valid test cases for the "Iron Bars" problem. You can run the `tcgen` function to generate a new test case each time.