#include <cstdio>
#include <cstdlib>
long long x, y, mx, my;
int n,ans;
bool ok;
int main() {
freopen("loverfinding.in", "r", stdin);
freopen("loverfinding.out", "w", stdout);
int i;
long long a, b;
scanf("%d%lld%lld%lld%lld", &n, &x, &y, &mx, &my);
ans = 0;
for (i = 1; i <= n; i++) {
scanf("%lld%lld", &a, &b);
ans++;
x += a;
y += b;
if (x == mx&&y == my) {
ok = 1;
break;
}
}
if (ok == 1)
printf("%d", ans);
else
printf("SingleDogMZX");
fclose(stdin);
fclose(stdout);
return 0;
}