#!/bin/bash
# your code goes here

cd /tmp
echo 'aaaa' > 1.txt
echo 'bgdgsgbsb' >> 1.txt
echo 'cccc' >> 1.txt
echo 'dddd' >> 1.txt

sed '
/b.*b/ {h;d}
$ {p;g}
' 1.txt