package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	var n, k int
	fmt.Scan(&n, &k)
	end := 2 + k
	res := []string{"1"}
	sign := 1
	next := 1
	for ; k > 0; k-- {
		next += sign * k
		sign *= -1
		res = append(res, strconv.Itoa(next))
	}
	for ; end <= n; end++ {
		res = append(res, strconv.Itoa(end))
	}
	fmt.Println(strings.Join(res, " "))
}

package main

import (
	"os"
	"bufio"
	"strconv"
	"fmt"
)

func scanInt(scanner *bufio.Scanner) int {
	scanner.Scan()
	x, _ := strconv.Atoi(scanner.Text())
	return x
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	n := scanInt(scanner)
	k := scanInt(scanner)
	writer.WriteString(fmt.Sprintf("%d", n))
	for i := n-1; i > k; i-- {
		writer.WriteString(fmt.Sprintf(" %d", i))
	}
	x, d := k+1, -k
	for d != 0 {
		x += d
		writer.WriteString(fmt.Sprintf(" %d", x))
		if d < 0 {
			d = -d - 1
		} else {
			d = -d + 1
		}
	}
	writer.WriteString("\n")
}

package main

import (
	"fmt"
)

func main() {
	var n, k int
	if _, err := fmt.Scanf("%d %d\n", &n, &k); err != nil {
		return
	}

	last := 1
	for i := k; i > 0; i-- {
		fmt.Printf("%d ", last)
		if last <= (k+1)/2 {
			last = last + i
		} else {
			last = last - i
		}
	}
	fmt.Printf("%d ", last)
	for i := k + 2; i <= n; i++ {
		fmt.Printf("%d ", i)
	}
	fmt.Println()
}

package main

import (
	"bufio"
	"bytes"
	"errors"
	"io"
	"math/rand"
	"os"
	"strconv"
	"time"
	"unicode/utf8"
)

// ******************************** CODE STARTS ********************************

const (
)

var (
)

func solve() {
	n := readInt()
	k := readInt()
	a := 1
	b := n
	for i := 0; i < k; i++ {
		if (i & 1) == 0 {
			printInt(a)
			a++
			printSpace()
		} else {
			printInt(b)
			b--
			printSpace()
		}
	}

	if (k & 1) == 0 {
		for i := 0; i < n - k; i++ {
			printInt(b)
			b--
			printSpace()
		}
	} else {
		for i := 0; i < n - k; i++ {
			printInt(a)
			a++
			printSpace()
		}
	}

	printLine()
}

// ********************************* CODE ENDS *********************************

// IO.

var (
	scanner *Scanner
	writer  *bufio.Writer
)

func main() {
	input := os.Stdin
	output := os.Stdout
	//	input, _ := os.Open("")
	//	output, _ := os.Create("")

	defer input.Close()
	defer output.Close()

	scanner = NewScanner(input)
	scanner.Split(bufio.ScanWords)

	writer = bufio.NewWriter(output)
	defer writer.Flush()

	rand.Seed(int64(time.Now().Nanosecond()))
	solve()
}

// Read.

func readString() string {
	scanner.Scan()
	ans := scanner.Text()
	return ans
}

func readLine() string {
	scanner.Split(bufio.ScanLines)
	defer scanner.Split(bufio.ScanWords)
	return readString()
}

func readInt() int {
	ans, _ := strconv.ParseInt(readString(), 10, 0)
	return int(ans)
}

func readInt64() int64 {
	ans, _ := strconv.ParseInt(readString(), 10, 64)
	return ans
}

func readFloat64() float64 {
	ans, _ := strconv.ParseFloat(readString(), 64)
	return ans
}

// Write.

func printString(value string) {
	writer.WriteString(value)
}

func printLine() {
	printString("\n")
}

func printSpace() {
	printString(" ")
}

func printInt(value int) {
	printString(strconv.FormatInt(int64(value), 10))
}

func printInt64(value int64) {
	printString(strconv.FormatInt(value, 10))
}

func printFloat64(value float64) {
	printString(strconv.FormatFloat(value, 'f', 20, 64))
}

// Tuple

type Tuple struct {
	a, b int
}

func (p Tuple) Equals(key Key) bool {
	return p.a == key.(Tuple).a
}

func (p Tuple) Less(key Key) bool {
	return p.a < key.(Tuple).a
}

// Sorting

type TupleSlice []Tuple

func (p TupleSlice) Len() int {
	return len(p)
}

func (p TupleSlice) Less(j, i int) bool {
	if p[j].a == p[i].a {
		return p[j].b < p[i].b
	} else {
		return p[j].a < p[i].a
	}
}

func (p TupleSlice) Swap(j, i int) {
	p[j], p[i] = p[i], p[j]
}

// Min, max, abs.

func maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func minInt(a, b int) int {
	if a < b {
		return a
	} else {
		return b
	}
}

