package main

import "bufio"
import "math"
import "os"
import "strconv"

var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriterSize(os.Stdout, 300000)

func init() {
  in.Split(bufio.ScanWords)
  buf := make([]byte, 300000, 300000)
  in.Buffer(buf, 0)
}

func readInt() int {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())
  return n
}

func main() {
  var ac [2]int
  n := readInt()
  m := readInt()

  for i := 0; i < n; i++ {
    a := readInt()

    if a == -1 {
      ac[0]++
    } else {
      ac[1]++
    }
  }

  min := math.Min(float64(ac[0]), float64(ac[1]))

  for i := 0; i < m; i++ {
    l := readInt()
    r := readInt()
    len := r - l + 1

    if len%2 == 0 && len/2 <= int(min) {
      out.WriteString("1\n")
    } else {
      out.WriteString("0\n")
    }
  }

  out.Flush()
}

package main

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

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    scanner.Split(bufio.ScanWords)
    writer := bufio.NewWriter(os.Stdout)
    var n,m,max int
    fmt.Scan(&n,&m)
    x := make(map[int]int)
    for i := 0; i < n; i++ {
        scanner.Scan()
        a, _ := strconv.Atoi(scanner.Text())
        x[a+1]++
    }
    if x[0] < x[2]{ max = x[0] } else { max = x[2] }
    for i := 0; i < m; i++ {
        scanner.Scan()
        l, _ := strconv.Atoi(scanner.Text())
        scanner.Scan()
        r, _ := strconv.Atoi(scanner.Text())
        if ((r-l+1)%2 == 0) && ((r-l+1)/2 <= max) { writer.WriteRune('1') } else { writer.WriteRune('0') }
        writer.WriteRune('\n')
    }
    writer.Flush()
}

package main

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

func read_ints(in *bufio.Reader) []int {
	line, _ := in.ReadString('\n')
	words := strings.Fields(line)
	a := make([]int, len(words))
	for i := range words {
		a[i], _ = strconv.Atoi(words[i])
	}
	return a
}

func main() {
	var x []int
	in := bufio.NewReader(os.Stdin)
	cnt1, cnt2 := 0, 0
	m := read_ints(in)[1]
	a := read_ints(in)
	for _, v := range a {
		if v == -1 {
			cnt1++
		} else {
			cnt2++
		}
	}
	for i := 0; i < m; i++ {
		x = read_ints(in)
		length := x[1] - x[0] + 1
		if length&1 == 0 && length>>1 <= cnt1 && length>>1 <= cnt2 {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

// 302A-mic
package main

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

func main() {
    var n, m, l, r int
    s := bufio.NewScanner(os.Stdin)
    s.Split(bufio.ScanWords)
    var a [200005]int
    fmt.Scan(&n, &m)
    var cou1, cou2 int
    for i := 0; i < n; i++ {
        s.Scan()
        t, _ := strconv.Atoi(s.Text())
        a[i] = t
        if a[i] == 1 {
            cou1++
        } else {
            cou2++
        }
    }
    for ; m > 0; m-- {
        s.Scan()
        z, _ := strconv.Atoi(s.Text())
        l = z
        s.Scan()
        u, _ := strconv.Atoi(s.Text())
        r = u
        //fmt.Scan(&l, &r)
        x := r - l + 1
        if x%2 == 1 {
            fmt.Println("0")
        } else {
            if x/2 <= cou1 && x/2 <= cou2 {
                fmt.Println("1")
            } else {
                fmt.Println("0")
            }
        }
    }
}

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

func main() {
	var i,j,u,c,n,m int64
	input:= bufio.NewScanner(os.Stdin)
	input.Split(bufio.ScanWords)
	out := bufio.NewWriter(os.Stdout)
	fmt.Scan(&n,&m)
	for i=0;i<n;i++ {
		input.Scan()
		aa,_:= strconv.Atoi(input.Text())
		j=int64(aa)
		//fmt.Scan(&j)
		if j<0 {
			c++
		} else {
			u++
		}
	}
	if c>u {
		c=u
	}
	c*=2
	for i=0;i<m;i++ {
		input.Scan()
		bb,_:= strconv.Atoi(input.Text())
		u=int64(bb)
		input.Scan()
		cc,_:= strconv.Atoi(input.Text())
		j=int64(cc)
		//fmt.Scan(&u,&j)
		u=j-u+1
		if (u>c) || (u%2==1) {
			out.WriteString("0\n")
			out.Flush()
			//fmt.Println("0")
		} else {
			//fmt.Println("1")
			out.WriteString("1\n")
			out.Flush()
		}
	}
	out.Flush()
}

package main

import "bufio"
import "fmt"
import "os"
import "strconv"

var in = bufio.NewScanner(os.Stdin)

func init() {
  in.Split(bufio.ScanWords)
  buf := make([]byte, 300000, 300000)
  in.Buffer(buf, 0)
}

func readInt() int {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())
  return n
}

func main() {
  var n, m int
  var ac [2]int
  fmt.Scanf("%d %d", &n, &m)

  for i := 0; i < n; i++ {
    a := readInt()

    if a == -1 {
      ac[0]++
    } else {
      ac[1]++
    }
  }

  var min int
  if ac[0] < ac[1] {
    min = ac[0]
  } else {
    min = ac[1]
  }

  for i := 0; i < m; i++ {
    l := readInt()
    r := readInt()
    len := r - l + 1

    if len%2 == 0 && len/2 <= min {
      fmt.Println("1")
    } else {
      fmt.Println("0")
    }
  }
}

package main

import "bufio"
import "fmt"
import "os"
import "strconv"

var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriterSize(os.Stdout, 300000)

func init() {
  in.Split(bufio.ScanWords)
  buf := make([]byte, 300000, 300000)
  in.Buffer(buf, 0)
}

func readInt() int {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())
  return n
}

func main() {
  var n, m int
  var ac [2]int
  fmt.Scanf("%d %d", &n, &m)

  for i := 0; i < n; i++ {
    a := readInt()

    if a == -1 {
      ac[0]++
    } else {
      ac[1]++
    }
  }

  var min int
  if ac[0] < ac[1] {
    min = ac[0]
  } else {
    min = ac[1]
  }

  for i := 0; i < m; i++ {
    l := readInt()
    r := readInt()
    len := r - l + 1

    if len%2 == 0 && len/2 <= min {
      out.WriteString("1\n")
    } else {
      out.WriteString("0\n")
    }
  }

  out.Flush()
}

// 302A-mic
package main

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

func main() {
	var n, m, l, r int
	var a [200005]int
	fmt.Scan(&n, &m)
	var cou1, cou2 int
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
		if a[i] == 1 {
			cou1++
		} else {
			cou2++
		}
	}
	for ; m > 0; m-- {
		fmt.Scan(&l, &r)
		x := r - l + 1
		if x%2 == 1 {
			fmt.Println("0")
		} else {
			if x/2 <= cou1 && x/2 <= cou2 {
				fmt.Println("1")
			} else {
				fmt.Print("0")
			}
		}
	}
}

// 302A-mic
package main

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

func main() {
	s := bufio.NewReader(os.Stdin)
	//o := bufio.NewWriter(os.Stdout)
	var n, m, c, i, a, b int64
	fmt.Scan(&n, &m)
	for i = 0; i < n; i++ {
		fmt.Fscan(s, &c)
		if c == 1 {
			a++
		} else {
			b++
		}
	}
	for i = 0; i < m; i++ {
		var x, y, d int64
		fmt.Scan(&x, &y)
		d = y - x + 1
		if d%2 == 0 && a >= d/2 && b >= d/2 {
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}
	}
}

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

func main() {
	var i,j,u,c,n,m int64
	input:= bufio.NewScanner(os.Stdin)
	input.Split(bufio.ScanWords)
	out := bufio.NewWriter(os.Stdout)
	fmt.Scan(&n,&m)
	for i=0;i<n;i++ {
		input.Scan()
		aa,_:= strconv.Atoi(input.Text())
		j=int64(aa)
		//fmt.Scan(&j)
		if j<0 {
			c++
		} else {
			u++
		}
	}
	if c>u {
		c=u
	}
	c*=2
	for i=0;i<m;i++ {
		input.Scan()
		bb,_:= strconv.Atoi(input.Text())
		u=int64(bb)
		input.Scan()
		cc,_:= strconv.Atoi(input.Text())
		j=int64(cc)
		//fmt.Scan(&u,&j)
		u=j-u+1
		if (u>c) || (u%2==1) {
			out.WriteString("0")
			out.Flush()
			//fmt.Println("0")
		} else {
			//fmt.Println("1")
			out.WriteString("1")
			out.Flush()
		}
	}
	out.Flush()
}

package main

import "fmt"

func main() {
  var n, m int
  var ac [2]int
  fmt.Scanf("%d %d", &n, &m)

  for i := 0; i < n; i++ {
    var a int
    fmt.Scanf("%d", &a)

    if a == -1 {
      ac[0]++
    } else {
      ac[1]++
    }
  }

  var min int
  if ac[0] < ac[1] {
    min = ac[0]
  } else {
    min = ac[1]
  }

  for i := 0; i < m; i++ {
    var l, r int
    fmt.Scanf("%d %d", &l, &r)
    len := r - l + 1

    if len%2 == 0 && len/2 <= min {
      fmt.Println("1")
    } else {
      fmt.Println("0")
    }
  }
}

package main

import "bufio"
import "fmt"
import "os"
import "strconv"

var in = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriterSize(os.Stdout, 300000)

func init() {
  in.Split(bufio.ScanWords)
  buf := make([]byte, 300000, 300000)
  in.Buffer(buf, 0)
}

func readInt() int {
  in.Scan()
  n, _ := strconv.Atoi(in.Text())
  return n
}

func main() {
  var n, m int
  var ac [2]int
  fmt.Scanf("%d %d", &n, &m)

  for i := 0; i < n; i++ {
    a := readInt()

    if a == -1 {
      ac[0]++
    } else {
      ac[1]++
    }
    fmt.Printf("a: %d, ac[0]: %d, ac[1]: %d\n", a, ac[0], ac[1])
  }

  var min int
  if ac[0] < ac[1] {
    min = ac[0]
  } else {
    min = ac[1]
  }

  for i := 0; i < m; i++ {
    l := readInt()
    r := readInt()
    len := r - l + 1

    fmt.Printf("r: %d, l: %d, len: %d, min: %d, len%2: %d\n", r, l, len, min, int(len%2))
    if len%2 == 0 && len/2 <= min {
      out.WriteString("1\n")
    } else {
      out.WriteString("0\n")
    }
  }

  out.Flush()
}

package main

import "bufio"
import "fmt"
import "os"

var out = bufio.NewWriterSize(os.Stdout, 300000)

func main() {
  var n, m int
  var ac [2]int
  fmt.Scanf("%d %d", &n, &m)

  for i := 0; i < n; i++ {
    var a int
    fmt.Scanf("%d", &a)

    if a == -1 {
      ac[0]++
    } else {
      ac[1]++
    }
  }

  var min int
  if ac[0] < ac[1] {
    min = ac[0]
  } else {
    min = ac[1]
  }

  for i := 0; i < m; i++ {
    var l, r int
    fmt.Scanf("%d %d", &l, &r)
    len := r - l + 1

    if len%2 == 0 && len/2 <= min {
      //fmt.Println("1")
      out.WriteString("1\n")
    } else {
      //fmt.Println("0")
      out.WriteString("0\n")
    }
  }

  out.Flush()
}

package main

import "bufio"
import "fmt"
import "os"

var out = bufio.NewWriterSize(os.Stdout, 300000)

func main() {
  var n, m int
  var ac [2]int
  fmt.Scanf("%d %d", &n, &m)

  for i := 0; i < n; i++ {
    var a int
    fmt.Scanf("%d", &a)

    if a == -1 {
      ac[0]++
    } else {
      ac[1]++
    }
    fmt.Printf("a: %d, ac[0]: %d, ac[1]: %d\n", a, ac[0], ac[1])
  }

  var min int
  if ac[0] < ac[1] {
    min = ac[0]
  } else {
    min = ac[1]
  }

  for i := 0; i < m; i++ {
    var l, r int
    fmt.Scanf("%d %d", &l, &r)
    len := r - l + 1

    fmt.Printf("r: %d, l: %d, len: %d, min: %d, len%2: %d\n", r, l, len, min, len%2)
    if len%2 == 0 && len/2 <= min {
      out.WriteString("1\n")
    } else {
      out.WriteString("0\n")
    }
  }

  out.Flush()
}


