calculating all values in the given input file, using version for traverse, writing result to console.