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 java.util.function.*;
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 java.awt.geom.*;
import javax.imageio.*;
import java.math.*;
import java.time.Duration;
import static x30_pkg.x30_util.DynamicObject;
import java.text.*;
import java.text.NumberFormat;
import java.util.TimeZone;
import java.awt.geom.*;
class main {
static void testWeightlessShuffledIteratorWithSeed() {
var l = virtualList(26, _i -> charPlus('a', _i));
String original = join(l);
for (int seed : countTo(26)) {
String shuffled = print(join(new WeightlessShuffledIteratorWithSeed(l, seed)));
assertEquals(sortedString(shuffled), original);
}
}
static List virtualList(int n, IF1 f) {
return listFromFunction(n, f);
}
static List virtualList(IF1 f, int n) {
return listFromFunction(f, n);
}
static char charPlus(char a, int b) {
return (char) (((int) a) + b);
}
static char charPlus(int b, char a) {
return charPlus(a, b);
}
public static String join(String glue, Iterable strings) {
if (strings == null) return "";
if (strings instanceof Collection) {
if (((Collection) strings).size() == 1) return str(first((Collection) strings));
}
StringBuilder buf = new StringBuilder();
Iterator i = strings.iterator();
if (i.hasNext()) {
buf.append(i.next());
while (i.hasNext())
buf.append(glue).append(i.next());
}
return buf.toString();
}
public static String join(String glue, String... strings) {
return join(glue, Arrays.asList(strings));
}
public static String join(String glue, Object... strings) {
return join(glue, Arrays.asList(strings));
}
static String join(Iterable strings) {
return join("", strings);
}
static String join(Iterable strings, String glue) {
return join(glue, strings);
}
public static String join(String[] strings) {
return join("", strings);
}
static String join(String glue, Pair p) {
return p == null ? "" : str(p.a) + glue + str(p.b);
}
static IterableIterator countTo(int b) { return countTo(0, b); }
static IterableIterator countTo(int a, int b) {
return countIterator(a, b);
}
static IterableIterator countTo(int b, IF1 f) { return countTo(0, b, f); }
static IterableIterator countTo(int a, int b, IF1 f) {
return countIterator(a, b, f);
}
static IterableIterator countTo(int a, int b, int step) {
return countIterator(a, b, step);
}
static IterableIterator countTo(double a, double b, double step, IF1 f) {
return countIterator(a, b, step, f);
}
static IterableIterator countTo(double a, double b, double step) {
return countIterator(a, b, step);
}
static IterableIterator countTo(IF1 f, double a, double b, double step) {
return countIterator(f, a, b, step);
}
static IterableIterator countTo(IF1 f, int b) { return countTo(f, 0, b); }
static IterableIterator countTo(IF1 f, int a, int b) {
return countIterator(f, a, b);
}
static IterableIterator countTo(List l) {
return countIterator(l);
}
static volatile StringBuffer local_log = new StringBuffer(); // not redirected
static boolean printAlsoToSystemOut = true;
static volatile Appendable print_log = local_log; // might be redirected, e.g. to main bot
// in bytes - will cut to half that
static volatile int print_log_max = 1024*1024;
static volatile int local_log_max = 100*1024;
static boolean print_silent = false; // total mute if set
static Object print_byThread_lock = new Object();
static volatile ThreadLocal