// 5.05
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	nc, _ := reader.ReadString('\n')
	w, _ := reader.ReadString('\n')

	c, _ := strconv.Atoi(strings.Split(strings.TrimSpace(nc), " ")[1])
	s := strings.Split(strings.TrimSpace(w), " ")

	//fmt.Println(c)
	//fmt.Println(s)

	words := 1
	for i := len(s) - 1; i > 0; i-- {
		j, _ := strconv.Atoi(s[i])
		k, _ := strconv.Atoi(s[i-1])
		//fmt.Println(i, j, k)
		if j-k <= c {
			words++
		} else {
			break
		}
	}

	fmt.Println(words)
}

package main

import "fmt"
import "bufio"
import "os"

var bufin *bufio.Reader
var bufout *bufio.Writer

func main() {
	bufin = bufio.NewReader(os.Stdin)
	bufout = bufio.NewWriter(os.Stdout)
	defer bufout.Flush()

	var n, c, t int
	fmt.Fscanf(bufin, "%d %d\n", &n, &c)

	cnt := 0
	prev := -1

	for i := 0; i < n; i++ {
		fmt.Fscanf(bufin, "%d\n", &t)
		if (prev != -1) && (t-prev > c) {
			cnt = 0
		}
		cnt++
		prev = t
	}

	fmt.Fprintf(bufout, "%d\n", cnt)
}

package main
import (
	"fmt"
	"bufio"
	"os"
	"strconv"
)
func main() {
	var n, c int
	r,y := 0,0
	fmt.Scan(&n,&c)
	scan := bufio.NewScanner(os.Stdin)
	scan.Split(bufio.ScanWords)
	for scan.Scan() {
		x,_ := strconv.Atoi(scan.Text())
		if x-y>c {
			r = 0
		}
		y = x
		r++
	}
	fmt.Print(r)
}

// Codeforces 716 0 CrazyComputer
// int - 32 bit type !!!!
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
	"strconv"
)
var in *bufio.Reader

func readFive() (int,int,int,int,int) {
    var a [5]int
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("first read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
    for i:=0; i<len(ss); i++ {
        a[i], err = strconv.Atoi(ss[i])
        if err != nil {
            fmt.Println("n atoi failure", err)
            panic(err)
        }
    }
    return a[0],a[1],a[2],a[3],a[4]
}

func readLineNumbs(n int) []int {
    a := make([]int, n)
    s, err := in.ReadString('\n')
    if err != nil {
        fmt.Println("read failure", err)
        panic(err)
    }
    ss := strings.Split(strings.Trim(s, " \n\r"), " ")
    for j:=0; j<n; j++ {
        aa,err := strconv.Atoi(ss[j])
        if err != nil {
            fmt.Println("aa conv failed", err)
            panic(err)
        }
        a[j] = aa
    }
    return a
}

var n, c int
var num int
var a []int

func readData() {
 	in = bufio.NewReader(os.Stdin)
	// reading n
    n,c,_,_,_ = readFive()
    a = readLineNumbs(n)
}

func solve() {
    num = 0

    for i:=0; i<n; i++ {
        if i==0 {
            num = 1
        } else if a[i] > (a[i-1]+c) {
            num = 1
        } else {
            num++
        }
    }
}

func printRes() {
    fmt.Println(num)
}

func main() {
 	readData()
    solve()
    printRes()
}

package main

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

func main() {
	var n, c int
	fmt.Scan(&n, &c)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	var cnt int
	for t0, t1 := 0, 0; scanner.Scan(); {
		s := scanner.Text()
		t1, _ = strconv.Atoi(s)
		if t1-t0 > c {
			cnt = 1
		} else {
			cnt++
		}
		t0 = t1
	}
	fmt.Print(cnt)
}

package main

import (
	"fmt"
)

func main() {
	var n, c int

	fmt.Scan(&n, &c)

	var ts = make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&ts[i])
	}

	ans := 1
	for i := n - 1; i > 0; i-- {
		if ts[i]-ts[i-1] > c {
			break
		}
		ans++
	}

	fmt.Println(ans)
}

package main

import "fmt"

func main() {
    var n,c int
    fmt.Scan(&n, &c)
    var cnt int
    for i:=0; i<n; i++ {
        var t0, t1 int
        fmt.Scan(&t1)
        if t1-t0 > c {
            cnt = 1
        } else {
            cnt++
            t0 = t1
        }
    }
    fmt.Print(cnt)
}

package main

import "fmt"

func main() {
    var n,c int
    fmt.Scan(&n, &c)
    var cnt int
    for i:=0; i<n; i++ {
        var t0, t1 int
        fmt.Scan(&t1)
        if t1-t0 > c {
            cnt = 1
        } else {
            cnt++
        }
    }
    fmt.Print(cnt)
}

package main

import "fmt"

func main() {
    var n,c int
    fmt.Scan(&n, &c)
    var cnt int
    for i, t0, t1:=0,0,0; i<n; i++ {
        fmt.Scan(&t1)
        if t1-t0 > c {
            cnt = 1
        } else {
            cnt++
            t0 = t1
        }
    }
    fmt.Print(cnt)
}

package main

import "fmt"

func main() {
    var n,c int
    fmt.Scan(&n, &c)
    var cnt int
    for i:=0; i<n; i++ {
        var t0, t1 int
        fmt.Scan(&t1)
        fmt.Print(t1)
        if t1-t0 > c {
            cnt = 1
        } else {
            cnt++
            t0 = t1
        }
    }
    fmt.Print(cnt)
}

package main

import "fmt"

func main() {
    var n,c int
    fmt.Scan(&n, &c)
    var cnt int
    for i, t0, t1:=0,0,0; i<n; i++ {
        fmt.Scan(&t1)
        fmt.Print(t1-t0, " ")
        if t1-t0 > c {
            cnt = 1
        } else {
            cnt++
            t0 = t1
        }
    }
    fmt.Print(cnt)
}


package main

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

var in = bufio.NewReader(os.Stdin)

func main() {
	var t int
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var n, m int
		fmt.Fscan(in, &n, &m)
		c := make(map[int]int)
		for i := 0; i < n; i++ {
			var tp int
			fmt.Fscan(in, &tp)
			tp %= m
			if tp == 0 {
				c[tp] = 0
			} else if tp == m/2 && m%2 == 0 {
				c[tp] = 0
			} else if tp <= m/2 {
				c[tp]++
			} else {
				c[m-tp]--
			}
		}
		rs := 0
		for _, v := range c {
			if v == 0 {
				rs++
			} else if v > 0 {
				rs += v
			} else {
				rs -= v
			}
		}
		fmt.Println(rs)
	}
}

// 00
package main

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

func write(f *bufio.Writer, a ...interface{}) {
	f.Write([]byte(fmt.Sprint(a...)))
}

type Number interface {
	int64 | float64 | int
}

func min[K Number](a K, b K) K {
	if a < b {
		return a
	}
	return b
}
func max[K Number](a K, b K) K {
	if a > b {
		return a
	}
	return b
}
func main() {
	var T int
	reader := bufio.NewReader(os.Stdin)
	f := bufio.NewWriter(os.Stdout)
	defer f.Flush()
	fmt.Fscan(reader, &T)
	for t := 1; t <= T; t++ {
		var n, m int
		fmt.Fscan(reader, &n, &m)
		a := make([]int, n)
		mp := map[int]int{}
		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &a[i])
			mp[a[i]%m]++
		}

		counted := 0
		ans := 0
		for k, v := range mp {
			if k == 0 || k == m-k {
				counted += v
				ans++
			} else if k < m-k {
				if mp[k] > 0 && mp[m-k] > 0 {
					mx := max(mp[k], mp[m-k])
					mi := min(mp[k], mp[m-k])
					if mi != mx {
						counted += mi + mi + 1
						ans++
					} else {
						counted += mi * 2
						ans++
					}
				}
			}
		}
		ans += (n - counted)
		write(f, ans, "\n")

	}
}

package main

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

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n, k int
		fmt.Fscan(in, &n, &k)

		m := make(map[int]int, n)
		for i := 0; i < n; i++ {
			var v int
			fmt.Fscan(in, &v)
			m[v%k]++
		}

		var tot int
		if m[0] > 0 {
			tot++
		}
		if k%2 == 0 && m[k/2] > 0 {
			tot++
		}

		l := k / 2
		if k%2 != 0 {
			l++
		}
		for i := 1; i < l; i++ {
			d := min(m[i], m[k-i])
			if d > 0 {
				m[i] -= d
				m[k-i] -= d
				tot++
				if m[i] > 0 {
					m[i]--
				}

				if m[k-i] > 0 {
					m[k-i]--
				}
			}
			tot += m[i] + m[k-i]
		}
		fmt.Fprintln(out, tot)
	}
}

package main

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

/*
4
1 1
1
2 3
1 1
2 3
1 2
5 4
1 5 7 2 4
---
1
2
1
3 -> (1 3 1) 2 0
========
1
6 4
2 2 8 6 9 4
---
3 -> (2 2 2) 0 1 0
*/

//goland:noinspection GoUnhandledErrorResult
func main() {
	defer writer.Flush()

	bld := strings.Builder{}

	var t int
	scanf("%d\n", &t)

	for ; t > 0; t-- {
		var n, m int
		scanf("%d %d\n", &n, &m)

		cnts := make(map[int]int)

		for i := 0; i < n; i++ {
			var num int
			scanf("%d", &num)

			cnts[num%m]++
		}
		scanf("\n")

		arrCnt := 0

		for num1, cnt1 := range cnts {
			num2 := m - num1
			cnt2, ok := cnts[num2]

			switch {
			case num1 == num2 || num1 == 0:
				arrCnt++
			case !ok:
				arrCnt += cnt1
			case cnt1 < cnt2:
				arrCnt++
				arrCnt += cnt2 - (cnt1 + 1)
			case cnt1 > cnt2:
				arrCnt++
				arrCnt += cnt1 - (cnt2 + 1)
			default:
				arrCnt++
			}

			delete(cnts, num1)
			delete(cnts, num2)
		}

		fmt.Fprintf(&bld, "%d\n", arrCnt)
	}

	printf("%s", bld.String())
}

const maxUint = ^uint(0)

//goland:noinspection GoUnusedConst
const minUint = 0
const maxInt = int(maxUint >> 1)

//goland:noinspection GoUnusedConst
const minInt = -maxInt - 1

//goland:noinspection GoUnusedType
type pair struct {
	fst int
	snd int
}

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

//goland:noinspection GoUnusedFunction
func printf(f string, a ...interface{}) {
	if _, err := fmt.Fprintf(writer, f, a...); err != nil {
		panic(err)
	}
}

func scanf(f string, a ...interface{}) {
	if _, err := fmt.Fscanf(reader, f, a...); err != nil {
		panic(err)
	}
}

//goland:noinspection GoUnusedFunction
func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

//goland:noinspection GoUnusedFunction
func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

//goland:noinspection GoUnusedFunction
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

//goland:noinspection GoUnusedFunction
func isPrime(n int) bool {
	if n == 2 || n == 3 {
		return true
	}

	if n <= 1 || n%2 == 0 || n%3 == 0 {
		return false
	}

	for i := 5; i*i <= n; i += 6 {
		if n%i == 0 || n%(i+2) == 0 {
			return false
		}
	}

	return true
}

