bw.write("<a href=" + word[0] + ".html>");
...
bw.write(word[1]);
...
bw.write("<a href=" + word[2] + ".html>");
You are writing the same data in every file.
If you are trying to add backward and forward links, then you need to use a simple indexed for loop. You also need to add dummy elements after the last item and before the first one, in order that your forward and backward links do not cause an exception for the last and first items.