How can I use scripting for a different pattern

HI,

I have a log file with data in the following way:

xyz....xyz...xyz.... id=aaaa

type=apple
type=mango

xyz...xyz...xyz.....id=bbbb

type=apple

xyz....xyz...xyz....id=cccc

type=apple
type=mango
type=lemon
..............and goes on....

How can I use these patterns to get as the following pattern?
aaaa apple
aaaa mango
bbbb apple
cccc apple
cccc mango
cccc lemon
......and goes on...

I have thousands of lines to read in this manner.
Can anyone give an idea to resolve this?

Something like this:

awk -F= '/id=/{s=$NF}/type=/{print s, $NF}' file

Regards