//goland:noinspection GoUnusedFunction
func gcd(a, b int) int {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

//goland:noinspection GoUnusedFunction
func lcm(a, b int) int {
	return abs(a) / gcd(a, b) * abs(b)
}

func digitAt(num, pos int64) int64 {
	rem := num % int64(math.Pow(10, float64(pos)))
	return rem / int64(math.Pow(10, float64(pos-1)))
}

package main

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

func run(r io.Reader, w io.Writer) {
	in := bufio.NewReader(r)
	out := bufio.NewWriter(w)
	defer out.Flush()

	var t int
	for Fscan(in, &t); t > 0; t-- {
		var n, m int
		Fscan(in, &n, &m)
		mp := make([]int, 100005)

		for i := 0; i < n; i++ {
			var num int
			Fscan(in, &num)
			mp[num % m]++
		}

		ans := 0
		for left, right := 1, m-1; left <= right; {
			if mp[left] == 0 && mp[right] == 0 {
				left++; right--
				continue
			}
			ans += max(1, max(mp[left], mp[right]) - min(mp[left], mp[right]))
			left++; right--
		}
		if mp[0] != 0 {
			ans++
		}
		Fprintln(out, ans)
	}
}

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

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

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

func abs(num int) int {
	if num < 0 {
		return -num
	}
	return num
}

package main

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

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

func main() {
	defer writer.Flush()
	var testcases int
	fmt.Fscan(reader, &testcases)

	for testcase := 0; testcase < testcases; testcase++ {
		var a, n, m int64
		fmt.Fscan(reader, &n, &m)
		mod := make([]int64, m)
		for i := int64(0); i < n; i++ {
			fmt.Fscan(reader, &a)
			mod[a%m]++
		}

		ans := int64(0)
		// mod 0
		if mod[0] != 0 {
			ans++
		}

		// mod m/2 if m is even
		if m&1 == 0 && mod[m/2] != 0 {
			ans++
		}

		// others
		for set := int64(1); set <= (m-1)/2; set++ {
			// set and m-set are paired
			if mod[set] == mod[m-set] {
				if mod[set] != 0 {
					ans++
				}
			} else if mod[set] > mod[m-set] {
				ans += mod[set] - mod[m-set]
			} else {
				ans += mod[m-set] - mod[set]
			}
		}

		fmt.Fprintln(writer, ans)
	}
}

package main

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

// var m []int
// err = json.Unmarshal([]byte(r.FormValue("example")), &m)

// for i := 0; i < len(m); i++ {
// 	fmt.Println(m[i])
// }

func MIN(x, y int) int {
	if x > y {
		return y
	} else {
		return x
	}
}

func MKO(x, y int) int {
	if x < y {
		return 0
	} else {
		return x - y + 1
	}
}

func MAX(x, y int) int {
	if x > y {
		return x
	} else {
		return y
	}
}

func LCM(x, y int) int {
	if x >= y {
		initial := x
		for i := 1; i < y+2; i++ {
			if initial%y == 0 {
				break
			} else {
				initial = initial + x
			}

		}
		return initial
	} else {
		initial := y
		for i := 1; i < x+2; i++ {
			if initial%x == 0 {
				break
			} else {
				initial = initial + y
			}

		}
		return initial
	}
}

func IsItPrime(x int) bool {
	if x < 10 {
		if x == 2 || x == 3 || x == 5 || x == 7 {
			return true
		} else {
			return false
		}
	} else {
		j := 0
		k := math.Sqrt(float64(x))
		for m := 3; m <= int(k); {
			if x%m == 0 {
				j = 1
				break
			}
			m = m + 2
		}
		if j == 1 {
			return false
		} else {
			return true
		}
	}

}

// sort.Slice(arr, func(i, j int) bool {
// 	return arr[i] > arr[j]
// })
var t int

func main() {
	var input io.Reader = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &t)
	for o := 0; o < t; o++ {
		var n, m int
		fmt.Fscan(input, &n)
		fmt.Fscan(input, &m)

		// STRING := make([]byte, 0)
		// fmt.Fscan(input, &STRING)
		remainder := make([]int, m)
		ARRAY := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(input, &ARRAY[i])
			j := ARRAY[i] % m
			remainder[j] = remainder[j] + 1

		}
		answer := 0
		if m%2 == 0 {
			if remainder[0] > 0 {
				answer++
			}
			if remainder[int(m/2)] > 0 {
				answer++
			}
			l := int(m / 2)
			for j := 1; j < l; j++ {
				answer = answer + MAX(remainder[j], remainder[m-j]) - MIN(remainder[j], remainder[m-j])
				if remainder[j] == remainder[m-j] && remainder[j]*remainder[m-j] != 0 {
					answer++
				}
			}
		} else {
			if remainder[0] > 0 {
				answer++
			}
			l := int(m / 2)
			for j := 1; j < l+1; j++ {
				answer = answer + MAX(remainder[j], remainder[m-j]) - MIN(remainder[j], remainder[m-j])
				if remainder[j] == remainder[m-j] && remainder[j]*remainder[m-j] != 0 {
					answer++
				}
			}

		}
		fmt.Println(answer)

	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"strings"
)

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

	solve := func(Case int) {
		var n, m int
		Fscan(in, &n, &m)
		cnt := make([]int, m)
		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		for _, v := range a {
			v %= m
			cnt[v]++
		}
		ans := 0
		if cnt[0] > 0 {
			ans++
		}
		for i := 1; i < (m+1)/2; i++ {
			mi := min(cnt[i], cnt[m-i])
			mx := max(cnt[i], cnt[m-i])
			if mi > 0 {
				ans++
			} else if mx > 0 {
				ans+=mx
				continue
			}
			if mx > mi+1 {
				ans += mx - mi-1
			}
		}
		if m&1 == 0 {
			if cnt[m/2] > 0 {
				ans++
			}
		}
		Fprintln(out, ans)
	}

	var t int
	Fscan(in, &t)
	for Case := 1; Case <= t; Case++ {
		solve(Case)
	}

	_leftData, _ := ioutil.ReadAll(in)
	if _s := strings.TrimSpace(string(_leftData)); _s != "" {
		panic("有未读入的数据：\n" + _s)
	}
}

func main() { run(os.Stdin, os.Stdout) }
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

package main

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

var in = bufio.NewReader(os.Stdin)

func main() {
	var t int
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var n, m int
		fmt.Fscan(in, &n, &m)
		c := make(map[int]int)
		for j := 0; j < n; j++ {
			var tp int
			fmt.Fscan(in, &tp)
			tp %= m
			if tp == 0 {
				c[tp] = 0
			} else if tp == m/2 && m%2 == 0 {
				c[tp] = 0
			} else if tp < m/2 {
				c[tp]++
			} else {
				c[m-tp]--
			}
		}
		rs := 0
		for _, v := range c {
			if v == 0 {
				rs++
			} else if v > 0 {
				rs += v
			} else {
				rs -= v
			}
		}
		fmt.Println(rs)
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t int
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var n, m int
		fmt.Fscan(in, &n, &m)
		c := make(map[int]int)
		f := make(map[int]bool)
		for j := 0; j < n; j++ {
			var tp int
			fmt.Fscan(in, &tp)
			tp %= m
			if tp == 0 {
				f[0] = true
			} else if tp == m/2 && m%2 == 0 {
				f[tp] = true
			} else if tp < m/2 {
				c[tp]++
				f[tp] = true
			} else {
				c[m-tp]--
				f[m-tp] = true
			}
		}
		rs := 0
		for i := range f {
			v := c[i]
			if v > 0 {
				rs += v
			} else {
				rs -= v
			}
			if v == 0 && f[i] {
				rs++
			}
		}
		fmt.Println(rs)
	}
}

// 00
package main

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

func write(f *bufio.Writer, a ...interface{}) {
	f.Write([]byte(fmt.Sprint(a...)))
}

type Number interface {
	int64 | float64 | int
}

func min[K Number](a K, b K) K {
	if a < b {
		return a
	}
	return b
}
func max[K Number](a K, b K) K {
	if a > b {
		return a
	}
	return b
}
func main() {
	var T int
	reader := bufio.NewReader(os.Stdin)
	f := bufio.NewWriter(os.Stdout)
	defer f.Flush()
	fmt.Fscan(reader, &T)
	for t := 1; t <= T; t++ {
		var n, m int
		fmt.Fscan(reader, &n, &m)
		a := make([]int, n)
		mp := map[int]int{}
		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &a[i])
			mp[a[i]%m]++
		}
		if T == 2 {
			fmt.Println(mp)
		}
		counted := 0
		ans := 0
		for k, v := range mp {
			if k == 0 || k == m-k {
				counted += v
				ans++
			} else if k < m-k {
				if mp[k] > 0 && mp[m-k] > 0 {
					mx := max(mp[k], mp[m-k])
					mi := min(mp[k], mp[m-k])
					if mi != mx {
						counted += mi + mi + 1
						ans++
					} else {
						if mi == 1 {
							counted += 2
							ans++
						} else {
							counted += mi + mi - 1
							ans++
						}

					}
				}
			}
		}
		ans += (n - counted)
		write(f, ans, "\n")

	}
}

// 00
package main

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

func write(f *bufio.Writer, a ...interface{}) {
	f.Write([]byte(fmt.Sprint(a...)))
}

type Number interface {
	int64 | float64 | int
}

func min[K Number](a K, b K) K {
	if a < b {
		return a
	}
	return b
}
func max[K Number](a K, b K) K {
	if a > b {
		return a
	}
	return b
}
func main() {
	var T int
	reader := bufio.NewReader(os.Stdin)
	f := bufio.NewWriter(os.Stdout)
	defer f.Flush()
	fmt.Fscan(reader, &T)
	for t := 1; t <= T; t++ {
		var n, m int
		fmt.Fscan(reader, &n, &m)
		a := make([]int, n)
		mp := map[int]int{}
		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &a[i])
			mp[a[i]%m]++
		}
		counted := 0
		ans := 0
		for k, v := range mp {
			if k == 0 || k == m-k {
				counted += v
				ans++
			} else if k < m-k {
				if mp[k] > 0 && mp[m-k] > 0 {
					mx := max(mp[k], mp[m-k])
					mi := min(mp[k], mp[m-k])
					if mi != mx {
						counted += mi + mi + 1
						ans++
					} else {
						if mi == 1 {
							counted += 2
							ans++
						} else {
							counted += mi + mi - 1
							ans++
						}

					}
				}
			}
		}
		ans += (n - counted)
		write(f, ans, "\n")

	}
}

// 00
package main

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

func write(f *bufio.Writer, a ...interface{}) {
	f.Write([]byte(fmt.Sprint(a...)))
}

type Number interface {
	int64 | float64 | int
}

func min[K Number](a K, b K) K {
	if a < b {
		return a
	}
	return b
}
func max[K Number](a K, b K) K {
	if a > b {
		return a
	}
	return b
}
func main() {
	var T int
	reader := bufio.NewReader(os.Stdin)
	f := bufio.NewWriter(os.Stdout)
	defer f.Flush()
	fmt.Fscan(reader, &T)
	for t := 1; t <= T; t++ {
		var n, m int
		fmt.Fscan(reader, &n, &m)
		a := make([]int, n)
		mp := map[int]int{}
		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &a[i])
			mp[a[i]%m]++
		}
		counted := 0
		ans := 0
		for k, v := range mp {
			if k == 0 || k == m-k {
				counted += v
				ans++
			} else if k < m-k {
				if mp[k] > 0 && mp[m-k] > 0 {
					mx := max(mp[k], mp[m-k])
					mi := min(mp[k], mp[m-k])
					triplets := min(mx/2, mi)
					ans += triplets
					mx -= triplets * 2
					mi -= triplets
					counted += triplets * 3
					ans += min(mi, mx)
					counted += min(mi, mx) * 2
				}
			}
		}
		ans += (n - counted)
		write(f, ans, "\n")

	}
}

package main

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

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n, k int
		fmt.Fscan(in, &n, &k)

		m := make(map[int]int, n)
		for i := 0; i < n; i++ {
			var v int
			fmt.Fscan(in, &v)
			m[v%k]++
		}

		var tot int
		if m[0] > 0 {
			tot++
		}
		if k%2 == 0 && m[k/2] > 0 {
			tot++
		}
		for i := 1; i < k/2; i++ {
			d := min(m[i], m[k-i])
			if d > 0 {
				m[i] -= d
				m[k-i] -= d
				tot++
				if m[i] > 0 {
					m[i]--
				}

				if m[k-i] > 0 {
					m[k-i]--
				}
			}
			tot += m[i] + m[k-i]
		}
		fmt.Fprintln(out, tot)
	}
}


