import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.Arrays; import java.util.NoSuchElementException; public class Main { final long MOD=(long)1e9+7; void run() { FastScanner sc=new FastScanner(); PrintWriter pw=new PrintWriter(System.out); int N=sc.nextInt(); ArrayDeque dq=new ArrayDeque(); for (int i=0;i