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.*; class main { abstract static class ILCCompactIndex { String its(int idx) { return itemToString(idx); } abstract String itemToString(int idx); abstract int numLeftPairs(int symbol); abstract int numRightPairs(int symbol); abstract int[] getLeftPairs(int symbol); abstract int[] getRightPairs(int symbol); abstract int getProdLength(int idx); abstract int getOccurrences(int idx); abstract int lookupLiteral(char c); int pairLeft(int idx) { return firstIntFromLong(getPair(idx)); } int pairRight(int idx) { return secondIntFromLong(getPair(idx)); } abstract long getPair(int idx); abstract int numberOfSymbols(); abstract String filePartToString(int iFile, int from, int to); abstract IntegerIterator getRightPairsStartingWith(int symbol, String from); abstract IntegerIterator getLeftPairsEndingWith(int symbol, String from); abstract List symbolToFiles(int symbol); // values start at numberOfSymbols() abstract String symbolToProtocol(int symbol, Object... __); abstract int getFile(int iFile); // iFile starts at 0 abstract int getFileLength(int iFile); // iFile starts at 0 abstract int nFiles(); abstract int nLiterals(); abstract boolean isPair(int symbol); abstract CharacterIterator itemCharIteratorWithSkip(int symbol, int skip); } static int firstIntFromLong(long l) { return (int) (l >> 32); } static int secondIntFromLong(long l) { return (int) l; } abstract static class CharacterIterator { abstract boolean hasNext(); abstract char next(); }abstract static class IntegerIterator { abstract boolean hasNext(); abstract int next(); } }