// https://codeforces.com/contest/1350/problem/B
package main

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

// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)
var input io.Reader

func main() {
	var (
		T int
	)

	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Fscan(input, &T)
	for i := 0; i < T; i++ {
		fmt.Println(solver())
	}
}

func solver() int {
	var n, k int
	fmt.Fscan(input, &n, &k)
	a := make([]int, n)
	b := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(input, &a[i])
	}
	for i := 0; i < n; i++ {
		fmt.Fscan(input, &b[i])
	}

	sort.Ints(a)
	sort.Ints(b)
	ans := 0
	for i := 0; i < k; i++ {
		if a[i] < b[n - 1 - i] {
			a[i] = b[n - 1 - i]
		}
	}
	for i := 0; i < n; i++ {
		ans += a[i]
	}

	return ans
}

package main

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

func main() {
	var t int
	var n, k int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &n, &k)
		a := make([]int, n)
		b := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &a[j])
		}
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &b[j])
		}
		sort.Slice(a, func(i, j int) bool {
			return a[i] > a[j]
		})
		sort.Slice(b, func(i, j int) bool {
			return b[i] > b[j]
		})
		sum := 0
		ai := 0
		bi := 0
		for j := 0; j < n; j++ {
			if a[ai] >= b[bi] || k == 0 {
				sum += a[ai]
				ai++
			} else {
				sum += b[bi]
				bi++
				k--
			}
		}
		fmt.Println(sum)
	}
}

package main

import (
	"fmt"
	"sort"
)

func solve() {
	var n, k int
	fmt.Scan(&n, &k)
	a := make([]int, n)
	b := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
	}

	for i := 0; i < n; i++ {
		fmt.Scan(&b[i])
	}

	sort.Ints(a)
	sort.Slice(b, func(c, d int) bool {
		return b[c] > b[d]
	})

	for i := 0; i < k; i++ {
		if b[i] < a[i] {
			break
		}
		a[i], b[i] = b[i], a[i]
	}

	var ans int
	for i := 0; i < n; i++ {
		ans += a[i]
	}
	fmt.Println(ans)
}

func main() {
	var t int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		solve()
	}
}

package main

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

func scanSortSlice(in *bufio.Reader, n int) []int {
	a := make([]int, n, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &a[i])
	}
	sort.Ints(a)
	return a
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		var n, k int
		fmt.Fscan(in, &n, &k)
		a := scanSortSlice(in, n)
		b := scanSortSlice(in, n)
		for i := 0; i < k; i++ {
			if a[i] < b[n-i-1] {
				a[i] = b[n-i-1]
			}
		}
		result := 0
		for _, v := range a {
			result += v
		}
		fmt.Fprintln(out, result)
	}
}

package main

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

func main()  {
	scanner := bufio.NewScanner(os.Stdin)

	buff := make([]byte, 2 * 1024 * 1024)

	scanner.Buffer(buff, 1024 * 1024)

	scanner.Scan()

	t := scanner.Text()

	testCases, err := strconv.Atoi(t)

	if err != nil {
		panic(err)
	}

	for j := 0; j < int(testCases); j ++ {

		scanner.Scan()

		nk := scanner.Text()

		parts := strings.Fields(nk)

		n, err := strconv.Atoi(parts[0])

		if err != nil {
			panic(err)
		}

		k, err := strconv.Atoi(parts[1])

		if err != nil {
			panic(err)
		}

		scanner.Scan()

		as := scanner.Text()

		scanner.Scan()

		bs := scanner.Text()

		psa := strings.Fields(as)

		a := make([]int, n)

		for i := 0; i < n; i ++ {
			a1, err := strconv.Atoi(psa[i])

			if err != nil {
				panic(err)
			}

			a[i] = a1
		}

		psb := strings.Fields(bs)

		b := make([]int, n)

		for i := 0; i < n; i ++ {
			b1, err := strconv.Atoi(psb[i])

			if err != nil {
				panic(err)
			}

			b[i] = b1
		}

		ans := solve2(a, b, k)

		fmt.Println(ans)
	}
}

func solve2(a []int, b []int, k int ) int {
	sort.Ints(a)

	sort.SliceStable(b, func(i, j int) bool {
		return b[i] > b[j]
	})

	for i := 0; i < k; i++ {
		if b[i] < a[i] {
			break
		}
		a[i] = b[i]
	}

	sum := 0

	for i := 0; i < len(a); i ++ {
		sum += a[i]
	}

	return sum
}

package main

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

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

	var t, n, k int
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &n, &k)
		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		b := make([]int, n)
		for i := range b {
			Fscan(in, &b[i])
		}
		sort.Ints(b)
		a = append(a, b[n-k:]...)
		sort.Ints(a)
		s := 0
		for _, v := range a[k:] {
			s += v
		}
		Fprintln(out, s)
	}
}

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

package main

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

func main() {
	var t int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		var n, k, or, sum int
		var s1, s2 []int
		fmt.Fscan(in, &n, &k)
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &or)
			s1 = append(s1, or)
		}
		for j := 0; j < n; j++ {
			fmt.Fscan(in, &or)
			s2 = append(s2, or)
		}
		sort.Ints(s1)
		sort.Ints(s2)
		var indi1 int
		indi2 := len(s2) - 1
		for j := 0; j < k; j++ {
			//if
			if s1[indi1] < s2[indi2] {
				temp := s1[indi1]
				s1[indi1] = s2[indi2]
				s2[indi2] = temp
				indi1++
				indi2--
			}
		}
		for j := 0; j < len(s1); j++ {
			sum += s1[j]
		}
		fmt.Println(sum)
		//fmt.Println(s1)

	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
	"sync"
)

func main() {
	for t := ScanInt(); t > 0; t-- {
		n, k := ScanInt(), ScanInt()
		a := ScanIntSlice(n)
		b := ScanIntSlice(n)
		sort.Ints(a)
		sort.Slice(b, func(i, j int) bool {
			return b[i] > b[j]
		})

		i := 0
		for k > 0 && i < n {
			if a[i] < b[i] {
				k--
				a[i], b[i] = b[i], a[i]
			}
			i++
		}
		sum := int64(0)
		for i := 0; i < n; i++ {
			sum += int64(a[i])
		}
		P(sum)
		//P(a)
		//P(b)
	}

	close(O)
	oWg.Wait()
}

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

var O chan string
var in *bufio.Scanner
var oWg *sync.WaitGroup
var P func(a ...interface{}) (n int, err error)

func init() {
	P = fmt.Println

	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)

	O = make(chan string, 16)
	oWg = &sync.WaitGroup{}
	oWg.Add(1)

	writer := bufio.NewWriter(os.Stdout)
	go func() {
		defer oWg.Done()
		defer writer.Flush()

		for line := range O {
			writer.WriteString(line + "\n")
		}
	}()
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanInt() int     { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInt64() int64 { i, _ := strconv.ParseInt(ScanWord(), 10, 64); return i }
func ScanStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt()
	}
	return arr
}
func ScanInt64Slice(n int) []int64 {
	arr := make([]int64, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt64()
	}
	return arr
}

/*********************** Utils ***********************/

func S(v interface{}) string { return fmt.Sprintf("%v", v) }
func SArr(a []int) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.Itoa(a[i]) + " ")
	}
	return sb.String()
}
func SArr64(a []int64) string {
	sb := strings.Builder{}
	sb.Grow(len(a) * 9)
	for i := range a {
		sb.WriteString(strconv.FormatInt(a[i], 10) + " ")
	}
	return sb.String()
}
func MnMx(args ...int64) (int64, int64) {
	minVal, maxVal := int64(math.MaxInt64), int64(math.MinInt64)
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int64) int64 { mn, _ := MnMx(args...); return mn }
func Mx(args ...int64) int64 { _, mx := MnMx(args...); return mx }
func LCM(a, b int64) int64   { return a / GCD(a, b) * b }
func GCD(a, b int64) int64 {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func sortInt64Slice(a []int64) { sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) }
func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
   "fmt"
   "sort"
)

func main() {
   var t int
   fmt.Scan(&t)
   for ;t!=0;t--{
      var n,k int
      var a,b []int
      fmt.Scan(&n)
      fmt.Scan(&k)
      for i,x:=0,0;i<n;i++{

         fmt.Scan(&x)
         a = append(a,x)
      }
      for i,x:=0,0;i<n;i++{
         fmt.Scan(&x)
         b = append(b,x)
      }
      sort.Ints(a)
      sort.Ints(b)
      for i,j:=0,n-1;i<n&&k>0;i++{
         if(a[i]<b[j]){
            a[i]=b[j]
            k--
            j--
         }else{
            break
         }
         if(k==0){
             break
         }
      }
      var sum int
      for i:=0;i<n;i++{
         sum+=a[i]
      }
      fmt.Println(sum)
   }
}

package main

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

var nt int
var n, k int
var a[] int
var b[] int

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

func main()  {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	fmt.Fscanf(reader, "%d\n", &nt)
	for kk := 0; kk < nt; kk++ {
		fmt.Fscanf(reader, "%d %d\n", &n, &k)
		a = make([]int, n)
		b = make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscanf(reader, "%d", &a[i])
		}
		fmt.Fscanf(reader, "\n")
		for i := 0; i < n; i++ {
			fmt.Fscanf(reader, "%d", &b[i])
		}
		fmt.Fscanf(reader, "\n")
		sort.Ints(a)
		sort.Ints(b)

		//fmt.Println(a)
		//fmt.Println(b)

		var sum = 0
		var tot = 0
		for _, z := range a {
			sum += z
			tot += z
		}

		var cur = 0
		for i := 0; i < k; i++ {
			cur -= a[i]
			cur += b[n - 1 - i]
			//fmt.Println("delta", b[n - 1 - i] - a[i])
			sum = max(sum, tot + cur)
		}
		fmt.Fprintf(writer, "%d\n", sum)
	}
}

// https://serhatgiydiren.github.io

package main

import "fmt"
import "sort"

func solve(test_id int) {
 var n,k int
	fmt.Scan(&n,&k)
 x := make([]int, n)
 y := make([]int, n)
 res := 0
 for i := 0 ; i < n ; i++ {
  fmt.Scan(&x[i])
  res+=x[i]
 }
 for i := 0 ; i < n ; i++ {
  fmt.Scan(&y[i])
 }
 sort.Ints(x)
 sort.Ints(y)
 for i := 0 ; i < k ; i++ {
  if (y[n-1-i]<=x[i]) {
   break
  }
  res+=y[n-1-i]-x[i]
 }
 fmt.Println(res)
}

func solve_cases() {
 t := 1
 fmt.Scan(&t)
 for i := 0 ; i < t ; i++ {
  solve(i)
 }
}

func main() {
 solve_cases()
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var t, n, k int
	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		fmt.Scan(&n, &k)
		var a = make([]int, n)
		var b = make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Scan(&a[j])
		}
		for j := 0; j < n; j++ {
			fmt.Scan(&b[j])
		}
		sort.Ints(a)
		sort.Ints(b)
		var x, y = 0, n - 1
		for x < n && k > 0 {
			if a[x] < b[y] {
				a[x] ^= b[y]
				b[y] ^= a[x]
				a[x] ^= b[y]
			}
			x += 1
			y -= 1
			k -= 1
		}
		var result = 0
		for j := 0; j < n; j++ {
			result += a[j]
		}
		fmt.Println(result)
	}
}

package main

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

// https://codeforces.com/problemset/problem/1353/B
// B. Two Arrays And Swaps
// time limit per test
// 1 second
// memory limit per test
// 256 megabytes
// input
// standard input
// output
// standard output

// You are given two arrays a
// and b both consisting of n positive (greater than zero) integers. You are also given an integer k

// .

// In one move, you can choose two indices i
// and j (1≤i,j≤n) and swap ai and bj (i.e. ai becomes bj and vice versa). Note that i and j can be equal or different (in particular, swap a2 with b2 or swap a3 and b9

// both are acceptable moves).

// Your task is to find the maximum possible sum you can obtain in the array a
// if you can do no more than (i.e. at most) k

