These kinds of problems are fun in Befunge because you can just copy the input into your program and it becomes a part of your source code.

The rest is just walking through all possible values and printing the largest