Kaitlyn needs 396 m of thread to make a 6 sq inch mat. If she wants to make a 87 sq inch mat, how much thread will she need?