// such moves (swaps).

// You have to answer t

// independent test cases.
// Input

// The first line of the input contains one integer t
// (1≤t≤200) — the number of test cases. Then t

// test cases follow.

// The first line of the test case contains two integers n
// and k (1≤n≤30;0≤k≤n) — the number of elements in a and b and the maximum number of moves you can do. The second line of the test case contains n integers a1,a2,…,an (1≤ai≤30), where ai is the i-th element of a. The third line of the test case contains n integers b1,b2,…,bn (1≤bi≤30), where bi is the i-th element of b

// .
// Output

// For each test case, print the answer — the maximum possible sum you can obtain in the array a
// if you can do no more than (i.e. at most) k swaps.

func main() {
	bufStdin := bufio.NewReader(os.Stdin)
	bufStdout := bufio.NewWriter(os.Stdout)
	defer bufStdout.Flush()

	var t int
	_, _ = fmt.Fscan(bufStdin, &t)

	for i := 0; i < t; i++ {
		var n, k int
		_, _ = fmt.Fscan(bufStdin, &n, &k)

		a := make([]int, n)
		for i := 0; i < n; i++ {
			_, _ = fmt.Fscan(bufStdin, &a[i])
		}

		b := make([]int, n)
		for i := 0; i < n; i++ {
			_, _ = fmt.Fscan(bufStdin, &b[i])
		}

		sort.Ints(a)
		sort.Ints(b)

		// swap the minimum values of a with the maximum values of b
		// the only special case is that we should not swap if the b value is less than a, at that point we can stop looping
		// since we have reached a point where the b values will not be greater in the future because the slices are sorted
		for i := 0; i < k && b[n-i-1] > a[i]; i++ {
			a[i] = b[n-i-1]
		}

		var sum int
		for i := 0; i < n; i++ {
			sum += a[i]
		}
		_, _ = fmt.Fprintln(bufStdout, sum)
	}
}

package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var n, k int
		fmt.Fscan(r, &n, &k)
		a := make([]int, n)
		b := make([]int, n)
		s := 0
		for j := 0; j < n; j++ {
			fmt.Fscan(r, &a[j])
			s += a[j]
		}
		for j := 0; j < n; j++ {
			fmt.Fscan(r, &b[j])
		}

		sort.Ints(a)
		sort.Ints(b)
		for j := 0; j < k; j++ {
			if a[j] < b[n-j-1] {
				s += b[n-j-1] - a[j]
			}
		}
		fmt.Fprintln(w, s)
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var t int
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		var n, k int
		fmt.Fscan(reader, &n, &k)
		a := make([]int, n)
		b := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &a[i])
		}
		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &b[i])
		}
		sort.Sort(sort.Reverse(sort.IntSlice(b)))
		for i := 0; i < k; i++ {
			a = append(a, b[i])
		}
		sort.Sort(sort.Reverse(sort.IntSlice(a)))
		ans := 0
		for i := 0; i < n; i++ {
			ans += a[i]
		}
		fmt.Fprintln(writer, ans)
	}
}

package main

import (
	"fmt"
	"sort"
	"strings"
)

type test struct {
	n int
	k int
	a []int
	b []int
}

// https://codeforces.com/problemset/problem/1328/A
// комментарий к решению
// Небольшой и разнообразные входной поток требует
// задействовать fmt.Scan , т.к. с парсингом ioutil.ReadAll
// сложность и количество кода увеличивается
func taskSolution(in []test) string {
	ans := make([]int, len(in))
	for i, ei := range in {
		sort.Ints(ei.a)
		sort.Sort(sort.Reverse(sort.IntSlice(ei.b)))
		for j := 0; j < ei.k && ei.a[j] < ei.b[j]; j += 1 {
			ei.a[j] = ei.b[j]
		}
		for _, aj := range ei.a {
			ans[i] += aj
		}
	}
	res := fmt.Sprint(ans)
	return strings.Replace(res[1:len(res)-1], " ", "\n", len(ans)-1)
}

func main() {
	var t int
	if _, err := fmt.Scan(&t); err != nil {
		panic(err)
	}

	in := make([]test, 0, t)
	for i := 0; i < t; i += 1 {
		var n, k, ai, bi int
		var a, b []int
		if _, err := fmt.Scan(&n, &k); err != nil {
			panic(err)
		}
		for j := 0; j < n; j += 1 {
			if _, err := fmt.Scan(&ai); err != nil {
				panic(err)
			}
			a = append(a, ai)
		}
		for j := 0; j < n; j += 1 {
			if _, err := fmt.Scan(&bi); err != nil {
				panic(err)
			}
			b = append(b, bi)
		}
		in = append(in, test{n: n, k: k, a: a, b: b})
	}

	fmt.Println(taskSolution(in))
}


package main

import (
	// "fmt"
	"bufio"
	"os"
	"strings"
	// "strconv"
	// "sort"
)

//N _
const (
	N = 1e6 + 5
)

func inputter(inputReader *bufio.Reader,strs chan *string){
	for {
		input , _ := inputReader.ReadString('\n')
		input = strings.TrimSpace(input)
		if len(input) > 0 {
			inputs := strings.Split(input, " ")
			for i := range inputs{
				strs <- &inputs[i]
			}
		}
	}
}

func main(){
	rs := bufio.NewReader(os.Stdin)
	ws := bufio.NewWriter(os.Stdout)

	strs := make(chan *string, 100)

	go inputter(rs, strs)

	number1 := strings.TrimLeft(*<-strs, "0")
	number2 := strings.TrimLeft(*<-strs, "0")

	if len(number1) + len(number2) == 0{
		ws.WriteString("=")
		ws.Flush()
		return
	}

	if len(number1) > len(number2){
		ws.WriteString(">")
		ws.Flush()
		return
	}

	if len(number1) < len(number2){
		ws.WriteString("<")
		ws.Flush()
		return
	}

	for i := range number1{
		if number1[i] > number2[i]{
			ws.WriteString(">")
			ws.Flush()
			return
		} else if number1[i] < number2[i] {
			ws.WriteString("<")
			ws.Flush()
			return
		}
	}

	ws.WriteString("=")
	ws.Flush()
	return
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	num1, _ := reader.ReadString('\n')
	num2, _ := reader.ReadString('\n')

	num1Trimmed := strings.TrimLeft(num1, "0")
	num2Trimmed := strings.TrimLeft(num2, "0")

	if len(num1Trimmed) > len(num2Trimmed) {
		fmt.Println(">")
	} else if len(num1Trimmed) < len(num2Trimmed) {
		fmt.Println("<")
	} else {
		if strings.Compare(num1Trimmed, num2Trimmed) == 1 {
			fmt.Println(">")
		} else if strings.Compare(num1Trimmed, num2Trimmed) == -1 {
			fmt.Println("<")
		} else {
			fmt.Println("=")
		}
	}}

package main

import (
	// "fmt"
	"bufio"
	"os"
	"strings"
	// "strconv"
	// "sort"
)

//N _
const (
	N = 1e6 + 5
)

func inputter(inputReader *bufio.Reader,strs chan *string){
	for {
		input , _ := inputReader.ReadString('\n')
		input = strings.TrimSpace(input)
		if len(input) > 0 {
			inputs := strings.Split(input, " ")
			for i := range inputs{
				strs <- &inputs[i]
			}
		}
	}
}

func main(){
	rs := bufio.NewReader(os.Stdin)
	ws := bufio.NewWriter(os.Stdout)

	strs := make(chan *string, 100)

	go inputter(rs, strs)

	number1 := strings.TrimLeft(*<-strs, "0")
	number2 := strings.TrimLeft(*<-strs, "0")

	if len(number1) + len(number2) == 0{
		ws.WriteString("=")
	} else if len(number1) > len(number2){
		ws.WriteString(">")
	} else if len(number1) < len(number2){
		ws.WriteString("<")
	} else {
		if number1 > number2{
			ws.WriteString(">")
		} else if number1 < number2{
			ws.WriteString("<")
		} else{
			ws.WriteString("=")
		}
	}
	ws.Flush()
	return
}

package main

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

func main() {
    stin := bufio.NewReader(os.Stdin)
    a,_ := stin.ReadBytes('\n')
    b,_ := stin.ReadBytes('\n')

    a = bytes.Trim(a,"\n\r ")
    b = bytes.Trim(b,"\n\r ")

    lp := len(a)
    lq := len(b)

    var ddp []byte = make([]byte, 1000001-lp)
    var ddq []byte = make([]byte, 1000001-lq)

    for i := 0; i < 1000001-lp; i++ {
            ddp[i] = '0'
    }
    for i := 0; i < 1000001-lq; i++ {
            ddq[i] = '0'
    }

    pp := bytes.NewBuffer(ddp)
    pp.Write(a)
    qq := bytes.NewBuffer(ddq)
    qq.Write(b)

    c := bytes.Compare(pp.Bytes(), qq.Bytes())
    if c < 0 {
        fmt.Printf("<")
    } else if c > 0 {
        fmt.Printf(">")
    } else {
        fmt.Printf("=")
    }
}

package main

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

func compare(s1, s2 []string) {
	i := 0
	for ; s1[i] == s2[i]; i++ {
	}

	a, _ := strconv.Atoi(s1[i])
	b, _ := strconv.Atoi(s2[i])
	if a > b {
		fmt.Println(">")
		os.Exit(0)
	} else {
		fmt.Println("<")
		os.Exit(0)
	}
}

func main() {
	var a, b string
	reader := bufio.NewReader(os.Stdin)
	a, _ = reader.ReadString('\n')
	b, _ = reader.ReadString('\n')

	if strings.HasPrefix(a, "0") {
		a = strings.TrimLeft(a, "0")
	}
	if strings.HasPrefix(b, "0") {
		b = strings.TrimLeft(b, "0")
	}

	d := len(a) - len(b)
	if d < 0 {
		fmt.Println("<")
		os.Exit(0)
	} else if d > 0 {
		fmt.Println(">")
		os.Exit(0)
	}

	if a == b {
		fmt.Println("=")
		os.Exit(0)
	}

	s1 := strings.Split(a, "")
	s2 := strings.Split(b, "")
	compare(s1, s2)
}

package main

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

func main() {
	//var a, b string
	reader := bufio.NewReader(os.Stdin)
	a, _ := reader.ReadString('\n')
	b, _ := reader.ReadString('\n')
	var trimmeda string = strings.TrimLeft(a, "0")
	var trimmedb string = strings.TrimLeft(b, "0")
	var lena int = len(trimmeda)
	var lenb int = len(trimmedb)
	if lena > lenb {
		fmt.Println(">")
	} else if lena < lenb {
		fmt.Println("<")
	} else {
		if strings.Compare(trimmeda, trimmedb) == 1 {
			fmt.Println(">")
		} else if strings.Compare(trimmeda, trimmedb) == -1 {
			fmt.Println("<")
		} else {
			fmt.Println("=")
		}
	}
}

package main

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

func removeZeros(a *string) int {
	nonZeroIndex := len(*a)
	for index, char := range *a {
		if (char != '0') {
			nonZeroIndex = index
			break
		}
	}
	return nonZeroIndex
}

func greaterThan(x, y *string, x_index, y_index int) (bool, bool) {
	len_x := len(*x) - x_index
	len_y := len(*y) - y_index
	//print(len_x, len_y)
	if len_x != len_y {
		return false, len_x > len_y
	} else {
		for i:=0; i<len_x; i++ {
			xi := int((*x)[i+x_index])
			yi := int((*y)[i+y_index])
			if xi != yi {
				return false, xi > yi
			}
		}
	}
	return true, true
}

func main() {
	//defer profile.Start(profile.CPUProfile).Stop()
	var a, b string
	in := bufio.NewReader(os.Stdin)
	fmt.Fscanln(in, &a)
	fmt.Fscanln(in, &b)

	x := removeZeros(&a)
	y := removeZeros(&b)

	//print(x, " ", y)

	equal, greater := greaterThan(&a, &b, x, y)
	if equal {
		fmt.Println("=")
	} else if greater {
		fmt.Println(">")
	} else {
		fmt.Println("<")
	}
}

package main

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

