package jp.co.kokou.sample.no264; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { try (InputStreamReader is = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(is)) { String[] inputs = br.readLine().split("\\s+"); Hand mine = Hand.of(Integer.parseInt(inputs[0])); Hand yours = Hand.of(Integer.parseInt(inputs[1])); System.out.println(Judge.of(mine, yours)); } catch (IOException e) { } } private enum Hand { GU(0), CH(1), PA(2); private final int value; private Hand(int value) { this.value = value; } public static Hand of(int value) { for (Hand hand : Hand.values()) { if (hand.value == value) { return hand; } } throw new IndexOutOfBoundsException(); } } private enum Judge { WON("Won"), LOST("Lost"), DREW("Drew"); private final String value; private Judge(String value) { this.value = value; } @Override public String toString() { return value; } public static Judge of(Hand mine, Hand yours) { switch (mine) { case GU: switch (yours) { case GU: return DREW; case CH: return WON; case PA: return LOST; } case CH: switch (yours) { case GU: return LOST; case CH: return DREW; case PA: return WON; } case PA: switch (yours) { case GU: return WON; case CH: return LOST; case PA: return DREW; } } throw new IllegalArgumentException(); } } }