Need help in changing vertical lines to horizontal line in a file

Hi,

I have a file like below

 robert
PREF: 3
AVAIL:
 henry
PREF: 234
AVAIL:
 john
PREF: 145,178
AVAIL: 123
 matt
PREF: 564,932
AVAIL:
 ten 
PREF: 389
AVAIL: kill 

I have sample file like above. My requirement is to get the output like below

robert PREF: 3 AVAIL:
henry PREF: 234 AVAIL:
john PREF: 145,178 AVAIL: 123
matt PREF: 564,932 AVAIL:
ten PREF: 389 AVAIL: kill 

i need every 3 rows in that file to convert as a single row.

Can anyone please help me on this

Thanks.

Try:

awk -vORS=" " 'NR>1&&!((NR-1)%3){printf "\n"}1;END{printf "\n"}' file
paste -d ' ' - - - < file