func removeZeros(a *string) int {
	nonZeroIndex := len(*a)
	for index, char := range *a {
		if (char != '0') {
			nonZeroIndex = index
			break
		}
	}
	return nonZeroIndex
}

func greaterThan(x, y *string, x_index, y_index int) (bool, bool) {
	len_x := len(*x) - x_index
	len_y := len(*y) - y_index
	//print(len_x, len_y)
	if len_x != len_y {
		return false, len_x > len_y
	} else {
		for i:=0; i<len_x; i++ {
			xi := int((*x)[i+x_index])
			yi := int((*y)[i+y_index])
			if xi != yi {
				return false, xi > yi
			}
		}
	}
	return true, true
}

func main() {
	//defer profile.Start(profile.CPUProfile).Stop()
	var a, b string
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &a, &b)

	x := removeZeros(&a)
	y := removeZeros(&b)

	//print(x, " ", y)

	equal, greater := greaterThan(&a, &b, x, y)
	if equal {
		fmt.Println("=")
	} else if greater {
		fmt.Println(">")
	} else {
		fmt.Println("<")
	}
}

package main

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

func removeZeros(a string) string {
    nonZeroIndex := len(a)
    for index, char := range a {
        if (char != '0') {
            nonZeroIndex = index
            break
        }
    }

    return a[nonZeroIndex: len(a)]
}

func greaterThan(x, y string) bool {
    if (len(x) != len(y)) {
        return len(x) > len(y)
    } else {
        for index, _ := range x {
            xi := int(x[index])
            yi := int(y[index])
            if xi != yi {
                return xi > yi
            }
        }
    }
    return false
}

func main() {
	var a, b string
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &a, &b)

    x := removeZeros(a)
    y := removeZeros(b)

    print(x, " ", y)

    if (x == y) {
        fmt.Println("=")
    } else {
        if (greaterThan(x, y)) {
            fmt.Println(">")
        } else {
            fmt.Println("<")
        }
    }
}

package main

import (
	"fmt"
)

func main() {
	//fmt.Println("What is your favorite color?")
	var a, b string
	fmt.Scanf("%s%s", &a, &b)
	var firstOfA, firstOfB int = 0, 0
	for firstOfA < len(a) && a[firstOfA] == '0' {
		firstOfA = firstOfA + 1
	}
	var AIsZero, BIsZero bool = false, false
	if firstOfA == len(a) {
		AIsZero = true
	}
	for firstOfB < len(b) && b[firstOfB] == '0' {
		firstOfB = firstOfB + 1
	}
	if firstOfB == len(b) {
		BIsZero = true
	}
	if AIsZero && BIsZero {
		fmt.Println("=")
		return
	}
	var ALeftLen int = len(a) - firstOfA
	var BLeftLen int = len(b) - firstOfB
	if ALeftLen > BLeftLen {
		fmt.Println(">")
		return
	}
	if BLeftLen > ALeftLen {
		fmt.Println("<")
		return
	}
	for firstOfA < len(a) && firstOfB < len(b) {
		if a[firstOfA] > b[firstOfB] {
			fmt.Println(">")
			return
		} else if a[firstOfA] < b[firstOfB] {
			fmt.Println("<")
			return
		} else {
			firstOfA = firstOfA + 1
			firstOfB = firstOfB + 1
		}
	}
	fmt.Println("=")
}

package main

import (
    "fmt"
)

func removeZeros(a string) string {
    var nonZeroIndex int
    for index, char := range a {
        if (char != '0') {
            nonZeroIndex = index
            break
        }
    }

    return a[nonZeroIndex: len(a)]
}

func greaterThan(x, y string) bool {
    if (len(x) != len(y)) {
        return len(x) > len(y)
    } else {
        for index, _ := range x {
            xi := int(x[index])
            yi := int(y[index])
            if xi != yi {
                return xi > yi
            }
        }
    }
    return false
}

func main() {
    var a, b string
    fmt.Scanln(&a)
    fmt.Scanln(&b)

    x := removeZeros(a)
    y := removeZeros(b)

    if (x == y) {
        fmt.Println("=")
    } else {
        if (greaterThan(x, y)) {
            fmt.Println(">")
        } else {
            fmt.Println("<")
        }
    }
}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var num1, num2 string
	_, err := fmt.Scanf("%s\n%s\n", &num1, &num2)
	if err != nil {
		fmt.Println(err)
	}

	num1Trimmed := strings.TrimLeft(num1, "0")
	num2Trimmed := strings.TrimLeft(num2, "0")

	if strings.Compare(num1Trimmed, num2Trimmed) == 1 {
		fmt.Println(">")
	} else if strings.Compare(num1Trimmed, num2Trimmed) == -1 {
		fmt.Println("<")
	} else {
		fmt.Println("=")
	}

}

package main

import "fmt"

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

	if num1 > num2 {
		fmt.Println(">")
	} else if num1 < num2 {
		fmt.Println("<")
	} else {
		fmt.Println("=")
	}

}

package main

import (
	// "fmt"
	"bufio"
	"os"
	"strings"
	// "strconv"
	// "sort"
)

//N _
const (
	N = 1e6 + 5
)

func inputter(inputReader *bufio.Reader,strs chan *string){
	for {
		input , _ := inputReader.ReadString('\n')
		input = strings.TrimSpace(input)
		if len(input) > 0 {
			inputs := strings.Split(input, " ")
			for i := range inputs{
				strs <- &inputs[i]
			}
		}
	}
}

func main(){
	rs := bufio.NewReader(os.Stdin)
	ws := bufio.NewWriter(os.Stdout)

	strs := make(chan *string, 100)

	go inputter(rs, strs)

	number1 := strings.TrimLeft(*<-strs, "0")
	number2 := strings.TrimLeft(*<-strs, "0")

	if len(number1) + len(number2) == 0{
		ws.WriteString("=")
	} else if len(number1) > len(number2){
		ws.WriteString(">")
	} else if len(number1) < len(number2){
		ws.WriteString("<")
	} else {
		if number1 > number2{
			ws.WriteString(">")
		} else if len(number1) < len(number2){
			ws.WriteString("<")
		} else{
			ws.WriteString("=")
		}
	}
	ws.Flush()
	return
}


package main

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

// github.com/EndlessCheng/codeforces-go
func CF1254B2(_r io.Reader, out io.Writer) {
	_i, buf := 1<<12, make([]byte, 1<<12)
	rc := func() byte {
		if _i == 1<<12 {
			_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
	}
	min := func(a, b int64) int64 {
		if a < b {
			return a
		}
		return b
	}
	n := r()
	sum := make([]int64, n+1)
	for i := 1; i <= n; i++ {
		sum[i] = sum[i-1] + int64(r())
	}
	x := sum[n]
	if x < 2 {
		Fprint(out, -1)
		return
	}
	a := []int64{}
	for i := int64(2); i*i <= x; i++ {
		k := 0
		for ; x%i == 0; x /= i {
			k++
		}
		if k > 0 {
			a = append(a, i)
		}
	}
	if x > 1 {
		a = append(a, x)
	}
	ans := int64(1e18)
	for _, p := range a {
		s := int64(0)
		for _, v := range sum {
			s += min(v%p, p-v%p)
		}
		ans = min(ans, s)
	}
	Fprint(out, ans)
}

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

package main

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

func main() {
	in := bufio.NewReader(os.Stdin);
	out := bufio.NewWriter(os.Stdout);
	defer out.Flush();

	var n int
	fmt.Fscan(in, &n)

	as := make([]int64, n)
	var cnt int64 = 0
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &as[i])
		cnt += as[i]
	}

	divs := make([]int64, 0)
	for k := int64(2); k <= cnt; k++ {
		if cnt % k == 0 {
			divs = append(divs, k)
			for cnt % k == 0 {
				cnt /= k
			}
		}
	}

	if len(divs) == 0 {
		fmt.Println(-1)
		os.Exit(0)
	}

	var minAns int64 = -1
	for _, k := range divs {
		start := 0
		var part, ans int64
		as_cpy := append(as[:0:0], as...)
		for i := range as_cpy {
			as_cpy[i] = as_cpy[i] % k
		}
		for end := 0; end < n; end++ {
			part += as_cpy[end]
			if part >= k {
				tmp := part - k
				as_cpy[end] -= tmp

				ans += doAThing(as_cpy[start:end+1])
				part = 0
				start = end+1

				as_cpy[end] = tmp
			}
		}
		if minAns == -1 || ans < minAns {
			minAns = ans
		}
	}
	fmt.Fprintln(out, minAns)
}

func doAThing(arr []int64) int64 {
	if len(arr) == 1 {
		return 0
	}
	if arr[0] < arr[len(arr)-1] {
		arr[1] += arr[0]
		return arr[0] + doAThing(arr[1:])
	} else {
		arr[len(arr)-2] += arr[len(arr)-1]
		return arr[len(arr)-1] + doAThing(arr[:len(arr)-1])
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin);
	out := bufio.NewWriter(os.Stdout);
	defer out.Flush();

	var n int
	fmt.Fscan(in, &n)

	as := make([]int, n)
	cnt := 0
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &as[i])
		if as[i] == 1 {
			cnt++
		}
	}

	var k int
	found := false
	for k = 2; k <= cnt; k++ {
		if cnt % k == 0 {
			found = true
			break
		}
	}

	if !found {
		fmt.Println(-1)
		os.Exit(0)
	}

	ans := 0
	start := 0
	part := 0
	for end := 0; end < n; end++ {
		if as[end] == 1 {
			part++
		}
		if part == k {
			ans += doAThing(as[start:end+1])
			part = 0
			start = end+1
		}
	}
	fmt.Fprintln(out, ans)
}

func doAThing(arr []int) int {
	if len(arr) == 1 {
		return 0
	}
	if arr[0] < arr[len(arr)-1] {
		arr[1] += arr[0]
		return arr[0] + doAThing(arr[1:])
	} else {
		arr[len(arr)-2] += arr[len(arr)-1]
		return arr[len(arr)-1] + doAThing(arr[:len(arr)-1])
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin);
	out := bufio.NewWriter(os.Stdout);
	defer out.Flush();

	var n int
	fmt.Fscan(in, &n)

	as := make([]int, n)
	cnt := 0
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &as[i])
		cnt += as[i]
	}

	divs := make([]int, 0)
	for k := 2; k <= cnt; k++ {
		if cnt % k == 0 {
			divs = append(divs, k)
			for cnt % k == 0 {
				cnt /= k
			}
		}
	}

	if len(divs) == 0 {
		fmt.Println(-1)
		os.Exit(0)
	}

	minAns := -1
	for _, k := range divs {
		ans := 0
		start := 0
		part := 0
		as_cpy := append(as[:0:0], as...)
		for i := range as_cpy {
			as_cpy[i] = as_cpy[i] % k
		}
		for end := 0; end < n; end++ {
			part += as_cpy[end]
			if part >= k {
				tmp := part - k
				as_cpy[end] -= tmp

				ans += doAThing(as_cpy[start:end+1])
				part = 0
				start = end+1

				as_cpy[end] = tmp
			}
		}
		if minAns == -1 || ans < minAns {
			minAns = ans
		}
	}
	fmt.Fprintln(out, minAns)
}

func doAThing(arr []int) int {
	if len(arr) == 1 {
		return 0
	}
	if arr[0] < arr[len(arr)-1] {
		arr[1] += arr[0]
		return arr[0] + doAThing(arr[1:])
	} else {
		arr[len(arr)-2] += arr[len(arr)-1]
		return arr[len(arr)-1] + doAThing(arr[:len(arr)-1])
	}
}


package main

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

func processString(ss *string, resultStart *string, zeroCount *int64) {
    beautiful := 1
    if (*ss)[0] != '1' {
        beautiful = 0
    }
    q := len(*ss)
    if beautiful == 1 {
        for k := 1; k < q; k++ {
            if (*ss)[k] != '0' {
                beautiful = 0
                break
            }
        }
    }
    if beautiful == 0 {
        *resultStart = *ss
    } else {
        *zeroCount += int64(q-1)
    }
}

