There are N ordered integer quadruples (a,b,c,d) subject to 0≤a,b,c,d≤99990 such that ad−bc≡1(mod99991). What are the last three digits of N?

brilliant problem, don't answer.