// Case with 3 objects
const abc = (p1, p2, map = { a:0, c:1, b:2 }) => {
return ['DRAW', 'P1', 'P2'][(map[p1] - map[p2] + 3) % 3]
}// Case with 4 objects
const abcd = (p1, p2, map = { a:0, d:1, c:2, b:3 }) => {
return ['DRAW', 'P1', 'P2'][(map[p1] - map[p2]) % 2 && (4 - ((map[p1] - map[p2] + 4) % 4)) % 3 + 1]
}// Case with 5 objects
const abcde = (p1, p2, map = { a:0, e:1, d:2, c:3, b:4 }) => {
return ['DRAW', 'P1', 'P2'][((map[p1] - map[p2] + 5) % 5 - 1) % 2 + 1]
}