I have a file of the form:

```
Heading1 Heading2 A1 A2 B1 B2 
Heading3 Heading4 A3 A4 B3 B4 C1 C2

```

etc

Each lines contains multiple records belonging to the same headers. What I'm trying to do is split these records preserving their headings. In the example above I would like to produce the following:

```
Heading1 Heading2 A1 A2
Heading1 Heading2 B1 B2 
Heading3 Heading4 A3 A4
Heading3 Heading4 B3 B4
Heading3 Heading4 C1 C2

```

My main problem is that the number of records per line is not constant.

**Edit:** Every line has 2 headings and N number of records each one of them is represented with 2 fields. So the general form of lines' length is 2+2\*N. So it is always even