#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define INF 99999999
#define min( a, b ) ( (a)< (b)?(a): (b) )
int x[110], y[110], father[110];
double map[110][110], ans;
bool v[110], circle[110];
int n, m, root;
void dfs( int t )
{
v[t]= true;
for( int i= 1; i<= n; ++i )
if( !v[i] && map[t][i]!= INF )
dfs( i );
}
bool isok()
{
memset( v, false, sizeof(v) );
dfs( root );
for( int i= 1; i<= n; ++i )
if( !v[i] ) return false;
return true;
}
double dist( int i, int j )
{
return sqrt( (x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]) );
}
int exist_circle()//判断是否存在环
{
root= 1;
father[root]= root;
for( int i= 1; i<= n; ++i )
if( !circle[i] && i!= root )
{
father[i]= i;
map[i][i]= INF;//消除自环
for( int j= 1; j<= n; ++j )
if( !circle[j] && map[j][i]< map[father[i]][i] )
father[i]= j;
}
int i;
for( i= 1; i<= n; ++i )//判断是否存在有向环
{
if( circle[i] ) continue;
memset( v, false, sizeof(v) );
int j= i;
while( !v[j] ) { v[j]= true; j= father[j]; }
if( j== root ) continue;
return j;
}
return -1;
}
void update( int t )//更新点,将有向环中的除t之外的点剔除,并修改相关边
{
ans+= map[father[t]][t];
for( int i= father[t]; i!= t; i= father[i] )
{
ans+= map[father[i]][i];
circle[i]= true;
}
for( int i= 1; i<= n; ++i )
if( !circle[i] && map[i][t]!= INF )
map[i][t]-= map[father[t]][t];
for( int j= father[t]; j!= t; j= father[j] )
for( int i= 1; i<= n; ++i )
{
if( circle[i] ) continue;
if( map[i][j]!= INF )
map[i][t]= min( map[i][t], map[i][j]- map[father[j]][j] );
map[t][i]= min( map[j][i], map[t][i] );
}
}
void solve()
{
memset( circle, false, sizeof(circle) );
int j;
while( ( j= exist_circle() )!= -1 ) update( j );
for( j= 1; j<= n; ++j )
if( j!= root && !circle[j] )
ans+= map[father[j]][j];
printf("%.2lf\n", ans );
}
int main()
{
while( scanf("%d%d",&n,&m)!= EOF )
{
for( int i= 0; i<= n; ++i )
for( int j= 0; j<= n; ++j )
map[i][j]= INF;
for( int i= 1; i<= n; ++i )
scanf("%d%d",&x[i], &y[i] );
for( int i= 0; i< m; ++i )
{
int a, b;
scanf("%d%d",&a,&b);
map[a][b]= dist( a, b );
}
root= 1; ans= 0;
if( !isok() )
printf("poor snoopy\n");
else solve();
}
return 0;
}