Input strings directly
Use a set for faster lookups
Detect non-degree-32 polynomials
Generate tables for improper polynomials
Use map()
Python 3 support
No need to trim the input file...