Binary Game

Read two binary strings and decide whether the first can reach the second by deleting the front character or appending the current parity bit.

Medium6QueueMathNo attempts yetTime limit1sMemory limit256 MB

Problem

Junmin was fishing with his friends Jaehyun and Sunyoung. Three hours passed without a single catch, so the other two got bored and started a binary game to tease him.

Jaehyun and Sunyoung write two strings aa and bb made only of 0 and 1, then hand them to Junmin. Junmin wins if he turns aa into bb. He may use the following two operations any number of times, in any order.

  • He can remove the first character of aa. For example, 1001 becomes 001. When aa is empty, nothing can be removed.
  • He can append parity(aa) to the end of aa. For example, 1000 becomes 10001. parity(aa) is 1 when the number of 1s in aa is odd, and 0 otherwise.

Junmin is bad at this game, so he asks whether he can win. Write a program that reads aa and bb and decides whether Junmin can win.

Input

The first line has the string aa and the second line has the string bb. Both strings consist only of 0 and 1, and the length of each string is between 1 and 1,000.

Output

Print VICTORY if Junmin can win, and DEFEAT otherwise.