func main() {
    stin := bufio.NewReader(os.Stdin)
    ns,_ := stin.ReadBytes('\n')
    n,_ := strconv.Atoi(string(bytes.Trim(ns,"\n\r ")))

    resultStart := "1"
    zeroCount := int64(0)
    var tmp []byte
    for i := 0; i < n-1; i++ {
        tmp,_ = stin.ReadBytes(' ')
        ss := string(bytes.Trim(tmp," "))
        if ss == "0" {
            fmt.Printf("0")
            return
        }
        processString(&ss, &resultStart, &zeroCount)
    }
    tmp,_ = stin.ReadBytes('\n')
    ss := string(bytes.Trim(tmp,"\n\r"))
    if ss == "0" {
        fmt.Printf("0")
        return
    }
    processString(&ss, &resultStart, &zeroCount)
    fmt.Printf("%s", resultStart)
    if zeroCount%2 == int64(1) {
        fmt.Printf("0")
        zeroCount -= 1
    }
    for i := int64(0); i < zeroCount/2; i++ {
        fmt.Printf("00")
    }
}

package main

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

func main() {
    stin := bufio.NewReader(os.Stdin)
    ns,_ := stin.ReadBytes('\n')
    n,_ := strconv.Atoi(string(bytes.Trim(ns,"\n\r ")))

    resultStart := "1"
    zeroCount := int64(0)
    var tmp []byte
    for i := 0; i < n-1; i++ {
        tmp,_ = stin.ReadBytes(' ')
        ss := string(bytes.Trim(tmp," "))
        if ss == "0" {
            fmt.Printf("0")
            return
        }
        beautiful := 1
        if ss[0] != '1' {
            beautiful = 0
        }
        q := len(ss)
        if beautiful == 1 {
            for k := 1; k < q; k++ {
                if ss[k] != '0' {
                    beautiful = 0
                    break
                }
            }
        }
        if beautiful == 0 {
            resultStart = ss
        } else {
            zeroCount += int64(q-1)
        }
    }
    tmp,_ = stin.ReadBytes('\n')
    ss := string(bytes.Trim(tmp,"\n\r"))

        if ss == "0" {
            fmt.Printf("0")
            return
        }
        beautiful := 1
        if ss[0] != '1' {
            beautiful = 0
        }
        q := len(ss)
        if beautiful == 1 {
            for k := 1; k < q; k++ {
                if ss[k] != '0' {
                    beautiful = 0
                    break
                }
            }
        }
        if beautiful == 0 {
            resultStart = ss
        } else {
            zeroCount += int64(q-1)
        }

    fmt.Printf("%s", resultStart)
    if zeroCount%2 == int64(1) {
        fmt.Printf("0")
        zeroCount -= 1
    }
    for i := int64(0); i < zeroCount/2; i++ {
        fmt.Printf("00")
    }
}


package main

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

