m=n 
FindPic leftx,upy,rightx,downy,number2,Similar,fx,fy
If fx>=0 and fy>=0 
n=n+1 
leftx=fx+1 
a(n)=fx 
b(n)=2 
EndIf 
wend 
leftx=lx 
m=m-1 
While n<>m 
m=n 
FindPic leftx,upy,rightx,downy,number3,Similar,fx,fy
If fx>=0 and fy>=0 
n=n+1 
leftx=fx+1 
a(n)=fx 
b(n)=3 
EndIf 
wend 
leftx=lx 
m=m-1 
While n<>m 
m=n 
FindPic leftx,upy,rightx,downy,number4,Similar,fx,fy
If fx>=0 and fy>=0 
n=n+1 
leftx=fx+1 
a(n)=fx 
b(n)=4 
EndIf 
wend 
leftx=lx 
m=m-1 
While n<>m 
m=n 
FindPic leftx,upy,rightx,downy,number5,Similar,fx,fy
If fx>=0 and fy>=0 
n=n+1 
leftx=fx+1 
a(n)=fx 
b(n)=5 
EndIf 
wend 
leftx=lx 
m=m-1 
While n<>m 
m=n 
FindPic leftx,upy,rightx,downy,number6,Similar,fx,fy 
If fx>=0 and fy>=0 
n=n+1 
leftx=fx+1 
a(n)=fx 
b(n)=6 
EndIf 
wend 
leftx=lx 
m=m-1 
While n<>m 
m=n 
FindPic leftx,upy,rightx,downy,number7,Similar,fx,fy 
If fx>=0 and fy>=0 
n=n+1 
leftx=fx+1 
a(n)=fx 
b(n)=7 
EndIf 
wend 
leftx=lx 
m=m-1 
While n<>m 
m=n 
FindPic leftx,upy,rightx,downy,number8,Similar,fx,fy 
If fx>=0 and fy>=0 
n=n+1 
leftx=fx+1 
a(n)=fx 
b(n)=8 
EndIf 
wend 
leftx=lx 
m=m-1 
While n<>m 
m=n 
FindPic leftx,upy,rightx,downy,number9,Similar,fx,fy
If fx>=0 and fy>=0 
n=n+1 
leftx=fx+1 
a(n)=fx 
b(n)=9 
EndIf 
wend 
leftx=lx 
m=m-1
While p<n+2 
j=a(1) 
i=1 
h=1 
While i<n+2