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 { static byte[] intArrayToBytes_littleEndian_flexLength(int[] a, int n) { byte[] b = new byte[n]; int full = n/4; for (int i = 0; i < full; i++) intToBytes_inArray_littleEndian(a[i], b, i*4); if ((n & 3) != 0) intToBytes_inArray_littleEndian_partial(a[full], b, full*4); return b; } static void intToBytes_inArray_littleEndian(int i, byte[] array, int idx) { array[idx] = (byte) i; array[idx+1] = (byte) (i >>> 8); array[idx+2] = (byte) (i >>> 16); array[idx+3] = (byte) (i >>> 24); } static void intToBytes_inArray_littleEndian_partial(int i, byte[] array, int idx) { if (idx < array.length) array[idx] = (byte) i; if (idx+1 < array.length) array[idx+1] = (byte) (i >>> 8); if (idx+2 < array.length) array[idx+2] = (byte) (i >>> 16); if (idx+3 < array.length) array[idx+3] = (byte) (i >>> 24); } }