func main() {

	io := bufio.NewReader(os.Stdin)
	var t, l, r int
	fmt.Fscan(io, &t)
	for ; t > 0; t-- {
		fmt.Fscan(io, &l, &r)
		if r/l < 2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import (
	"fmt"
	"bufio"
	"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 solve() {
	var l, r int
	scanf("%d %d\n", &l, &r)
	ans := "NO"
	if 2 * l >= r + 1 {
		ans = "YES"
	}
	printf("%s\n", ans)
}

func main() {
	defer writer.Flush()
	var t int
	scanf("%d\n", &t)
	for ; t > 0; t-- {
		solve()
	}
}

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 min_int(a int, b int) int { if a < b { return a } else { return b } }
func min_int64(a int64, b int64) int64 { if a < b { return a } else { return b } }

func max_int(a int, b int) int { if a > b { return a } else { return b } }
func max_int64(a int64, b int64) int64 { if a > b { return a } else { return b } }

func main() {
	defer writer.Flush()

	var T int = 0
	scanf("%d\n", &T)

	for t := 0; t < T; t++ {

		var l, r int64
		scanf("%d %d\n", &l, &r)

		var a int64 = r + 1

		var l_left_side float64 = float64(l % a)
		var l_right_side float64 = float64(float64(a)/2.0)

		var r_left_side float64 = float64(r % a)
		var r_right_side = float64(float64(a)/2.0)

		// printf("%f\n", float64(l)/float64(a))
		// printf("%f %f\n", l_left_side, l_right_side)

		if l_left_side >= l_right_side && r_left_side >= r_right_side {
			printf("YES\n")
		} else {
			printf("NO\n")
		}

	}

}

// Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools

package main

import (
	"fmt"
)

func main() {
	// Write your solution here
	var t int
	fmt.Scanf("%d\n", &t)
	for ;t>0; t-- {
		var l, r int
		fmt.Scanf("%d %d\n", &l, &r)

		minA := 2*(r-l)+1
		maxA := 2*l
		if minA<=maxA {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

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

	var T, l, r int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &l, &r)
		if l >= r/2+1 {
			Fprintln(out, "YES")
		} else {
			Fprintln(out, "NO")
		}
	}
}

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

package main
import "fmt"
func main() {
	q := 0
	fmt.Scan(&q)
	for t := 0; t < q; t++ {
		var l, r int
		fmt.Scan(&l, &r)
		if 2 * l > r {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

import "fmt"

func main() {
	var t, l, r int

	fmt.Scanf("%d\n", &t)

	for i := 0; i < t; i++ {

		fmt.Scanf("%d %d\n", &l, &r)

		if (2*(r-l) + 1) <= 2*l {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

import "fmt"

func main() {
	var t, l, r int

	fmt.Scanf("%d\n", &t)

	for i := 0; i < t; i++ {

		fmt.Scanf("%d %d\n", &l, &r)

		minA := 2*(r-l) + 1
		if minA <= 2*l {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

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

var scanner = bufio.NewScanner(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func print(str string) {
	writer.WriteString(str)
}

func nextInt() int {
	scanner.Scan()
	str := scanner.Text()
	val, _ := strconv.Atoi(str)
	return val
}

func nextFloat() float64 {
	scanner.Scan()
	str := scanner.Text()
	val, _ := strconv.ParseFloat(str, 64)
	return val
}

func nextString() string {
	scanner.Scan()
	str := scanner.Text()
	return str
}

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

func main() {
	scanner.Split(bufio.ScanWords)
	defer writer.Flush()

	t := nextInt()
	for t != 0 {
		L := nextInt()
		R := nextInt()
		if L >= (R + 1 + 1) / 2 {
			print("yes\n")
		} else {
			print("no\n")
		}
		t--
	}
}

package main

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

var (
	t int16
	l int32
	r int32
	a int32
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &t)

	for ; t > 0; t-- {
		fmt.Fscan(reader, &l, &r)

		fmt.Println(check(l, r))
	}

}

func check(l int32, r int32) string {
	flag := false

	if l >= (r+2)/2 {
		flag = true
	}

	if flag {
		return "YES"
	} else {
		return "NO"
	}
}

package main

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

var (
	t int16
	l int32
	r int32
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &t)

	for ; t > 0; t-- {
		fmt.Fscan(reader, &l, &r)

		fmt.Println(check(l, r))
	}

}

func check(l int32, r int32) string {
	flag := false

	if l < 1 {
		a := l - 1

		if l%a >= a/2.0 && r%a > a/2.0 {
			flag = true
		}
	}

	a := r + 1

	if l%a > a/2 && r%a > a/2 {
		flag = true
	}

	if flag {
		return "YES"
	} else {
		return "NO"
	}
}

package main

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

var (
	t int16
	l int32
	r int32
	a int32
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &t)

	for ; t > 0; t-- {
		fmt.Fscan(reader, &l, &r)

		fmt.Println(check(l, r))
	}

}

func check(l int32, r int32) string {
	flag := false

	if l > 1 {
		a = l - 1

		if float32(l%a) >= float32(a)/2 && float32(r%a) >= float32(a)/2 {
			flag = true
		}
	}

	a = r + 1

	//fmt.Println(a, l%a, float32(a)/2, r%a)

	if float32(l%a) >= float32(a)/2 && float32(r%a) >= float32(a)/2 {
		flag = true
	}

	if flag {
		return "YES"
	} else {
		return "NO"
	}
}

package main

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

var (
	t int16
	l int32
	r int32
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &t)

	for ; t > 0; t-- {
		fmt.Fscan(reader, &l, &r)

		fmt.Println(check(l, r))
	}

}

func check(l int32, r int32) string {
	flag := false

	if l < 1 {
		a := l - 1

		if l%a >= a/2.0 && r%a >= a/2.0 {
			flag = true
		}
	}

	a := r + 1

	if l%a >= a/2 && r%a >= a/2 {
		flag = true
	}

	if flag {
		return "YES"
	} else {
		return "NO"
	}
}

package main

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

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

	var T, l, r int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &l, &r)
		if l >= (r+1)/2 {
			Fprintln(out, "YES")
		} else {
			Fprintln(out, "NO")
		}
	}
}

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

package main

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

func main() {

	io := bufio.NewReader(os.Stdin)
	var t, l, r int
	fmt.Fscan(io, &t)
	for ; t > 0; t-- {
		fmt.Fscan(io, &l, &r)
		if r/l < 2 {
			fmt.Print("YES")
		} else {
			fmt.Print("NO")
		}
	}
}

package main

import "fmt"

func main() {
	var t, l, r int

	fmt.Scanf("%d", &t)

	for i := 0; i < t; i++ {

		fmt.Scanf("%d %d", &l, &r)

		if (2*(r-l) + 1) <= 2*l {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

import "fmt"

func main() {
	var t, l, r int

	fmt.Scanf("%d", &t)

	for i := 0; i < t; i++ {

		fmt.Scanf("%d %d", l, r)

		if l*2 > r {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

import "fmt"

func main() {
	var t, l, r int

	fmt.Scanf("%d", &t)

	for i := 0; i < t; i++ {

		fmt.Scanf("%d %d", &l, &r)

		if l*2 > r {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}

package main

import "fmt"

func main() {
	var t, l, r int

	fmt.Scanf("%d", &t)

	for i := 0; i < t; i++ {

		fmt.Scanf("%d %d\n", &l, &r)

		if (2*(r-l) + 1) <= 2*l {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}

	}
}


package main

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

const NUM_VERTEX = 500

var vertex_value [NUM_VERTEX]int

func main() {
  reader := bufio.NewReader(os.Stdin)
  var n, m int
  fmt.Fscan(reader, &n, &m)
  for i := 0; i < n; i++ {
    fmt.Fscan(reader, &vertex_value[i])
  }
  var density float64 = 0
  for i := 0; i < m; i++ {
    var a, b, c int
    fmt.Fscan(reader, &a, &b, &c)
    a--
    b--
    new_density := float64(vertex_value[a]+vertex_value[b]) / float64(c)
    if new_density > density {
      density = new_density
    }
  }
  fmt.Printf("%.9f\n", density)
}

package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	var n, m int
	fmt.Fscan(r, &n, &m)

	vs := make([]float64, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(r, &vs[i])
	}

	var best float64
	for i := 0; i < m; i++ {
		var v0, v1 int
		var c float64
		fmt.Fscan(r, &v0, &v1, &c)

		w := (vs[v0-1]+vs[v1-1])/c
		if w > best {
			best = w
		}
	}
	fmt.Println(best)
}

package main

import (
	"fmt"
	"sort"
)

const (
	tresh = 1000
)

var (
	x int64
	as []int
	bs []int
)

func getNextX() int {
    x = (x * 37 + 10007) % 1000000007
    return int(x)
}

type Indicies []int
func (a Indicies) Len() int           { return len(a) }
func (a Indicies) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a Indicies) Less(i, j int) bool { return as[a[i]] > as[a[j]] }

func main() {
	var n, d int
	fmt.Scan(&n, &d, &x)

	as = make([]int, n)
	bs = make([]int, n)
	for i := 0; i < n; i++ {
		as[i] = i+1
		if i < d {
			bs[i] = 1
		}
	}
	for i := 0; i < n; i++ {
		j := getNextX() % (i + 1)
		as[i], as[j] = as[j], as[i]
	}
	for i := 0; i < n; i++ {
		j := getNextX() % (i + 1)
		bs[i], bs[j] = bs[j], bs[i]
	}

	if d < tresh {
		cs := make([]int, n)
		for i := 0; i < n; i++ {
			if bs[i] == 1 {
				for j := i; j < n; j++ {
					if cs[j] < as[j-i] {
						cs[j] = as[j-i]
					}
				}
			}
		}
		for _, c := range cs {
			fmt.Println(c)
		}
	} else {
		var ordered Indicies = make([]int, n)
		for i := 0; i < n; i++ {
			ordered[i] = i
		}
		sort.Sort(ordered)
		for j := 0; j < n; j++ {
			for _, i := range ordered {
				if j-i >= 0 && bs[j-i] == 1 {
					fmt.Println(as[i])
					break
				}
			}
		}
	}
}


package main

import "fmt"
import "bufio"
import "os"
import "strings"
import "strconv"

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	var x int64
	x, _ = strconv.ParseInt(s[1], 10, 64)
	var d int64
	d = 0
	for scanner.Scan() {
		s := strings.Split(scanner.Text(), " ")
		v, _ := strconv.ParseInt(s[1], 10, 64)
		if s[0] == "-" {
			if v > x {
				d += 1
			} else {
				x -= v
			}
		} else {
			x += v
		}

	}
	fmt.Printf("%d %d", x, d)
}

package main

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

func main() {
	var stockPacks, packs, distressChilds int64
	var operations int
	var currentOpertaion string
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &operations)
	fmt.Fscan(reader, &stockPacks)
	for index := 0; index < operations; index++ {
		fmt.Fscan(reader, &currentOpertaion)
		fmt.Fscan(reader, &packs)
		if currentOpertaion == "+" {
			stockPacks += packs
		} else if currentOpertaion == "-" {
			if packs > stockPacks {
				distressChilds++
			} else {
				stockPacks -= packs
			}
		}

	}
	fmt.Println(stockPacks, distressChilds)
}

package main

import "fmt"

func main(){
	var n int
	var x int64
	fmt.Scan(&n, &x)

	var op string
	var d int64
	var ans = 0
	for i := 0; i < n; i++{
		fmt.Scan(&op, &d)
		if op == "+"{
			x += d;
		}else {
			if x >= d {

				x -= d
			}else {
				ans++
			}
		}
	}
	fmt.Println(x, ans)
}

package main

import "fmt"

func main() {
	var x int64
	var n, notSatisfied int
	fmt.Scan(&n, &x)
	for i := 0; i<n; i++ {
		var sign string
		var amount int64
		fmt.Scan(&sign, &amount)
		if sign == "+" {
			x += amount
		} else if x >= amount {
			x -= amount
		} else {
			notSatisfied++
		}
	}
	fmt.Println(x, notSatisfied)
}

package main

import "fmt"

func main() {
	var n, iceCreams, i int64
	fmt.Scanf("%d %d\n", &n, &iceCreams)
	var distress int64
	for i = 0; i < n; i++ {
		var sign string
		var value int64
		fmt.Scanf("%s %d\n", &sign, &value)
		if sign == "+" {
			iceCreams += value
		} else {
			if iceCreams >= value {
				iceCreams -= value
			} else {
				distress += 1
			}
		}

	}
	fmt.Print(iceCreams)
	fmt.Print(" ")
	fmt.Println(distress)

}

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 10000000)
	var n, x int
	fmt.Scanf("%d %d\n", &n, &x)
	var sum int64
	sum = int64(x)
	sad := 0
	for i:=0; i< n; i++{
		bytes, _ ,_ := reader.ReadLine()
		strs := strings.Split(string(bytes), " ")
		v, _ := strconv.Atoi(strs[1])
		if strs[0] == "-" {
			v = -v
		}
		if sum + int64(v) < 0 {
			sad ++
		} else {
			sum += int64(v)
		}
	}
	fmt.Printf("%d %d",sum , sad)
}

package main
import (
	"fmt"
)

func main(){
	var n int
	var c string
	var d,di int64
	fmt.Scan(&n)
	fmt.Scan(&d)
	var sum int64 = d
	var counter int64 = 0
 	for i:=0; i < n; i++{
		fmt.Scan(&c)
		fmt.Scan(&di)

		if c == "+"{
			sum += di
		}else{
			if di <= sum{
				sum -= di
			}else{
				counter++
			}
		}
	}
	output := fmt.Sprintf("%v %v",sum,counter)
	fmt.Println(output)
}

package main

import "fmt"

func main() {
	var n, x, k int64
	fmt.Scan(&n, &x)
	for i := int64(1); i <= n; i++ {
		var s string
		var xi int64
		fmt.Scan(&s, &xi)
		if s == "+" {
			x += xi
		} else {
			if x < xi {
				k++
			} else {
				x -= xi
			}
		}
	}
	fmt.Printf("%d %d\n", x, k)
}

package main

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

func main() {
	var n, gon uint16
	var x, z uint64
	var o string
	in := bufio.NewReader(os.Stdin)
	fmt.Fscanf(in, "%d %d\n", &n, &x)
	for i := uint16(0); i < n; i++ {
		fmt.Fscanf(in, "%s %d\n", &o, &z)
		if string(o) == "+" {
			x += z
		} else {
			if z <= x {
				x -= z
			} else {
				gon++
			}
		}
	}
	fmt.Println(x, gon)
}

package main

import "fmt"

func main() {
	var n, m, x, i, cnt int64
	fmt.Scan(&n, &m)
	var s string
	for i = 0; i < n; i++ {
		fmt.Scan(&s, &x)
		if s == "+" {
			m += x
		} else if s == "-" && m-x >= 0 {
			m -= x
		} else {
			cnt++
		}
	}
	fmt.Print(m, " ", cnt)
}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var n int
	var x int64
	fmt.Scan(&n, &x)

	var distress int = 0
	for i:= 0; i < n; i++ {
		var s string
		var amount int64
		fmt.Scan(&s, &amount)
		if strings.Compare(s, "-") == 0 {
			if amount <= x {
				x -= amount
				//fmt.Println("min")
			} else {
				distress++
				//fmt.Println("distress")
			}
		} else {
			x += amount
			//fmt.Println("Add")
		}
	}
	fmt.Printf("%d %d", x, distress)
}

package main

import "fmt"

func main() {
	var x int64
	var n, notSatisfied int
	fmt.Scan(&n, &x)
	for i := 0; i<n; i++ {
		var sign string
		var amount int64
		fmt.Scanf("%s %v\n", &sign, &amount)
		if sign == "+" {
			x += amount
		} else if x >= amount {
			x -= amount
		} else {
			notSatisfied++
		}
	}
	fmt.Println(x, notSatisfied)
}

package main

import "fmt"

func main() {
	var n, iceCreams int
	fmt.Scanf("%d %d\n", &n, &iceCreams)
	var distress int
	for i := 0; i < n; i++ {
		var sign string
		var value int
		fmt.Scanf("%s %d\n", &sign, &value)
		if sign == "+" {
			iceCreams += value
		} else {
			if iceCreams >= value {
				iceCreams -= value
			} else {
				distress += 1
			}
		}

	}
	fmt.Print(iceCreams)
	fmt.Print(" ")
	fmt.Println(distress)

}

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 10000000)
	var n, x int
	fmt.Scanf("%d %d\n", &n, &x)
	var sum int64
	sum = int64(x)
	sad := 0
	for i:=0; i< n; i++{
		bytes, _ ,_ := reader.ReadLine()
		strs := strings.Split(string(bytes), " ")
		v, _ := strconv.Atoi(strs[1])
		if strs[0] == "-" {
			v = -v
		}
		if sum + int64(v) < 0 {
			sad ++
		} else {
			sum += int64(v)
		}
	}
	fmt.Printf("%d %d",x , sad)
}

package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 10000000)
	var n, x int
	fmt.Scanf("%d %d\n", &n, &x)
	sad := 0
	for i:=0; i< n; i++{
		bytes, _ ,_ := reader.ReadLine()
		strs := strings.Split(string(bytes), " ")
		v, _ := strconv.Atoi(strs[1])
		if strs[0] == "-" {
			v = -v
		}
		if x + v < 0 {
			sad ++
		} else {
			x += v
		}
	}
	fmt.Printf("%d %d",x , sad)
}

package main

import "fmt"

func main() {
	var n, x, k int64
	fmt.Scanf("%d %d", &n, &x)
	for i := int64(1); i <= n; i++ {
		var s string
		var xi int64
		fmt.Scanf("%s %d", &s, &xi)
		if s == "+" {
			x += xi
		} else {
			if x < xi {
				k++
			} else {
				x -= xi
			}
		}
	}
	fmt.Printf("%d %d\n", x, k)
}

package main

import "fmt"

func main() {
	var n, x, k int64
	fmt.Scanf("%d %d", &n, &x)
	for i := int64(1); i <= n; i++ {
		var s string
		var xi int64
		fmt.Scanf("%s %d", s, &xi)
		if s == "+" {
			x += xi
		} else {
			if x < xi {
				k++
			} else {
				x -= xi
			}
		}
	}
	fmt.Printf("%d %d\n", x, k)
}

package main

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

func main() {
	var n, gon uint16
	var x, z uint32
	var o string
	in := bufio.NewReader(os.Stdin)
	fmt.Fscanf(in, "%d %d\n", &n, &x)
	for i := uint16(0); i < n; i++ {
		fmt.Fscanf(in, "%s %d\n", &o, &z)
		if string(o) == "+" {
			x += z
		} else {
			if z <= x {
				x -= z
			} else {
				gon++
			}
		}
	}
	fmt.Println(x, gon)
}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var n, x int
	fmt.Scanf("%d%d", &n, &x)

	var distress int = 0
	for i:= 0; i < n; i++ {
		var s string
		var amount int
		fmt.Scanf("%s%d", &s, &amount)
		if strings.Compare(s, "-") == 0 {
			if amount <= x {
				x -= amount
				//fmt.Println("min")
			} else {
				distress++
				//fmt.Println("distress")
			}
		} else {
			x += amount
			//fmt.Println("Add")
		}
	}
	fmt.Printf("%d %d", x, distress)
}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var n, x int
	fmt.Scan(&n, &x)

	var distress int = 0
	for i:= 0; i < n; i++ {
		var s string
		var amount int
		fmt.Scan(&s, &amount)
		if strings.Compare(s, "-") == 0 {
			if amount <= x {
				x -= amount
				//fmt.Println("min")
			} else {
				distress++
				//fmt.Println("distress")
			}
		} else {
			x += amount
			//fmt.Println("Add")
		}
	}
	fmt.Printf("%d %d", x, distress)
}

package main

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

func main() {
	var operations, stockPacks, packs, distressChilds int
	var currentOpertaion string
	reader := bufio.NewReader(os.Stdin)
	fmt.Fscan(reader, &operations)
	fmt.Fscan(reader, &stockPacks)
	for index := 0; index < operations; index++ {
		fmt.Fscan(reader, &currentOpertaion)
		fmt.Fscan(reader, &packs)
		if currentOpertaion == "+" {
			stockPacks += packs
		} else if currentOpertaion == "-" {
			if packs > stockPacks {
				distressChilds++
			} else {
				stockPacks -= packs
			}
		}

	}
	fmt.Println(stockPacks, distressChilds)
}

package main

import "fmt"

func main(){
	var n, x int
	fmt.Scan(&n, &x)

	var op string
	var d int
	var ans = 0
	for i := 0; i < n; i++{
		fmt.Scan(&op, &d)
		if op == "+"{
			x += d;
		}else {
			if x >= d {

				x -= d
			}else {
				ans++
			}
		}
	}
	fmt.Println(x, ans)
}

package main

import "fmt"
import "bufio"
import "os"
import "strings"
import "strconv"

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	s := strings.Split(scanner.Text(), " ")
	x, _ := strconv.Atoi(s[1])
	d := 0
	for scanner.Scan() {
		s := strings.Split(scanner.Text(), " ")
		v, _ := strconv.Atoi(s[1])
		if s[0] == "-" {
			if v > x {
				d += 1
			} else {
				x -= v
			}
		} else {
			x += v
		}

	}
	fmt.Printf("%d %d", x, d)
}