func absInt(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func maxInt64(a, b int64) int64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func minInt64(a, b int64) int64 {
	if a < b {
		return a
	} else {
		return b
	}
}

func absInt64(a int64) int64 {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func maxFloat64(a, b float64) float64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func minFloat64(a, b float64) float64 {
	if a < b {
		return a
	} else {
		return b
	}
}

func absFloat64(a float64) float64 {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

// Set Key interface implementations.

type Int int

func (p Int) Equals(key Key) bool {
	return int(p) == int(key.(Int))
}

func (p Int) Less(key Key) bool {
	return int(p) < int(key.(Int))
}

// Set.

type Key interface {
	Equals(key Key) bool
	Less(key Key) bool
}

type node struct {
	key   Key
	left  *node
	right *node
}

func newNode(key Key) *node {
	return &node{key, nil, nil}
}

type SplayTree struct {
	root *node
	tmp  *node
	len  int
}

func NewSplayTree() *SplayTree {
	return &SplayTree{nil, newNode(nil), 0}
}

func rotateLeft(x, p *node) {
	p.right = x.left
	x.left = p
}

func rotateRight(x, p *node) {
	p.left = x.right
	x.right = p
}

func (p *SplayTree) splay(x *node, key Key) *node {
	if x == nil {
		return nil
	}

	left := p.tmp
	right := p.tmp

	for {
		if key.Less(x.key) {
			y := x.left
			if y == nil {
				break
			}
			if key.Less(y.key) { // zig-zig
				rotateRight(y, x)
				x = y
				if x.left == nil {
					break
				}
			}
			// link right
			right.left = x
			right = x
			// move left
			x = x.left
		} else if x.key.Less(key) {
			y := x.right
			if y == nil {
				break
			}
			if y.key.Less(key) { // zig-zig
				rotateLeft(y, x)
				x = y
				if x.right == nil {
					break
				}
			}
			// link left
			left.right = x
			left = x
			// move right
			x = x.right
		} else {
			break
		}
	}

	left.right = x.left
	right.left = x.right
	x.left = p.tmp.right
	x.right = p.tmp.left

	return x
}

// left <= key < right
func (p *SplayTree) split(key Key) (left, right *node) {
	p.root = p.splay(p.root, key)
	if p.root.key.Equals(key) || p.root.key.Less(key) {
		right := p.root.right
		p.root.right = nil
		return p.root, right
	} else {
		left := p.root.left
		p.root.left = nil
		return left, p.root
	}
}

// keys from left tree must be less then keys from right tree
func (p *SplayTree) join(left, right *node) *node {
	if left == nil {
		return right
	} else if right == nil {
		return left
	}
	left = p.splay(left, right.key)
	left.right = right
	return left
}

type Set interface {
	Len() int
	Insert(key Key) error
	Find(key Key) bool
	Remove(key Key) error
}

func NewSet() Set {
	return Set(NewSplayTree())
}

func (p *SplayTree) Len() int {
	return p.len
}

func (p *SplayTree) Insert(key Key) error {
	if p.root == nil {
		p.root = newNode(key)
		p.len++
	} else {
		p.root = p.splay(p.root, key)
		if p.root.key.Equals(key) {
			return errors.New("Such key already exists")
		} else {
			left, right := p.split(key)
			p.root = newNode(key)
			p.root.left = left
			p.root.right = right
			p.len++
		}
	}
	return nil
}

func (p *SplayTree) Find(key Key) bool {
	if p.root == nil {
		return false
	}
	p.root = p.splay(p.root, key)
	return p.root.key.Equals(key)
}

func (p *SplayTree) Remove(key Key) error {
	p.root = p.splay(p.root, key)
	if p.root == nil || !p.root.key.Equals(key) {
		return errors.New("Such key doesn't exist")
	}
	p.root = p.join(p.split(key))
	return nil
}

// Copied scan.go
// Scanner provides a convenient interface for reading data such as
// a file of newline-delimited lines of text. Successive calls to
// the Scan method will step through the 'tokens' of a file, skipping
// the bytes between the tokens. The specification of a token is
// defined by a split function of type SplitFunc; the default split
// function breaks the input into lines with line termination stripped. Split
// functions are defined in this package for scanning a file into
// lines, bytes, UTF-8-encoded runes, and space-delimited words. The
// client may instead provide a custom split function.
//
// Scanning stops unrecoverably at EOF, the first I/O error, or a token too
// large to fit in the buffer. When a scan stops, the reader may have
// advanced arbitrarily far past the last token. Programs that need more
// control over error handling or large tokens, or must run sequential scans
// on a reader, should use bufio.Reader instead.
//
type Scanner struct {
	r            io.Reader // The reader provided by the client.
	split        SplitFunc // The function to split the tokens.
	maxTokenSize int       // Maximum size of a token; modified by tests.
	token        []byte    // Last token returned by split.
	buf          []byte    // Buffer used as argument to split.
	start        int       // First non-processed byte in buf.
	end          int       // End of data in buf.
	err          error     // Sticky error.
}

// SplitFunc is the signature of the split function used to tokenize the
// input. The arguments are an initial substring of the remaining unprocessed
// data and a flag, atEOF, that reports whether the Reader has no more data
// to give. The return values are the number of bytes to advance the input
// and the next token to return to the user, plus an error, if any. If the
// data does not yet hold a complete token, for instance if it has no newline
// while scanning lines, SplitFunc can return (0, nil, nil) to signal the
// Scanner to read more data into the slice and try again with a longer slice
// starting at the same point in the input.
//
// If the returned error is non-nil, scanning stops and the error
// is returned to the client.
//
// The function is never called with an empty data slice unless atEOF
// is true. If atEOF is true, however, data may be non-empty and,
// as always, holds unprocessed text.
type SplitFunc func(data []byte, atEOF bool) (advance int, token []byte, err error)

// Errors returned by Scanner.
var (
	ErrTooLong         = errors.New("bufio.Scanner: token too long")
	ErrNegativeAdvance = errors.New("bufio.Scanner: SplitFunc returns negative advance count")
	ErrAdvanceTooFar   = errors.New("bufio.Scanner: SplitFunc returns advance count beyond input")
)

const (
	// Maximum size used to buffer a token. The actual maximum token size
	// may be smaller as the buffer may need to include, for instance, a newline.
	MaxScanTokenSize = 1 << 20
)

// NewScanner returns a new Scanner to read from r.
// The split function defaults to ScanLines.
func NewScanner(r io.Reader) *Scanner {
	return &Scanner{
		r:            r,
		split:        ScanLines,
		maxTokenSize: MaxScanTokenSize,
		buf:          make([]byte, 4096), // Plausible starting size; needn't be large.
	}
}

// Err returns the first non-EOF error that was encountered by the Scanner.
func (s *Scanner) Err() error {
	if s.err == io.EOF {
		return nil
	}
	return s.err
}

// Bytes returns the most recent token generated by a call to Scan.
// The underlying array may point to data that will be overwritten
// by a subsequent call to Scan. It does no allocation.
func (s *Scanner) Bytes() []byte {
	return s.token
}

// Text returns the most recent token generated by a call to Scan
// as a newly allocated string holding its bytes.
func (s *Scanner) Text() string {
	return string(s.token)
}

// Scan advances the Scanner to the next token, which will then be
// available through the Bytes or Text method. It returns false when the
// scan stops, either by reaching the end of the input or an error.
// After Scan returns false, the Err method will return any error that
// occurred during scanning, except that if it was io.EOF, Err
// will return nil.
func (s *Scanner) Scan() bool {
	// Loop until we have a token.
	for {
		// See if we can get a token with what we already have.
		if s.end > s.start {
			advance, token, err := s.split(s.buf[s.start:s.end], s.err != nil)
			if err != nil {
				s.setErr(err)
				return false
			}
			if !s.advance(advance) {
				return false
			}
			s.token = token
			if token != nil {
				return true
			}
		}
		// We cannot generate a token with what we are holding.
		// If we've already hit EOF or an I/O error, we are done.
		if s.err != nil {
			// Shut it down.
			s.start = 0
			s.end = 0
			return false
		}
		// Must read more data.
		// First, shift data to beginning of buffer if there's lots of empty space
		// or space is neded.
		if s.start > 0 && (s.end == len(s.buf) || s.start > len(s.buf)/2) {
			copy(s.buf, s.buf[s.start:s.end])
			s.end -= s.start
			s.start = 0
		}
		// Is the buffer full? If so, resize.
		if s.end == len(s.buf) {
			if len(s.buf) >= s.maxTokenSize {
				s.setErr(ErrTooLong)
				return false
			}
			newSize := len(s.buf) * 2
			if newSize > s.maxTokenSize {
				newSize = s.maxTokenSize
			}
			newBuf := make([]byte, newSize)
			copy(newBuf, s.buf[s.start:s.end])
			s.buf = newBuf
			s.end -= s.start
			s.start = 0
			continue
		}
		// Finally we can read some input. Make sure we don't get stuck with
		// a misbehaving Reader. Officially we don't need to do this, but let's
		// be extra careful: Scanner is for safe, simple jobs.
		for loop := 0; ; {
			n, err := s.r.Read(s.buf[s.end:len(s.buf)])
			s.end += n
			if err != nil {
				s.setErr(err)
				break
			}
			if n > 0 {
				break
			}
			loop++
			if loop > 100 {
				s.setErr(io.ErrNoProgress)
				break
			}
		}
	}
}

// advance consumes n bytes of the buffer. It reports whether the advance was legal.
func (s *Scanner) advance(n int) bool {
	if n < 0 {
		s.setErr(ErrNegativeAdvance)
		return false
	}
	if n > s.end-s.start {
		s.setErr(ErrAdvanceTooFar)
		return false
	}
	s.start += n
	return true
}

// setErr records the first error encountered.
func (s *Scanner) setErr(err error) {
	if s.err == nil || s.err == io.EOF {
		s.err = err
	}
}

// Split sets the split function for the Scanner. If called, it must be
// called before Scan. The default split function is ScanLines.
func (s *Scanner) Split(split SplitFunc) {
	s.split = split
}

// Split functions

// ScanBytes is a split function for a Scanner that returns each byte as a token.
func ScanBytes(data []byte, atEOF bool) (advance int, token []byte, err error) {
	if atEOF && len(data) == 0 {
		return 0, nil, nil
	}
	return 1, data[0:1], nil
}

var errorRune = []byte(string(utf8.RuneError))

// ScanRunes is a split function for a Scanner that returns each
// UTF-8-encoded rune as a token. The sequence of runes returned is
// equivalent to that from a range loop over the input as a string, which
// means that erroneous UTF-8 encodings translate to U+FFFD = "\xef\xbf\xbd".
// Because of the Scan interface, this makes it impossible for the client to
// distinguish correctly encoded replacement runes from encoding errors.
func ScanRunes(data []byte, atEOF bool) (advance int, token []byte, err error) {
	if atEOF && len(data) == 0 {
		return 0, nil, nil
	}

	// Fast path 1: ASCII.
	if data[0] < utf8.RuneSelf {
		return 1, data[0:1], nil
	}

	// Fast path 2: Correct UTF-8 decode without error.
	_, width := utf8.DecodeRune(data)
	if width > 1 {
		// It's a valid encoding. Width cannot be one for a correctly encoded
		// non-ASCII rune.
		return width, data[0:width], nil
	}

	// We know it's an error: we have width==1 and implicitly r==utf8.RuneError.
	// Is the error because there wasn't a full rune to be decoded?
	// FullRune distinguishes correctly between erroneous and incomplete encodings.
	if !atEOF && !utf8.FullRune(data) {
		// Incomplete; get more bytes.
		return 0, nil, nil
	}

	// We have a real UTF-8 encoding error. Return a properly encoded error rune
	// but advance only one byte. This matches the behavior of a range loop over
	// an incorrectly encoded string.
	return 1, errorRune, nil
}

// dropCR drops a terminal \r from the data.
func dropCR(data []byte) []byte {
	if len(data) > 0 && data[len(data)-1] == '\r' {
		return data[0 : len(data)-1]
	}
	return data
}

// ScanLines is a split function for a Scanner that returns each line of
// text, stripped of any trailing end-of-line marker. The returned line may
// be empty. The end-of-line marker is one optional carriage return followed
// by one mandatory newline. In regular expression notation, it is `\r?\n`.
// The last non-empty line of input will be returned even if it has no
// newline.
func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error) {
	if atEOF && len(data) == 0 {
		return 0, nil, nil
	}
	if i := bytes.IndexByte(data, '\n'); i >= 0 {
		// We have a full newline-terminated line.
		return i + 1, dropCR(data[0:i]), nil
	}
	// If we're at EOF, we have a final, non-terminated line. Return it.
	if atEOF {
		return len(data), dropCR(data), nil
	}
	// Request more data.
	return 0, nil, nil
}

// isSpace reports whether the character is a Unicode white space character.
// We avoid dependency on the unicode package, but check validity of the implementation
// in the tests.
func isSpace(r rune) bool {
	if r <= '\u00FF' {
		// Obvious ASCII ones: \t through \r plus space. Plus two Latin-1 oddballs.
		switch r {
		case ' ', '\t', '\n', '\v', '\f', '\r':
			return true
		case '\u0085', '\u00A0':
			return true
		}
		return false
	}
	// High-valued ones.
	if '\u2000' <= r && r <= '\u200a' {
		return true
	}
	switch r {
	case '\u1680', '\u180e', '\u2028', '\u2029', '\u202f', '\u205f', '\u3000':
		return true
	}
	return false
}

// ScanWords is a split function for a Scanner that returns each
// space-separated word of text, with surrounding spaces deleted. It will
// never return an empty string. The definition of space is set by
// unicode.IsSpace.
func ScanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {
	// Skip leading spaces.
	start := 0
	for width := 0; start < len(data); start += width {
		var r rune
		r, width = utf8.DecodeRune(data[start:])
		if !isSpace(r) {
			break
		}
	}
	if atEOF && len(data) == 0 {
		return 0, nil, nil
	}
	// Scan until space, marking end of word.
	for width, i := 0, start; i < len(data); i += width {
		var r rune
		r, width = utf8.DecodeRune(data[i:])
		if isSpace(r) {
			return i + width, data[start:i], nil
		}
	}
	// If we're at EOF, we have a final, non-empty, non-terminated word. Return it.
	if atEOF && len(data) > start {
		return len(data), data[start:], nil
	}
	// Request more data.
	return 0, nil, nil
}

package main

import (
	"os"
	"bufio"
	"strconv"
	"fmt"
)

func scanInt(scanner *bufio.Scanner) int {
	scanner.Scan()
	x, _ := strconv.Atoi(scanner.Text())
	return x
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	n := scanInt(scanner)
	k := scanInt(scanner)
	writer.WriteString(fmt.Sprintf("%d", n))
	for i := n-1; i > k; i-- {
		writer.WriteString(fmt.Sprintf(" %d", i))
	}
	x, d := k+1, k
	for d != 0 {
		if x > d {
			x -= d
		} else {
			x += d
		}
		writer.WriteString(fmt.Sprintf(" %d", x))
		d--
	}
	writer.WriteString("\n")
}


package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1366D(_r io.Reader, _w io.Writer) {
	out := bufio.NewWriter(_w)
	defer out.Flush()
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			_r.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		return
	}
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	n := r()
	a := make([]interface{}, n)
	b := make([]interface{}, n)
	for i := 0; i < n; i++ {
		v := r()
		p := lpf[v]
		w := v / p
		for ; lpf[w] == p; w /= p {
		}
		if w > 1 {
			a[i] = w
			b[i] = v / w
		} else {
			a[i] = -1
			b[i] = -1
		}
	}
	Fprintln(out, a...)
	Fprintln(out, b...)
}

func main() { CF1366D(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1366D(_r io.Reader, _w io.Writer) {
	out := bufio.NewWriter(_w)
	defer out.Flush()
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			_r.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		return
	}
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	n := r()
	a := []byte{}
	b := []byte{}
	for i := 0; i < n; i++ {
		v := r()
		p := lpf[v]
		w := v / p
		for ; lpf[w] == p; w /= p {
		}
		if w > 1 {
			x := []byte{}
			for p > 0 {
				x = append(x, byte('0'+p%10))
				p /= 10
			}
			for i := len(x) - 1; i >= 0; i-- {
				a = append(a, x[i])
			}
			a = append(a, ' ')

			x = []byte{}
			for w > 0 {
				x = append(x, byte('0'+w%10))
				w /= 10
			}
			for i := len(x) - 1; i >= 0; i-- {
				b = append(b, x[i])
			}
			b = append(b, ' ')
		} else {
			a = append(a, "-1 "...)
			b = append(b, "-1 "...)
		}
	}
	Fprintf(out, "%s\n%s", a, b)
}

func main() { CF1366D(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	. "fmt"
	"os"
	"strconv"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			os.Stdin.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		return
	}
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	a, b := []byte{}, []byte{}
	for n := r(); n > 0; n-- {
		v := r()
		p := lpf[v]
		v /= p
		for ; lpf[v] == p; v /= p {
		}
		if v > 1 {
			a = append(a, strconv.Itoa(p)...)
			a = append(a, ' ')
			b = append(b, strconv.Itoa(v)...)
			b = append(b, ' ')
		} else {
			a = append(a, "-1 "...)
			b = append(b, "-1 "...)
		}
	}
	out := bufio.NewWriter(os.Stdout)
	Fprintf(out, "%s\n%s", a, b)
	out.Flush()
}

package main

import (
	. "fmt"
	"os"
	"strconv"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			os.Stdin.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		return
	}
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	a, b := []byte{}, []byte{}
	for n := r(); n > 0; n-- {
		v := r()
		p := lpf[v]
		v /= p
		for ; lpf[v] == p; v /= p {
		}
		if v > 1 {
			a = append(a, strconv.Itoa(p)...)
			a = append(a, ' ')
			b = append(b, strconv.Itoa(v)...)
			b = append(b, ' ')
		} else {
			a = append(a, "-1 "...)
			b = append(b, "-1 "...)
		}
	}
	Printf("%s\n%s", a, b)
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1366D(_r io.Reader, _w io.Writer) {
	out := bufio.NewWriter(_w)
	defer out.Flush()
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			_r.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		return
	}
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	ans := make([]interface{}, r())
	for i := range ans {
		v := r()
		p := lpf[v]
		w := v / p
		for ; lpf[w] == p; w /= p {
		}
		if w > 1 {
			Fprint(out, w, " ")
			ans[i] = v / w
		} else {
			Fprint(out, "-1 ")
			ans[i] = -1
		}
	}
	Fprintln(out)
	Fprint(out, ans...)
}

func main() { CF1366D(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)

	n := readNum(reader)
	A := readNNums(reader, n)
	B, C := solve(n, A)

	var buf bytes.Buffer
	var buf2 bytes.Buffer
	for i := 0; i < n; i++ {
		buf.WriteString(fmt.Sprintf("%d ", B[i]))
		buf2.WriteString(fmt.Sprintf("%d ", C[i]))
	}
	fmt.Println(buf.String())
	fmt.Println(buf2.String())
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

const MAX_A = 10000003

var minDiv [MAX_A]int

func init() {
	for x := 2; x < MAX_A; x++ {
		if minDiv[x] == 0 {
			for y := x; y < MAX_A; y += x {
				if minDiv[y] == 0 {
					minDiv[y] = x
				}
			}
		}
	}
}

func solve(n int, A []int) ([]int, []int) {
	B := make([]int, n)
	C := make([]int, n)

	for i := 0; i < n; i++ {
		fs := make(map[int]int)

		num := A[i]

		for num > 1 {
			x := minDiv[num]
			fs[x]++
			num /= x
		}
		if len(fs) == 1 {
			B[i] = -1
			C[i] = -1
			continue
		}
		for k := range fs {
			if B[i] == 0 {
				B[i] = k
				C[i] = 1
			} else {
				C[i] *= k
			}
		}
	}
	return B, C
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	defer w.Flush()
	ans := solve(nextInts(nextInt()))
	for i := 0; i < len(ans); i++ {
		Printf("%d ", ans[i][0])
	}
	for i := 0; i < len(ans); i++ {
		Printf("%d ", ans[i][1])
	}
}

func solve(As []int) [][]int {
	ans := [][]int{}
	isPrime, primes := Sieve(1e7)
	for i := 0; i < len(As); i++ {
		x, y := solve1(isPrime, primes, As[i])
		ans = append(ans, []int{x, y})
	}
	return ans
}

func solve1(isPrime []bool, primes []int, n int) (int, int) {
	if isPrime[n] {
		return -1, -1
	}
	for _, prime := range primes {
		if prime >= n {
			return -1, -1
		}
		if n%prime != 0 {
			continue
		}
		for n%prime == 0 {
			n /= prime
		}
		if n == 1 {
			return -1, -1
		}
		return prime, n
	}
	return -1, -1
}

// Sieve returns isPrime, primes
func Sieve(max int) ([]bool, []int) {
	isPrime := make([]bool, max+1)
	for i := 2; i <= max; i++ {
		isPrime[i] = true
	}
	primes := []int{}
	for i := 2; i <= max; i++ {
		if !isPrime[i] {
			continue
		}
		for j := 2 * i; j <= max; j += i {
			isPrime[j] = false
		}
		primes = append(primes, i)
	}
	return isPrime, primes
}

var w = bufio.NewWriter(os.Stdout)

func Printf(format string, a ...interface{}) {
	fmt.Fprintf(w, format, a...)
}

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, err := strconv.Atoi(next())
	if err != nil {
		panic(err)
	}
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	defer w.Flush()

	n := nextInt()
	ans := solve(nextInts(n))

	for i := 0; i < len(ans); i++ {
		Printf("%d ", ans[i][0])
		// if i == len(ans)-1 {
		// 	Printf("%d\n", ans[i][0])
		// } else {
		// 	Printf("%d ", ans[i][0])
		// }
	}
	for i := 0; i < len(ans); i++ {
		Printf("%d ", ans[i][1])
		// if i == len(ans)-1 {
		// 	Printf("%d\n", ans[i][1])
		// } else {
		//
		// }
	}
}

var w = bufio.NewWriter(os.Stdout)

func Printf(format string, a ...interface{}) {
	fmt.Fprintf(w, format, a...)
}

func Println(a ...interface{}) {
	fmt.Fprintln(w, a...)
}

func solve(As []int) [][]int {
	ans := [][]int{}
	isPrime, primes := Sieve(1e7)
	for i := 0; i < len(As); i++ {
		x, y := solve1(isPrime, primes, As[i])
		ans = append(ans, []int{x, y})
	}
	return ans
}

func solve1(isPrime []bool, primes []int, n int) (int, int) {
	if isPrime[n] {
		return -1, -1
	}
	for _, prime := range primes {
		if prime >= n {
			return -1, -1
		}
		if n%prime != 0 {
			continue
		}
		for n%prime == 0 {
			n /= prime
		}
		if n == 1 {
			return -1, -1
		}
		return prime, n
	}
	return -1, -1
}

// Sieve returns isPrime, primes
func Sieve(max int) ([]bool, []int) {
	isPrime := make([]bool, max+1)
	for i := 2; i <= max; i++ {
		isPrime[i] = true
	}
	primes := []int{}
	for i := 2; i <= max; i++ {
		if !isPrime[i] {
			continue
		}
		for j := 2 * i; j <= max; j += i {
			isPrime[j] = false
		}
		primes = append(primes, i)
	}
	return isPrime, primes
}

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, err := strconv.Atoi(next())
	if err != nil {
		panic(err)
	}
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

func nextInt64() int64 {
	a, err := strconv.ParseInt(next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return a
}

func nextInt64s(n int) []int64 {
	ret := make([]int64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt64()
	}
	return ret
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1366D(_r io.Reader, _w io.Writer) {
	out := bufio.NewWriter(_w)
	defer out.Flush()
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			_r.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		return
	}
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	n := r()
	a := make([]interface{}, n)
	b := make([]interface{}, n)
	for i := 0; i < n; i++ {
		v := r()
		p := lpf[v]
		w := v / p
		for ; lpf[w] == p; w /= p {
		}
		if w > 1 {
			a[i] = p
			b[i] = w
		} else {
			a[i] = -1
			b[i] = -1
		}
	}
	Fprintln(out, a...)
	Fprintln(out, b...)
}

func main() { CF1366D(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	n := nextInt()
	ans := solve(nextInts(n))

	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	for i := 0; i < len(ans); i++ {
		if i == len(ans)-1 {
			fmt.Fprintf(w, "%d\n", ans[i][0])
		} else {
			fmt.Fprintf(w, "%d ", ans[i][0])
		}
	}
	for i := 0; i < len(ans); i++ {
		if i == len(ans)-1 {
			fmt.Fprintf(w, "%d\n", ans[i][1])
		} else {
			fmt.Fprintf(w, "%d ", ans[i][1])
		}
	}
}

func solve(As []int) [][]int {
	ans := [][]int{}
	isPrime, primes := Sieve(1e7)
	for i := 0; i < len(As); i++ {
		x, y := solve1(isPrime, primes, As[i])
		ans = append(ans, []int{x, y})
	}
	return ans
}

func solve1(isPrime []bool, primes []int, n int) (int, int) {
	if isPrime[n] {
		return -1, -1
	}
	for _, prime := range primes {
		if prime >= n {
			return -1, -1
		}
		if n%prime != 0 {
			continue
		}
		for n%prime == 0 {
			n /= prime
		}
		if n == 1 {
			return -1, -1
		}
		return prime, n
	}
	return -1, -1
}

// Sieve returns isPrime, primes
func Sieve(max int) ([]bool, []int) {
	isPrime := make([]bool, max+1)
	for i := 2; i <= max; i++ {
		isPrime[i] = true
	}
	primes := []int{}
	for i := 2; i <= max; i++ {
		if !isPrime[i] {
			continue
		}
		for j := 2 * i; j <= max; j += i {
			isPrime[j] = false
		}
		primes = append(primes, i)
	}
	return isPrime, primes
}

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer(make([]byte, 256), 1e9)
	sc.Split(bufio.ScanWords)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, err := strconv.Atoi(next())
	if err != nil {
		panic(err)
	}
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

func nextInt64() int64 {
	a, err := strconv.ParseInt(next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return a
}

func nextInt64s(n int) []int64 {
	ret := make([]int64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt64()
	}
	return ret
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1366D(_r io.Reader, _w io.Writer) {
	out := bufio.NewWriter(_w)
	defer out.Flush()
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			_r.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		return
	}
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	ans := make([]interface{}, r())
	for i := range ans {
		q, s := 0, 1
		for v := r(); v > 1; {
			p := lpf[v]
			for v /= p; lpf[v] == p; v /= p {
			}
			if q == 0 {
				q = p
			} else {
				s *= p
			}
		}
		if s > 1 {
			Fprint(out, q, " ")
			ans[i] = s
		} else {
			Fprint(out, "-1 ")
			ans[i] = -1
		}
	}
	Fprintln(out)
	Fprint(out, ans...)
}

func main() { CF1366D(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	. "fmt"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	const mx = 1e7
	f := make([]int, mx+1)
	f[1] = 1
	for i := 2; i <= mx; i++ {
		if f[i] == 0 {
			for j := i; j <= mx; j += i {
				if f[j] == 0 {
					f[j] = i
				}
			}
		}
	}

	var n, v int
	Fscan(in, &n)
	a := make([]interface{}, n)
	b := make([]interface{}, n)
	for i := 0; i < n; i++ {
		Fscan(in, &v)
		p := f[v]
		for v /= p; f[v] == p; v /= p {
		}
		if v > 1 {
			a[i] = p
			b[i] = v
		} else {
			a[i] = -1
			b[i] = -1
		}
	}
	Fprintln(out, a...)
	Fprintln(out, b...)
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
	"strconv"
)

// github.com/EndlessCheng/codeforces-go
func CF1366D(_r io.Reader, _w io.Writer) {
	out := bufio.NewWriter(_w)
	defer out.Flush()
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			_r.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		return
	}
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	n := r()
	a := []byte{}
	b := []byte{}
	for i := 0; i < n; i++ {
		v := r()
		p := lpf[v]
		w := v / p
		for ; lpf[w] == p; w /= p {
		}
		if w > 1 {
			a = append(a, strconv.Itoa(p)...)
			a = append(a, ' ')
			b = append(b, strconv.Itoa(w)...)
			b = append(b, ' ')
		} else {
			a = append(a, "-1 "...)
			b = append(b, "-1 "...)
		}
	}
	Fprintf(out, "%s\n%s", a, b)
}

func main() { CF1366D(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1366D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	var n, v int
	Fscan(in, &n)
	ans := make([]interface{}, n)
	for i := range ans {
		Fscan(in, &v)
		q, s := 0, 1
		for v > 1 {
			p := lpf[v]
			for v /= p; lpf[v] == p; v /= p {
			}
			if q == 0 {
				q = p
			} else {
				s *= p
			}
		}
		if s > 1 {
			Fprint(out, q, " ")
			ans[i] = s
		} else {
			Fprint(out, "-1 ")
			ans[i] = -1
		}
	}
	Fprintln(out)
	Fprint(out, ans...)
}

func main() { CF1366D(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1366D(_r io.Reader, _w io.Writer) {
	out := bufio.NewWriter(_w)
	defer out.Flush()
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			_r.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		for ; '0' > b; b = rc() {
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		return
	}
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	ans := make([]int, r())
	for i := range ans {
		v := r()
		p := lpf[v]
		w := v / p
		for ; lpf[w] == p; w /= p {
		}
		if w > 1 {
			Fprint(out, w, " ")
			ans[i] = v / w
		} else {
			Fprint(out, "-1 ")
			ans[i] = -1
		}
	}
	Fprintln(out)
	for _, v := range ans {
		Fprint(out, v, " ")
	}
}

func main() { CF1366D(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1366D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	var n, v int
	Fscan(in, &n)
	ans := make([]interface{}, n)
o:
	for i := range ans {
		Fscan(in, &v)
		q := 0
		for v > 1 {
			p := lpf[v]
			for v /= p; lpf[v] == p; v /= p {
			}
			if q > 0 {
				Fprint(out, q, " ")
				ans[i] = p
				continue o
			}
			q = p
		}
		Fprint(out, "-1 ")
		ans[i] = -1
	}
	Fprintln(out)
	Fprint(out, ans...)
}

func main() { CF1366D(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1366D(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mx = 1e7
	lpf := make([]int, mx+1)
	lpf[1] = 1
	for i := 2; i <= mx; i++ {
		if lpf[i] == 0 {
			for j := i; j <= mx; j += i {
				if lpf[j] == 0 {
					lpf[j] = i
				}
			}
		}
	}

	var n, v, p int
	Fscan(in, &n)
	ans := make([]interface{}, n)
	for i := range ans {
		Fscan(in, &v)
		q := 0
		for v > 1 {
			p = lpf[v]
			for v /= p; lpf[v] == p; v /= p {
			}
			if q == 0 {
				q = p
			}
		}
		if p != q {
			Fprint(out, q, " ")
			ans[i] = p
		} else {
			Fprint(out, "-1 ")
			ans[i] = -1
		}
	}
	Fprintln(out)
	Fprint(out, ans...)
}

func main() { CF1366D(os.Stdin, os.Stdout) }


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)

	n := readNum(reader)

	x, y := make([]int, n), make([]int, n)

	for i := 0; i < n; i++ {
		x[i], y[i] = readTwoNums(reader)
	}

	res := solve(n, x, y)

	var buf bytes.Buffer

	for i := 0; i < n; i++ {
		buf.WriteString(fmt.Sprintf("%d ", res[i]))
	}
	fmt.Print(buf.String())
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func solve(n int, x, y []int) []int {
	perm := make([]int, n)

	for i := 0; i < n; i++ {
		perm[i] = i
		for j := i; j > 1; j-- {
			if int64(x[perm[j]]-x[perm[j-1]])*int64(x[perm[j-1]]-x[perm[j-2]])+int64(y[perm[j]]-y[perm[j-1]])*int64(y[perm[j-1]]-y[perm[j-2]]) >= 0 {
				perm[j-1], perm[j] = perm[j], perm[j-1]
			} else {
				break
			}
		}
	}

	for i := 0; i < n; i++ {
		perm[i]++
	}

	return perm
}

package main

import (
	"bufio"
	. "fmt"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var n int
	Fscan(in, &n)
	a := make([][2]int64, n)
	for i := range a {
		Fscan(in, &a[i][0], &a[i][1])
	}
	d := func(i, j int) int64 { x, y := a[i][0]-a[j][0], a[i][1]-a[j][1]; return x*x + y*y }
	v := make([]bool, n)
	v[0] = true
	Fprint(out, 1)
	for i, pre := 1, 0; i < n; i++ {
		k := -1
		for j, b := range v {
			if !b && (k < 0 || d(pre, j) > d(pre, k)) {
				k = j
			}
		}
		Fprint(out, " ", k+1)
		v[k] = true
		pre = k
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
	"sort"
)

// github.com/EndlessCheng/codeforces-go
func CF1478C(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T, n int
o:
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		a := make([]int64, 2*n)
		for i := range a {
			Fscan(in, &a[i])
		}
		sort.Slice(a, func(i, j int) bool { return a[i] > a[j] })
		s := int64(0)
		for i := 0; i < 2*n; i += 2 {
			v := (a[i] - s) / int64(2*n-i)
			if a[i] != a[i+1] || a[i] <= s || (a[i]-s)%int64(2*n-i) > 0 || i > 0 && v >= a[i-2] {
				Fprintln(out, "NO")
				continue o
			}
			a[i] = v
			s += v * 2
		}
		Fprintln(out, "YES")
	}
}

func main() { CF1478C(os.Stdin, os.Stdout) }


package main

import (
	"fmt"
	"bufio"
	"strconv"
	"os"
)

var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	defer out.Flush()
	in.Split(bufio.ScanWords)

	var n int = NextInt()
	mp := make(map[int]int)
	for i := 0; i < n; i++ {
		var v int = NextInt();
		if v == 0 {
			continue
		}
		if _, exists := mp[v]; !exists {
			mp[v] = 1
		}else {
			mp[v] += 1
			if mp[v] > 2 {
				fmt.Fprintln(out, -1)
				return
			}
		}
	}

	var count int = 0
	for _, value := range mp {
		if value == 2 {
			count++
		}
	}

	fmt.Fprintln(out, count)
}

func Next() string{
	if !in.Scan() {
		panic("Scan error")
	}
	return in.Text()
}

func NextInt() int{
	ret, _ := strconv.Atoi(Next())
	return ret
}

package main
import (
	"fmt"
	//"unicode/utf8"
	//"strconv"
)

func main() {

	var n,x int
	ans:=0
	flag:=false
	fmt.Scan(&n)
	m := make(map[int]int,n)
	for i:=0;i<n;i++ {
		fmt.Scan(&x)
		if x!=0 {
			m[x]++
			if m[x]==2 {
				ans++
			}
			if m[x]==3 {
				fmt.Println("-1")
				flag=true
				break
			}
		}
	}
	if flag==false {
			fmt.Println(ans)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func solve() {
	n := readInt()
	m := make(map[int]int)
	cnt := 0
	for i := 0; i < n; i++ {
		t := readInt()
		if t == 0 {
			continue
		}
		m[t] += 1
		if m[t] > 2 {
			fmt.Println(-1)
			return
		}
		if m[t] == 2 {
			cnt++
		}
	}
	fmt.Println(cnt)
}

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

package main

import "fmt"

func main() {
    var n,id int
    call := make(map[int]int)
    fmt.Scan(&n)
    ans, cnt := true, 0
    for i := 0; i < n; i++ {
        fmt.Scan(&id)
        if id != 0 {
            call[id]++
            if call[id] == 2 {
                cnt++
            } else if call[id] > 2 {
                ans = false
            }
        }
    }
    if ans { fmt.Println(cnt) } else { fmt.Println(-1) }
}

package main

import "fmt"

func main() {
	var n, temp int
	fmt.Scan(&n)
	m := make(map[int]int)
	var out int
	for ; n > 0; n-- {
		fmt.Scan(&temp)
		if temp != 0 {
			m[temp]++
			if m[temp] > 2 {
				out = -1
			}
		}
	}
	if out == -1 {
		fmt.Println(-1)
	} else {
		for _, v := range m {
			if v == 2 {
				out++
			}
		}
		fmt.Println(out)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	r := bufio.NewReader(os.Stdin)

	var n int
	fmt.Fscanf(r, "%d\n", &n)

	mp := make(map[int]int)
	for i := 0; i < n; i++ {
		var s int
		fmt.Fscanf(r, "%d", &s)
		if s > 0 {
			mp[s]++
		}
	}

	count := 0
	for _, v := range mp {
		if v > 2 {
			fmt.Println("-1")
			return
		} else if v == 2 {
			count++
		}
	}

	fmt.Println(count)
}

// 291A-mic
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, c, now int
	cou := 1
	fmt.Scan(&n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
	}
	sort.Sort(sort.IntSlice(a))
	now = a[0]
	for i := 1; i < n; i++ {
		if now == 0 {
			now = a[i]
			continue
		}
		if now == a[i] {
			cou++
			now = a[i]
		} else {
			cou = 1
			now = a[i]
		}
		if cou == 2 {
			c++
		} else if cou > 2 {
			fmt.Println("-1")
			return
		}
	}
	fmt.Println(c)
}

package main

import (
    "strconv"
    "bufio"
    "os"
    "fmt"
)
// var file, _ = os.Open("input.txt")
// var outfile, _ = os.Create("output.txt")
// var in = bufio.NewScanner(file)
// var out = bufio.NewWriter(outfile)
var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
    if !in.Scan() {
        panic("Scan error")
    }
    return in.Text()
}

func nextInt() int {
    ret, _ := strconv.Atoi(next())
    return ret
}

func nextFloat() float64 {
    ret, _ := strconv.ParseFloat(next(), 64)
    return ret
}

func main() {
    defer out.Flush()
    in.Split(bufio.ScanWords)
    n := nextInt()
    m := make(map[int]int)
    for i := 0; i < n; i++ {
        x := nextInt()
        m[x]++
        if x != 0 && m[x] > 2 {
            fmt.Fprintln(out, -1)
            return
        }
    }
    ans := 0
    for k := range m {
        if k != 0 && m[k] == 2 {
            ans++
        }
    }

    fmt.Fprintln(out, ans)

}

package main
import (
	"fmt"
	//"unicode/utf8"
	//"strconv"
)

func main() {

	var n,x int
	ans:=0
	flag:=false
	fmt.Scan(&n)
	m := make(map[int]int,n)
	for i:=0;i<n;i++ {
		fmt.Scan(&x)
		if x!=0 {
			m[x]++
			if m[x]==2 {
				ans++
			}
			if m[x]==3 {
				fmt.Println("-1")
				flag=true
			}
		}
	}
	if flag==false {
			fmt.Println(ans)
	}
}

package main
import (
	"fmt"
	//"unicode/utf8"
	//"strconv"
)

func main() {

	var n,x int
	ans:=0
	fmt.Scan(&n)
	m := make(map[int]int,n)
	for i:=0;i<n;i++ {
		fmt.Scan(&x)
		if x!=0 {
			m[x]++
			if m[x]==2 {
				ans++
			}
			if m[x]==3 {
				fmt.Println("-1")
			}
		}
	}
	fmt.Println(ans)
}

package main

import (
	"fmt"
	"bufio"
	"strconv"
	"os"
)

var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	defer out.Flush()
	in.Split(bufio.ScanWords)

	var n int = NextInt()
	mp := make(map[int]int)
	for i := 0; i < n; i++ {
		var v int = NextInt();
		if _, exists := mp[v]; !exists {
			mp[v] = 1
		}else {
			mp[v] += 1
			if v != 0 && mp[v] > 2 {
				fmt.Fprintln(out, -1)
				return
			}
		}
	}

	var count int = 0
	for _, value := range mp {
		if value == 2 {
			count++
		}
	}

	fmt.Fprintln(out, count)
}

func Next() string{
	if !in.Scan() {
		panic("Scan error")
	}
	return in.Text()
}

func NextInt() int{
	ret, _ := strconv.Atoi(Next())
	return ret
}

package main

import "fmt"

func main() {
    var n,id int
    call := make(map[int]int)
    fmt.Scan(&n)
    ans, cnt := true, 0
    for i := 0; i < n; i++ {
        fmt.Scan(&id)
        call[id]++
        if call[id] == 2 {
            cnt++
        } else if call[id] > 2 {
            ans = false
        }
    }
    if ans { fmt.Println(cnt) } else { fmt.Println(-1) }
}

package main

import "fmt"

func main() {
	var n, temp int
	fmt.Scan(&n)
	m := make(map[int]int)
	var out int
	for ; n > 0; n-- {
		fmt.Scan(&temp)
		m[temp]++
		if m[temp] > 2 {
			out = -1
		}
	}
	if out == -1 {
		fmt.Println(-1)
	} else {
		for _, v := range m {
			if v == 2 {
				out++
			}
		}
		fmt.Println(out)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	r := bufio.NewReader(os.Stdin)

	var n int
	fmt.Fscanf(r, "%d\n", &n)

	mp := make(map[int]int)
	for i := 0; i < n; i++ {
		var s int
		fmt.Fscanf(r, "%d", &s)
		mp[s]++
	}

	count := 0
	for _, v := range mp {
		if v > 2 {
			fmt.Println("-1")
			return
		} else if v == 2 {
			count++
		}
	}

	fmt.Println(count)
}

package main

import (
    "strconv"
    "bufio"
    "os"
    "fmt"
)
// var file, _ = os.Open("input.txt")
// var outfile, _ = os.Create("output.txt")
// var in = bufio.NewScanner(file)
// var out = bufio.NewWriter(outfile)
var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
    if !in.Scan() {
        panic("Scan error")
    }
    return in.Text()
}

func nextInt() int {
    ret, _ := strconv.Atoi(next())
    return ret
}

func nextFloat() float64 {
    ret, _ := strconv.ParseFloat(next(), 64)
    return ret
}

func main() {
    defer out.Flush()
    in.Split(bufio.ScanWords)
    n := nextInt()
    m := make(map[int]int)
    for i := 0; i < n; i++ {
        x := nextInt()
        m[x]++
        if x != 0 && m[x] > 2 {
            fmt.Fprintln(out, -1)
            return
        }
    }
    ans := 0
    for k := range m {
        if m[k] == 2 {
            ans++
        }
    }

    fmt.Fprintln(out, ans)

}


/*
URL:
https://codeforces.com/problemset/problem/1110/C
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	q int
	a int
)

func main() {
	q = ReadInt()
	for i := 0; i < q; i++ {
		a = ReadInt()

		solve()
	}
}

func solve() {
	ub := 0
	for i := 0; i < 30; i++ {
		if NthBit(a, i) == 1 {
			ub = i
		}
	}

	if ub+1 != PopCount(a) {
		ans := 1<<uint(ub+1) - 1
		fmt.Println(ans)
		return
	}

	memo := TrialDivision(a)
	mini := 1 << 30
	for k := range memo {
		ChMin(&mini, k)
	}

	ans := 1
	for k, v := range memo {
		if k == mini {
			ans *= PowInt(k, v-1)
			continue
		}
		ans *= PowInt(k, v)
	}
	fmt.Println(ans)
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// TrialDivision returns the result of prime factorization of integer N.
func TrialDivision(n int) map[int]int {
	var i, exp int
	p := map[int]int{}

	if n <= 1 {
		panic(errors.New("[argument error]: TrialDivision only accepts a NATURAL number"))
	}

	for i = 2; i*i <= n; i++ {
		exp = 0
		for n%i == 0 {
			exp++
			n /= i
		}

		if exp == 0 {
			continue
		}
		p[i] = exp
	}
	if n > 1 {
		p[n] = 1
	}

	return p
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num int, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num int, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num int, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func main() {
	defer writer.Flush()

	// for ii := 2; ii < 27; ii++ {

	// 	i := 1 << uint(ii)
	// 	i--

	// 	mx := 0
	// 	for j := 1; j < i; j++ {
	// 		t1 := gcd(i^j, i&j)
	// 		if t1 > mx {
	// 			mx = t1
	// 		}
	// 	}
	// 	fmt.Print(mx, ",")

	// }

	hsmp := make(map[int]int)

	arr := []int{1, 1, 5, 1, 21, 1, 85, 73, 341, 89, 1365, 1, 5461, 4681, 21845, 1, 87381, 1, 349525, 299593, 1398101, 178481, 5592405, 1082401, 22369621}

	for i := 0; i < 25; i++ {
		t1 := 1 << uint(i+2)
		t1--
		hsmp[t1] = arr[i]
	}

	// fmt.Println(hsmp)

	var q, t1 int

	scanf("%d\n", &q)

	for i := 0; i < q; i++ {
		scanf("%d\n", &t1)
		val, ok := hsmp[t1]
		if ok {
			printf("%d\n", val)
			continue
		}
		hsbit := 0
		for t1 > 0 {
			hsbit++
			t1 /= 2
		}
		printf("%d\n", 1<<uint(hsbit)-1)
	}
}

package main

import (
	"bufio"
	"flag"
	"fmt"
	"io"
	"math/big"
	"math/bits"
	"os"
)

var reader *bufio.Reader
var writer *bufio.Writer

var inputFile = flag.String("input", "", "")

func init() {
	flag.Parse()
	var i io.Reader
	if *inputFile != "" {
		i, _ = os.Open(*inputFile)
	} else {
		i = os.Stdin
	}
	reader = bufio.NewReaderSize(i, 1<<20)
	writer = bufio.NewWriterSize(os.Stdout, 1<<20)
}

func println(a ...interface{}) {
	_, _ = fmt.Fprintln(writer, a...)
}

func printf(format string, a ...interface{}) {
	_, _ = fmt.Fprintf(writer, format, a...)
}

func scanf(format string, a ...interface{}) {
	_, _ = fmt.Fscanf(reader, format, a...)
}

func scan(a interface{}) {
	_, _ = fmt.Fscan(reader, a)
}

func NextInt64() int64 {
	var res int64
	scan(&res)
	return res
}

func NextInt() int {
	var res int
	scan(&res)
	return res
}

func NextIntArray(n int) []int {
	res := make([]int, n)
	for i := range res {
		scan(&res[i])
	}
	return res
}

func NextString() string {
	var res string
	scan(&res)
	return res
}

func NextBigInt() *big.Int {
	n := new(big.Int)
	n, _ = n.SetString(NextString(), 10)
	return n
}

func gcd(a, b int) int {
	for ; b > 0; a, b = b, a%b {
	}
	return a
}

func solve(a int) int {
	var res int
	for i := 1; i < a; i++ {
		g := gcd(i^a, i&a)
		if g > res {
			res = g
		}
	}
	return res
}

func main() {
	defer writer.Flush()

	q := NextInt()

l:
	for ; q > 0; q-- {
		x := uint(NextInt())

		if x&(x+1) == 0 {
			for t := uint(2); t*t <= x; t++ {
				if x%t == 0 {
					println(x / t)
					continue l
				}
			}
			println(1)
			continue l
		}

		l := bits.Len(x)
		println((1 << uint(l)) - 1)
	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	var k int
	fmt.Fscan(reader, &k)
	for i := 0; i < k; i++ {
		var request int64
		fmt.Fscan(reader, &request)
		var j uint
		for j = 25; j >= 0; j-- {
			var power int64 = 1 << j
			if request == power-1 {
				fmt.Println(largestDiv(request))
				break
			}
			if request >= (1 << j) {
				fmt.Println(1<<(j+1) - 1)
				break
			}
		}
	}
}

func largestDiv(request int64) int64 {
	var i float64
	for i = 3; i <= math.Sqrt(float64(request)); i += 2 {
		if request%int64(i) == 0 {
			return request / int64(i)
		}
	}
	return 1
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	var k int
	fmt.Fscan(reader, &k)
	for i := 0; i < k; i++ {
		var request int64
		fmt.Fscan(reader, &request)
		var j uint
		for j = 25; j >= 0; j-- {
			var power int64 = 1 << j
			if request == power-1 {
				fmt.Println(largestDiv(request))
				break
			}
			if request >= (1 << j) {
				fmt.Println(1<<(j+1) - 1)
				break
			}
		}
	}
}

func largestDiv(request int64) int64 {
	var i float64
	for i = 3; i <= math.Sqrt(float64(request)); i += 2 {
		if request%int64(i) == 0 {
			fmt.Println(request / int64(i))
		}
	}
	return 1
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	var k int
	fmt.Fscan(reader, &k)
	for i := 0; i < k; i++ {
		var request int64
		fmt.Fscan(reader, &request)
		var j uint
		for j = 25; j >= 0; j-- {
			var power int64 = 1 << j
			if request == power-1 {
				found := false
				var k int64
				for k = 1; k < request/2; k++ {
					if request%(k*2+1) == 0 {
						fmt.Println(k)
						found = true
						break
					}
				}
				if !found {
					fmt.Println(i)
				}
				break
			}
			if request >= (1 << j) {
				fmt.Println(1<<(j+1) - 1)
				break
			}
		}
	}
}

/*
URL:
https://codeforces.com/problemset/problem/1110/C
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	q int
	a int
)

func main() {
	q = ReadInt()
	for i := 0; i < q; i++ {
		a = ReadInt()

		solve()
	}
}

func solve() {
	ub := 0
	for i := 0; i < 30; i++ {
		if NthBit(a, i) == 1 {
			ub = i
		}
	}

	if ub+1 != PopCount(a) {
		ans := 1<<uint(ub+1) - 1
		fmt.Println(ans)
		return
	}

	memo := TrialDivision(a)
	mini := 1 << 30
	for k := range memo {
		ChMin(&mini, k)
	}

	ans := 1
	for k, v := range memo {
		if k == mini {
			continue
		}
		ans *= PowInt(k, v)
	}
	fmt.Println(ans)
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// TrialDivision returns the result of prime factorization of integer N.
func TrialDivision(n int) map[int]int {
	var i, exp int
	p := map[int]int{}

	if n <= 1 {
		panic(errors.New("[argument error]: TrialDivision only accepts a NATURAL number"))
	}

	for i = 2; i*i <= n; i++ {
		exp = 0
		for n%i == 0 {
			exp++
			n /= i
		}

		if exp == 0 {
			continue
		}
		p[i] = exp
	}
	if n > 1 {
		p[n] = 1
	}

	return p
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num int, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num int, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num int, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}


package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

func main() {
    var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		start := 1
		end := n
		total := get(1, n)
		mid := getMid(start, end, total, k)
		for {
			if end == start {
				found(start)
				break
			}
			f := get(start, mid-1)
			if f >= k {
				end = mid - 1
				total = f
			} else {
				start = mid
				k -= f
				total -= f
			}
			mid = getMid(start, end, total, k)
		}
	}
}

func getMid(start, end, total, num int) int {
	// var point float64 = float64(num) / float64(total+1)
	var point float64 = 0.5
	ret := int(point*float64(end-start+1)) + start
	if ret <= start {
		ret = start + 1
	}
	if ret > end {
		ret = end
	}
	return ret
}

type sel struct {
	start int
	end   int
}

type BIT struct {
    vals [200002]int
}

func (b* BIT) Add(pos int){
    pos += 1
    for pos < 200001 {
        b.vals[pos] += 1
        pos += (pos & -pos)
    }
}

func (b* BIT) getPrefix(pos int) int {
    pos += 1
    res := 0
    for pos > 0 {
        res += b.vals[pos]
        pos -= (pos & -pos)
    }
    return res
}

var tree = &BIT{};

func (b* BIT) Get(l, r int) int {
    res := b.getPrefix(r)
    if l != 0 {
        res -= b.getPrefix(l - 1)
    }
    return res
}

var sols = map[sel]int{}

func removeSol(p int) {
    tree.Add(p)
    return
	for k, v := range sols {
		if k.start <= p && k.end >= p {
			sols[k] = v - 1
		}
	}
}

func get(s, e int) int {
    sub := tree.Get(s, e)
	if r, ok := sols[sel{s, e}]; ok {
		return r - sub
	}
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	ret := e - s + 1 - k
	sols[sel{s, e}] = ret + sub
	return ret - sub
}

func found(p int) {
	fmt.Printf("! %d\n", p)
	removeSol(p)
}

package main
import(."fmt";."sort")

//github.com/EndlessCheng/codeforces-go
func main(){
	var n,m,k int
	Scan(&n,&m)
	t:=make([]int,n+1)
	s:=make([]int,n+1)
	for i:=range s{s[i]=-1}
	for;m>0;m--{
		Scan(&k)
		p:=1+Search(n-1,func(r int)bool{
			r++
			c:=0
			for i:=r;i>0;i&=i-1{c+=t[i]}
			if s[r]<0{
				Println("?",1,r)
				Scan(&s[r])
				s[r]-=c
			}
			return s[r]+c+k<=r
		})
		Println("!",p)
		for;p<=n;p+=p&-p{t[p]++}
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
	"sort"
)

// github.com/EndlessCheng/codeforces-go
type fenwick struct {
	tree []int64
}

func newFenwickTree(n int) fenwick {
	return fenwick{make([]int64, n)}
}
func (f fenwick) add(i int, val int) {
	for ; i < len(f.tree); i += i & -i {
		f.tree[i] += int64(val)
	}
}
func (f fenwick) sum(i int) (res int64) {
	for ; i > 0; i &= i - 1 {
		res += f.tree[i]
	}
	return
}

func run(_r io.Reader, _w io.Writer, Fscan func(r io.Reader, a ...interface{}) (n int, err error), Fprintln func(w io.Writer, a ...interface{}) (n int, err error)) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)

	var n, t, k int
	Fscan(in, &n, &t)

	q := func(l, r int) (resp int) {
		Fprintln(out, "?", l, r)
		out.Flush()
		Fscan(in, &resp)
		if resp == -1 {
			panic(r)
		}
		return
	}

	f := newFenwickTree(n + 10)
	prefix := newFenwickTree(n + 10)
	vis := make([]bool, n+1)

	for ti := 0; ti < t; ti++ {
		Fscan(in, &k)
		if k == -1 {
			panic(ti)
		}
		ans := sort.Search(n-1, func(r int) bool {
			r++
			var c int
			if vis[r] {
				c = int(f.sum(r))
			} else {
				c = q(1, r)
				pre := int(prefix.sum(r))
				f.add(r, c-pre)
				f.add(r+1, -(c - pre))
				vis[r] = true
			}
			return c+k <= r
		})
		ans++
		Fprintln(out, "!", ans)
		out.Flush()
		vis[ans] = true
		f.add(ans, 1)
		prefix.add(ans, 1)
	}
}

func main() { run(os.Stdin, os.Stdout, Fscan, Fprintln) }

package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

func main() {
	var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		start := 1
		end := n
		total := get(1, n)
		mid := getMid(start, end, total, k)
		for {
			if end == start {
				found(start)
				break
			}
			f := get(start, mid-1)
			if f >= k {
				end = mid - 1
				total = f
			} else {
				start = mid
				k -= f
				total -= f
			}
			mid = getMid(start, end, total, k)
		}
	}
}

func getMid(start, end, total, num int) int {
	// var point float64 = float64(num) / float64(total+1)
	var point float64 = 0.5
	ret := int(point*float64(end-start+1)) + start
	if ret <= start {
		ret = start + 1
	}
	if ret > end {
		ret = end
	}
	return ret
}

type sel struct {
	start int
	end   int
}

type BIT struct {
    vals [200002]int
}

var tree = &BIT{};

func (b* BIT) Add(pos int){
    for pos < 200002 {
        b.vals[pos] += 1
        pos += (pos & -pos)
    }
}

func (b* BIT) getPrefix(pos int) int {
    res := 0
    for pos > 0 {
        res += b.vals[pos]
        pos -= (pos & -pos)
    }
    return res
}

func (b* BIT) Get(l, r int) int {
    return b.getPrefix(r) - b.getPrefix(l - 1)
}

var sols = map[sel]int{}

func removeSol(p int) {
    tree.Add(p)
    return
	for k, v := range sols {
		if k.start <= p && k.end >= p {
			sols[k] = v - 1
		}
	}
}

func get(s, e int) int {
    sub := tree.Get(s, e)
	if r, ok := sols[sel{s, e}]; ok {
		return r - sub
	}
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	ret := e - s + 1 - k
	sols[sel{s, e}] = ret + sub
	return ret - sub
}

func found(p int) {
	fmt.Printf("! %d\n", p)
	removeSol(p)
}

package main

import (
    "fmt"
)

type segment struct {
    left int
    right int
}

var strlen int
var cache = map[segment]int{}

func decrease(ind, left, right int) {
    cache[segment{left, right}]--

    if (left != right) {
        var mid = (left + right) / 2
        if (ind <= mid) {
            decrease(ind, left, mid)
        } else {
            decrease(ind, mid + 1, right)
        }
    }
}

func solve_task() {
    var k int
    fmt.Scan(&k)

    var l_bord = 0
    var r_bord = strlen - 1

    for r_bord - l_bord > 0 {
        var m_bord = (l_bord + r_bord) / 2
        var sg = segment{l_bord, m_bord}
        cnt, is_cached := cache[sg]
        if !is_cached {
            fmt.Println("?", l_bord + 1, m_bord + 1)
            fmt.Scan(&cnt)
            cnt = sg.right - sg.left + 1 - cnt
            cache[sg] = cnt
        }

        if k <= cnt {
            r_bord = m_bord
        } else {
            k -= cnt
            l_bord = m_bord + 1
        }
    }
    fmt.Printf("! %d\n", l_bord + 1)
    decrease(l_bord, 0, strlen - 1)
}

func main() {
    var n_tasks int
    fmt.Scan(&strlen, &n_tasks)
    for i_task := 0; i_task < n_tasks; i_task++ {
        solve_task()
    }
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var cache map[string]int

func requests(l, r int, reader *bufio.Reader) (sum int) {
	// var arr []int = []int{100, 1, 0, 1, 1, 0, 1}
	// for i := l; i <= r; i++ {
	// 	sum += arr[i]
	// }
	key := strconv.Itoa(l) + "-" + strconv.Itoa(r)
	var ok bool
	sum, ok = cache[key]
	if ok {
		return
	}
	fmt.Printf("? %d %d\n", l, r)
	os.Stdout.Sync()
	fmt.Fscanf(reader, "%d\n", &sum)

	cache[key] = sum
	return
}

func updateCache(l, r, index int) {
	var mid, sum int
	var key string
	var ok bool
	for l < r {
		mid = l + (r-l)/2

		if mid < index {
			l = mid + 1
		} else {
			r = mid
		}

		key = strconv.Itoa(l) + "-" + strconv.Itoa(r)
		sum, ok = cache[key]
		if ok {
			cache[key] = sum + 1
		}
	}
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	var n, t, k int

	fmt.Fscanf(reader, "%d %d\n", &n, &t)
	cache = make(map[string]int, n)
	for ; t > 0; t-- {
		fmt.Fscanf(reader, "%d\n", &k)
		l, r := 1, n
		var mid, had int
		for l < r {
			mid = l + (r-l)/2
			had = mid - l + 1 - requests(l, mid, reader)
			if had < k {
				k = k - had
				l = mid + 1
			} else {
				r = mid
			}
		}

		updateCache(1, n, l)

		fmt.Printf("! %d\n", l)
	}
}

package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

type BIT []int

func NewBit(l int) BIT {
	return make(BIT, l)
}

func (bit BIT) Add(p int, inc int) {
	if p == 0 {
		bit[p] += inc
		return
	}
	for p < len(bit) {
		bit[p] += inc
		p += (p & -p)
	}
}

func (bit BIT) Get(s, e int) int {
	return bit.getPrefix(e) - bit.getPrefix(s-1)
}

func (bit BIT) getPrefix(p int) int {
	if p < 0 {
		return 0
	}
	var total int = 0
	for p > 0 {
		total += bit[p]
		p -= (p & -p)
	}
	total += bit[p]
	return total
}

func main() {
	var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		oldStart := 0
		oldEnd := n + 1
		start := 1
		end := n
		total := get(1, n)
		mid := getMid(start, end, total, k)
		for {
			if oldStart == start && oldEnd == end {
				os.Exit(2)
			}
			oldStart = start
			oldEnd = end
			if end == start {
				found(start)
				break
			}
			f := get(start, mid-1)
			if f >= k {
				end = mid - 1
				total = f
			} else {
				start = mid
				k -= f
				total -= f
			}
			mid = getMid(start, end, total, k)
		}
	}
}

func getMid(start, end, total, num int) int {
	// var point float64 = float64(num) / float64(total+1)
	var point float64 = 0.5
	ret := int(point*float64(end-start+1)) + start
	if ret <= start {
		ret = start + 1
	}
	if ret > end {
		ret = end
	}
	return ret
}

type sel struct {
	start int
	end   int
}

var sols = map[sel]int{}
var bit = NewBit(200002)

func removeSol(p int) {
	bit.Add(p, -1)
}

func get(s, e int) int {
	adj := bit.Get(s, e)
	if r, ok := sols[sel{s, e}]; ok {
		return r + adj
	}
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	ret := e - s + 1 - k
	sols[sel{s, e}] = ret
	return ret + adj
}

func found(p int) {
	fmt.Printf("! %d\n", p)
	removeSol(p)
}

package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

func main() {
	var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		start := 1
		end := n
		total := get(1, n)
		mid := getMid(start, end, total, k)
		for {
			if end == start {
				found(start)
				break
			}
			f := get(start, mid-1)
			if f >= k {
				end = mid - 1
				total = f
			} else {
				start = mid
				k -= f
				total -= f
			}
			mid = getMid(start, end, total, k)
		}
	}
}

func getMid(start, end, total, num int) int {
	// var point float64 = float64(num) / float64(total+1)
	var point float64 = 0.5
	ret := int(point*float64(end-start+1)) + start
	if ret == start {
		ret = start + 1
	}
	return ret
}

type sel struct {
	start int
	end   int
}

var sols = map[sel]int{}

func removeSol(p int) {
	for k, v := range sols {
		if k.start <= p && k.end >= p {
			sols[k] = v - 1
		}
	}
}

func get(s, e int) int {
	if r, ok := sols[sel{s, e}]; ok {
		return r
	}
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	return e - s + 1 - k
}

func found(p int) {
	fmt.Printf("! %d\n", p)
	removeSol(p)
}

package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

func main() {
	var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		start := 1
		end := n
		total := get(1, n)
		mid := getMid(start, end, total, k)
		for {
			if end == start {
				found(start)
				break
			}
			f := get(start, mid-1)
			if f >= k {
				end = mid - 1
				total = f
			} else {
				start = mid
				k -= f
				total -= f
			}
			mid = getMid(start, end, total, k)
		}
	}
}

func getMid(start, end, total, num int) int {
	var point float64 = float64(num) / float64(total+1)
	ret := int(point*float64(end-start+1)) + start
	if ret == start {
		ret = start + 1
	}
	return ret
}

type sel struct {
	start int
	end   int
}

var sols = map[sel]int{}

func removeSol(p int) {
	for k, v := range sols {
		if k.start <= p && k.end >= p {
			sols[k] = v - 1
		}
	}
}

func get(s, e int) int {
	if r, ok := sols[sel{s, e}]; ok {
		return r
	}
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	return e - s + 1 - k
}

func found(p int) {
	fmt.Printf("! %d\n", p)
	removeSol(p)
}

package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

func main() {
	var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		start := 1
		end := n
		total := get(1, n)
		mid := getMid(start, end, total, k)
		for {
			if end == start {
				found(start)
				break
			}
			f := get(start, mid-1)
			if f >= k {
				end = mid - 1
				total = f
			} else {
				start = mid
				k -= f
				total -= f
			}
			mid = getMid(start, end, total, k)
		}
	}
}

func getMid(start, end, total, num int) int {
	var point float64 = float64(num) / float64(total+1)
	ret := int(point*float64(end-start+1)) + start
	if ret == start {
		ret = start + 1
	}
	return ret
}

func get(s, e int) int {
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	return e - s + 1 - k
}

func found(p int) {
	fmt.Printf("! %d\n", p)
}

package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

func main() {
	var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		start := 1
		end := n
		total := get(1, n)
		mid := int(float64(1)/float64(2)*float64(end-start+1)) + start
		// if k > total/2 {
		// 	mid = int(float64(total-k)/float64(total)*float64(end-start+1)) + start
		// }
		for {
			if end == start {
				found(start)
				break
			}
			f := get(start, mid-1)
			if f >= k {
				end = mid - 1
				total = f
			} else {
				start = mid
				k -= f
				total -= f
			}
			mid = int(float64(1)/float64(2)*float64(end-start+1)) + start
			// if k > total/2 {
			// 	mid = int(float64(total-k)/float64(total)*float64(end-start+1)) + start
			// }
		}
	}
}

func get(s, e int) int {
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	return e - s + 1 - k
}

func found(p int) {
	fmt.Printf("! %d\n", p)
}

package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

func main() {
	var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		start := 1
		end := n
		total := get(1, n)
		mid := k/total*(end-start) + start
		for {
			if end == start {
				found(start)
				break
			}
			f := get(start, mid)
			if f >= k {
				end = mid
				total = f
			} else {
				start = mid + 1
				k -= f
				total = total - f
			}
			mid = k/total*(end-start) + start
		}
	}
}

func get(s, e int) int {
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	return e - s + 1 + k
}

func found(p int) {
	fmt.Printf("! %d\n", 5)
}

package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

func main() {
	var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		start := 1
		end := n
		total := get(1, n)
		get(1, n)
		get(1, n/2)
		mid := k/total*(end-start) + start
		for {
			if end == start {
				found(start)
				break
			}
			f := get(start, mid)
			if f >= k {
				end = mid
				total = f
			} else {
				start = mid + 1
				k -= f
				total = total - f
			}
			mid = k/total*(end-start) + start
		}
	}
}

func get(s, e int) int {
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	return e - s + 1 + k
}

func found(p int) {
	fmt.Printf("! %d\n", p)
}

package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

func main() {
	var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		start := 1
		end := n
		total := get(1, n)
		mid := k/total*(end-start) + start
		for {
			if end == start {
				found(start)
				break
			}
			f := get(start, mid)
			if f >= k {
				end = mid
				total = f
			} else {
				start = mid + 1
				k -= f
				total = total - f
			}
			mid = k/total*(end-start) + start
		}
	}
}

func get(s, e int) int {
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	return e - s + 1 + k
}

func found(p int) {
	fmt.Printf("! %d\n", p)
}

package main
import(."fmt";."sort")

// github.com/EndlessCheng/codeforces-go
func main(){
	var n,m,k int
	Scan(&n,&m)
	t:=make([]int,n+1)
	s:=make([]int,n+1)
	for i:=range s{s[i]=-1}
	for;m>0;m--{
		Scan(&k)
		p:=1+Search(n-1,func(r int)bool{
			if r++;s[r]<0{
				Println("?",1,r)
				Scan(&s[r])
			}
			c:=s[r]
			for i:=r;i>0;i&=i-1{c-=t[i]}
			return c+k<=r
		})
		Println("!",p)
		for;p<=n;p+=p&-p{t[p]++}
	}
}

package main

import (
	"bufio"
	. "fmt"
	"os"
	"sort"
)

// github.com/EndlessCheng/codeforces-go
type fenwick struct {
	tree []int64
}

func newFenwickTree(n int) fenwick {
	return fenwick{make([]int64, n)}
}
func (f fenwick) add(i int, val int) {
	for ; i < len(f.tree); i += i & -i {
		f.tree[i] += int64(val)
	}
}
func (f fenwick) sum(i int) (res int64) {
	for ; i > 0; i &= i - 1 {
		res += f.tree[i]
	}
	return
}

func ioq() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)

	var n, t, k int
	Fscan(in, &n, &t)

	q := func(l, r int) (resp int) {
		Fprintln(out, "?", l, r)
		out.Flush()
		Fscan(in, &resp)
		if resp == -1 {
			panic(r)
		}
		return
	}

	f := newFenwickTree(n + 10)
	vis := make([]bool, n+1)

	for ti := 0; ti < t; ti++ {
		Fscan(in, &k)
		if k == -1 {
			panic(ti)
		}
		ans := sort.Search(n-1, func(r int) bool {
			r++
			var c int
			if vis[r] {
				c = int(f.sum(r))
			} else {
				c = q(1, r)
				f.add(r, c)
				f.add(r+1, -c)
				vis[r] = true
			}
			return c+k <= r
		})
		ans++
		Fprintln(out, "!", ans)
		out.Flush()
		vis[ans] = true
		f.add(ans, 1)

	}
}

func main() { ioq() }

package main

import (
	"bufio"
	. "fmt"
	"os"
	"sort"
)

// github.com/EndlessCheng/codeforces-go
type fenwick struct {
	tree []int
}

func newFenwickTree(n int) fenwick {
	return fenwick{make([]int, n)}
}
func (f fenwick) add(i int, val int) {
	for ; i < len(f.tree); i += i & -i {
		f.tree[i] += val
	}
}
func (f fenwick) sum(i int) (res int) {
	for ; i > 0; i &= i - 1 {
		res += f.tree[i]
	}
	return
}
func (f fenwick) query(l, r int) (res int) { // [l,r]
	return f.sum(r) - f.sum(l-1)
}

func ioq() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)

	var n, t, k int
	Fscan(in, &n, &t)

	q := func(l, r int) (resp int) {
		Fprintln(out, "?", l, r)
		out.Flush()
		Fscan(in, &resp)
		return
	}

	f := newFenwickTree(n + 10)
	vis := make([]bool, n+1)

	for ti := 0; ti < t; ti++ {
		Fscan(in, &k)
		ans := sort.Search(n-1, func(r int) bool {
			r++
			var c int
			if vis[r] {
				c = f.sum(r)
			} else {
				c = q(1, r)
				f.add(r, c)
				f.add(r+1, -c)
				vis[r] = true
			}
			return c+k <= r
		})
		ans++
		Fprintln(out, "!", ans)
		out.Flush()
		vis[ans] = true
		f.add(ans, 1)

	}
}

func main() { ioq() }

package main

import (
	"bufio"
	. "fmt"
	"os"
	"sort"
)

// github.com/EndlessCheng/codeforces-go
type fenwick struct {
	tree []int
}

func newFenwickTree(n int) fenwick {
	return fenwick{make([]int, n)}
}
func (f fenwick) add(i int, val int) {
	for ; i < len(f.tree); i += i & -i {
		f.tree[i] += val
	}
}
func (f fenwick) sum(i int) (res int) {
	for ; i > 0; i &= i - 1 {
		res += f.tree[i]
	}
	return
}
func (f fenwick) query(l, r int) (res int) { // [l,r]
	return f.sum(r) - f.sum(l-1)
}

func ioq() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)

	var n, t, k int
	Fscan(in, &n, &t)

	q := func(l, r int) (resp int) {
		Fprintln(out, "?", l, r)
		out.Flush()
		Fscan(in, &resp)
		return
	}

	f := newFenwickTree(n + 10)
	vis := make([]bool, n+1)

	for ti := 0; ti < t; ti++ {
		Fscan(in, &k)
		ans := sort.Search(n-1, func(r int) bool {
			r++
			var c int
			if vis[r] {
				c = f.sum(r)
			} else {
				c = q(1, r)
				f.add(r, c)
				f.add(r+1, -c)
				vis[r] = true
			}
			return c+k <= r
		})
		ans++
		Fprintln(out, "!", ans)
		out.Flush()

		f.add(ans, 1)

	}
}

func main() { ioq() }

package main

import (
	"fmt"
	"io"
	"os"
)

func ReadByte() byte {
	return ReadBytes(1)[0]
}

func ReadNL() byte {
	var nl byte
	for nl != 0x0a {
		nl = ReadByte()
	}
	return nl
}

func ReadBytes(n int) []byte {
	p := make([]byte, n)
	_, err := io.ReadFull(os.Stdin, p)
	if err != nil {
		panic(err)
	}
	return p
}

func main() {
	var n int
	var t int
	_, err := fmt.Scanf("%d %d", &n, &t)
	if err != nil {
		panic(err)
	}
	for i := 0; i < t; i++ {
		ReadNL()
		var k int
		_, err := fmt.Scanf("%d", &k)
		if err != nil {
			panic(err)
		}
		if k == -1 {
			os.Exit(0)
		}
		start := 1
		end := n
		total := get(1, n)
		mid := getMid(start, end, total, k)
		for {
			if end == start {
				found(start)
				break
			}
			f := get(start, mid-1)
			if f >= k {
				end = mid - 1
				total = f
			} else {
				start = mid
				k -= f
				total -= f
			}
			mid = getMid(start, end, total, k)
		}
	}
}

func getMid(start, end, total, num int) int {
	// var point float64 = float64(num) / float64(total+1)
	var point float64 = 0.5
	ret := int(point*float64(end-start+1)) + start
	if ret <= start {
		ret = start + 1
	}
	if ret > end {
		ret = end
	}
	return ret
}

type sel struct {
	start int
	end   int
}

type BIT struct {
    vals [200002]int
}

func (b* BIT) Add(pos int){
    pos += 1
    for pos > 0 {
        b.vals[pos] += 1
        pos -= (pos & -pos)
    }
}

func (b* BIT) getPrefix(pos int) int {
    pos += 1
    res := 0
    for pos < 200002 {
        res += b.vals[pos]
        pos += (pos & -pos)
    }
    return res
}

var tree = &BIT{};

func (b* BIT) Get(l, r int) int {
    res := b.getPrefix(r)
    if l != 0 {
        res -= b.getPrefix(l - 1)
    }
    return res
}

var sols = map[sel]int{}

func removeSol(p int) {
    tree.Add(p)
    return
	for k, v := range sols {
		if k.start <= p && k.end >= p {
			sols[k] = v - 1
		}
	}
}

func get(s, e int) int {
    sub := tree.Get(s, e)
	if r, ok := sols[sel{s, e}]; ok {
		return r - sub
	}
	fmt.Printf("? %d %d\n", s, e)
	ReadNL()
	var k int
	_, err := fmt.Scanf("%d", &k)
	if err != nil {
		panic(err)
	}
	if k == -1 {
		os.Exit(0)
	}
	ret := e - s + 1 - k
	sols[sel{s, e}] = ret
	return ret - sub
}

func found(p int) {
	fmt.Printf("! %d\n", p)
	removeSol(p)
}

package main

import (
    "fmt"
)

type segment struct {
    left int
    right int
}

var strlen int
var cache = map[segment]int{}

func decrease(ind, left, right int) {
    cache[segment{left, right}]--

    if (left != right) {
        var mid = (left + right) / 2
        if (ind <= mid) {
            decrease(ind, left, mid)
        } else {
            decrease(ind, mid + 1, right)
        }
    }
}

func solve_task() {
    var k int
    fmt.Scanln(&k)

    var l_bord = 0
    var r_bord = strlen - 1

    for r_bord - l_bord > 0 {
        var m_bord = (l_bord + r_bord) / 2
        var sg = segment{l_bord, m_bord}
        cnt, is_cached := cache[sg]
        if !is_cached {
            fmt.Println("?", l_bord + 1, m_bord + 1)
            fmt.Scan(&cnt)
            cnt = sg.right - sg.left + 1 - cnt
            cache[sg] = cnt
        }

        if k <= cnt {
            r_bord = m_bord
        } else {
            k -= cnt
            l_bord = m_bord + 1
        }
    }
    fmt.Printf("! %d\n", l_bord + 1)
    decrease(l_bord, 0, strlen - 1)
}

func main() {
    var n_tasks int
    fmt.Scanln(&strlen, &n_tasks)
    for i_task := 0; i_task < n_tasks; i_task++ {
        solve_task()
    }
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func requests(l, r int, reader *bufio.Reader) (sum int) {
	// var arr []int = []int{100, 1, 0, 1, 1, 0, 1}
	// for i := l; i <= r; i++ {
	// 	sum += arr[i]
	// }
	fmt.Printf("? %d %d\n", l, r)
	os.Stdout.Sync()
	fmt.Fscanf(reader, "%d\n", &sum)

	return
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	var n, t, k int

	fmt.Fscanf(reader, "%d %d\n", &n, &t)
	for ; t > 0; t-- {
		fmt.Fscanf(reader, "%d\n", &k)
		l, r := 1, n
		var mid, had int
		for l < r {
			mid = l + (r-l)/2
			had = mid - l + 1 - requests(l, mid, reader)
			if had < k {
				k = k - had
				l = mid + 1
			} else {
				r = mid
			}
		}

		fmt.Printf("! %d\n", l)
	}
}