import java.util.*; import java.util.zip.*; import java.util.List; import java.util.regex.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import java.util.concurrent.locks.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; import javax.swing.table.*; import java.io.*; import java.net.*; import java.lang.reflect.*; import java.lang.ref.*; import java.lang.management.*; import java.security.*; import java.security.spec.*; import java.awt.*; import java.awt.event.*; import java.awt.image.*; import javax.imageio.*; import java.math.*; /* We want an algebraic data type: SeenOrNot = Seen(rect, furtherNotes) | NotSeen */ // We simulate that with records and an interface: class main { static interface SeenOrNot {} static class Seen implements SeenOrNot , IFieldsToList { static String _fieldOrder = "rect furtherNotes"; Object rect; Object furtherNotes; Seen() {} Seen(Object rect, Object furtherNotes) { this.furtherNotes = furtherNotes; this.rect = rect;} public String toString() { return "Seen(" + rect + ", " + furtherNotes + ")"; } public boolean equals(Object o) { if (!(o instanceof Seen)) return false; Seen x = (Seen) o; return eq(rect, x.rect) && eq(furtherNotes, x.furtherNotes); } public int hashCode() { int h = 2572955; h = boostHashCombine(h, _hashCode(rect)); h = boostHashCombine(h, _hashCode(furtherNotes)); return h; } public Object[] _fieldsToList() { return new Object[] {rect, furtherNotes}; } } static class NotSeen implements SeenOrNot , IFieldsToList { NotSeen() {} public String toString() { return "NotSeen(" + ")"; } public boolean equals(Object o) { return o instanceof NotSeen; } public int hashCode() { int h = -501619762; return h; } public Object[] _fieldsToList() { return null; } } static boolean eq(Object a, Object b) { return a == b || (a == null ? b == null : b != null && a.equals(b)); } static int boostHashCombine(int a, int b) { return a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2)); } static int _hashCode(Object a) { return a == null ? 0 : a.hashCode(); } static String str(Object o) { return o == null ? "null" : o.toString(); } static String str(char[] c) { return new String(c); } static interface IFieldsToList { Object[] _fieldsToList(); } }