ffmpeg combine three videos side by side I have three videos s1.mp4,s2.mp4 s3.mp4 and I need to combine three videos side by side I know use hstack but my three videos has different size?

I've found  following commands.It works,but only support two videos.

ffmpeg -i s1.mp4 -i s2.mp4 -filter_complex "[1:v][0:v]scale2ref[wm][base];[base][wm]hstack=2" final.mp4
Use

ffmpeg -i s1.mp4 -i s2.mp4 -i s3.mp4 -filter_complex "[1:v][0:v]scale2ref=oh*mdar:ih[1v][0v];[2:v][0v]scale2ref=oh*mdar:ih[2v][0v];[0v][1v][2v]hstack=3,scale='2*trunc(iw/2)':'2*trunc(ih/2)'" final.mp4