use bignum;
$e=0;
while(<>){
($n or $m) or last; # break if 0 0
$f=0;
for $i(1..$n){
$_=<>;
/ (\d+) (\d+)$/; # read two numbers to $1 and $2
$m-=$1;
if ($m<0){ $f=1 }
$m+=$2;
}
$e++>0 and
print $f ? "Fail":"Success";
}
dXNlIGJpZ251bTsKCiRlPTA7Cgp3aGlsZSg8Pil7CgkKCSgkbiwkbSk9c3BsaXQvIC87CgkoJG4gb3IgJG0pIG9yIGxhc3Q7ICMgYnJlYWsgaWYgMCAwCgkKCSRmPTA7Cglmb3IgJGkoMS4uJG4pewoJCSRfPTw+OwoJCWNob21wOwoJCS8gKFxkKykgKFxkKykkLzsgICMgcmVhZCB0d28gbnVtYmVycyB0byAkMSBhbmQgJDIKCQkkbS09JDE7CgkJaWYgKCRtPDApeyAkZj0xIH0KCQkkbSs9JDI7CgkJfQoJCQoJJGUrKz4wIGFuZCAKCXByaW50ICJcbiI7CgkKCXByaW50ICRmID8gIkZhaWwiOiJTdWNjZXNzIjsKCQoJfQ==
NSAxMDAwMApEYXJ0aCBWYWRlcjogNzUwMCA2MDAwCkdhbm9uOiA3NTAwIDYwMDAKR29rdTogOTAwMSA2MDAwCk5hcG9sZW9uOiA0MDAwIDQwMDAKVGhlIEJhdG1hbjogNjAwMCA4MDAwCjMgMApTYW50YSBDbGF1czogMCAyNQpNcnMgQ2xhdXM6IDAgMjUKS3JpcyBLcmluZ2xlOiAzMCAxMAowIDA=
5 10000
Darth Vader: 7500 6000
Ganon: 7500 6000
Goku: 9001 6000
Napoleon: 4000 4000
The Batman: 6000 8000
3 0
Santa Claus: 0 25
Mrs Claus: 0 25
Kris Kringle: 30 10
0 0