package main

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

func main() {
	var a [1000005]float64
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	scanner.Scan()
	w, _ := strconv.Atoi(scanner.Text())
	for i := 0; i < 2*n; i++ {
		scanner.Scan()
		t, _ := strconv.Atoi(scanner.Text())
		a[i] = float64(t)
	}
	sort.Float64s(a[:2*n])
	totalTea := math.Min(a[0]*2, a[n]) * 1.5 * float64(n)
	fmt.Println(math.Min(float64(w), totalTea))
}

//http://codeforces.com/problemset/problem/557/B

package main

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

func main() {
	reader := NewStdReader(os.Stdin)
	n, w := reader.ReadInt(), reader.ReadInt()

	a := make([]int, 2*n)
	for i := 0; i < 2*n; i++ {
		a[i] = reader.ReadInt()
	}

	sort.Ints(a)

	x := float64(w) / float64(3*n)
	if float64(a[0]) < x {
		x = float64(a[0])
	}
	if float64(a[n])/2 < x {
		x = float64(a[n]) / 2
	}

	maxw := float64(3*n) * x
	fmt.Print(maxw)
}

type StdReader struct {
	buf *bufio.Reader
}

func NewStdReader(reader io.Reader) *StdReader {
	return &StdReader{bufio.NewReaderSize(reader, 20*1024*1024)}
}

func (std *StdReader) ReadInt() int {

	r := 0
	sign := 1
	ok := false

	for {
		b, e := std.buf.ReadByte()

		if e != nil {
			break
		}
		if b >= '0' && b <= '9' {
			r = r*10 + int(b-'0')
			ok = true
		} else {
			if ok {
				break
			} else {
				if b == '-' {
					sign = -sign
				}
			}
		}
	}

	return sign * r
}

package main

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

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

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

	n, w := nextInt64(), nextInt64()
	a := make([]int, n*2)

	for i := range a {
		a[i] = nextInt()
	}

	sort.Ints(a)
	var a0, an int64 = int64(a[0]), int64(a[n])

	if a0*2 <= an {
		if a0*3*n <= w {
			println(a0 * 3 * n)
		} else {
			println(w)
		}
	} else {
		if an*3*n <= w*2 {
			println(float64(an*n)/2 + float64(an*n))
		} else {
			println(w)
		}
	}
}

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

func next() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

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

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

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }

package main

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

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 getLine() string {
	s, _ := reader.ReadString('\n')
	for len(s) > 0 && (s[len(s)-1] == '\n' || s[len(s)-1] == '\r') {
		s = s[:len(s)-1]
	}
	return s
}

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()

	var n int
	var w float64
	scanf("%d %f\n", &n, &w)
	var a = make([]float64, n*2)
	for i := 0; i < 2*n; i++ {
		scanf("%f", &a[i])
	}
	sort.Float64s(a)
	var ans float64
	if a[0]*2 <= a[n] {
		ans = a[0] * float64(3*n)
	} else {
		ans = a[n] * 1.5 * float64(n)
	}
	if ans > w {
		printf("%f\n", w)
	} else {
		printf("%f\n", ans)
	}

}

package main

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

func solve(n float64, capacity float64, arr []int) float64 {
	sort.Slice(arr, func(i int, j int) bool { return arr[i] > arr[j] })
	minB := float64(arr[int(n)-1])
	minG := float64(arr[2*int(n)-1])

	need := minB*n + (minB/2)*n
	if minB/2 <= minG && need < capacity {
		return need
	}

	need = minG*2*n + minG*n
	if minB/2 > minG && need < capacity {
		return need
	}

	return capacity
}

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

	var n, capacity float64
	fmt.Fscanf(r, "%g %g\n", &n, &capacity)

	arr := make([]int, int(n)*2)
	for i := range arr {
		fmt.Fscanf(r, "%d", &arr[i])
	}

	fmt.Fprintf(os.Stdout, "%g\n", solve(n, capacity, arr))
}

package main

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

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

	an := make([]int, n*2, n*2)
	bs := bufio.NewScanner(os.Stdin)
	bs.Split(bufio.ScanWords)

	for i := 0; i < 2*n; i++ {
		bs.Scan()
		an[i], _ = strconv.Atoi(bs.Text())
	}

	sort.Sort(sort.IntSlice(an))

	var each float32
	each = float32(an[0])
	if float32(an[n]) < each*2 {
		each = float32(an[n]) / 2
	}
	ans := each * 3 * float32(n)
	if ans > float32(w) {
		ans = float32(w)
	}
	fmt.Println(ans)
}

package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	var n int
	var w float64
	fmt.Fscanf(r, "%d %f\n", &n, &w)

	cups := make([]float64, 2*n)

	for i := 0; i < 2*n; i++ {
		fmt.Fscanf(r, "%f", &cups[i])
	}
	sort.Float64Slice(cups).Sort()

	minW := math.Min(cups[n], 2*cups[0])

	total := 1.5 * minW * float64(n)

	if total > w {
		total = w
	}

	fmt.Println(total)
}

package main

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

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

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

	n, w := nextInt(), nextInt()
	a := make([]int, n*2)

	for i := range a {
		a[i] = nextInt()
	}

	sort.Ints(a)

	if int64(a[0]*2) <= int64(a[n]) {
		if int64(a[0]*3*n) <= int64(w) {
			println(int64(a[0] * 3 * n))
		} else {
			println(w)
		}
	} else {
		if int64(a[n]*3*n) <= int64(w*2) {
			println(float64(a[n]*n)/2 + float64(a[n]*n))
		} else {
			println(w)
		}
	}
}

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

func next() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

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

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

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }

package main

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

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

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

	n, w := nextInt(), nextInt()
	a := make([]int, n*2)

	for i := range a {
		a[i] = nextInt()
	}

	sort.Ints(a)

	if a[0]*2 <= a[n] {
		if int64(a[0]*3*n) <= int64(w) {
			println(int64(a[0] * 3 * n))
		} else {
			println(w)
		}
	} else {
		if int64(a[n]*3*n) <= int64(w*2) {
			println(float64(a[n]*n)/2 + float64(a[n]*n))
		} else {
			println(w)
		}
	}
}

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

func next() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}

func nextInt64() int64 {
	n, _ := strconv.ParseInt(next(), 0, 64)
	return n
}

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

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

func println(a ...interface{})               { fmt.Fprintln(writer, a...) }
func print(a ...interface{})                 { fmt.Fprint(writer, a...) }
func printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }

package main

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

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 getLine() string {
	s, _ := reader.ReadString('\n')
	for len(s) > 0 && (s[len(s)-1] == '\n' || s[len(s)-1] == '\r') {
		s = s[:len(s)-1]
	}
	return s
}

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()

	var n, w int
	scanf("%d %d\n", &n, &w)
	var a = make([]int, n*2)
	for i := 0; i < 2*n; i++ {
		scanf("%d", &a[i])
	}
	sort.Ints(a)
	var ans float64
	if a[0]*2 <= a[n] {
		ans = float64(a[0] * 3 * n)
	} else {
		ans = float64(a[n]*n) * 1.5
	}
	if ans > float64(w) {
		printf("%d\n", w)
	} else {
		printf("%f\n", ans)
	}

}

package main

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

func main() {
	var a [1000005]float64
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	scanner.Scan()
	w, _ := strconv.Atoi(scanner.Text())
	for i := 0; i < 2*n; i++ {
		fmt.Scan()
		t, _ := strconv.Atoi(scanner.Text())
		a[i] = float64(t)
	}
	sort.Float64s(a[:2*n])
	totalTea := math.Min(a[0]*2, a[n]) * 1.5 * float64(n)
	fmt.Println(math.Min(float64(w), totalTea))
}


package main

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

func main() {
    var n int
    var l int
    var r int
    in := bufio.NewReader(os.Stdin)

    fmt.Fscan(in, &n)
    fmt.Fscan(in, &l)
    fmt.Fscan(in, &r)

    l -= 1
    r -= 1

    a := make([]int, 100111)
    b := make([]int, 100111)

    for i := 0; i < n; i++ {
        fmt.Fscan(in, &a[i])
    }
    for i := 0; i < n; i++ {
        fmt.Fscan(in, &b[i])
    }

    a2 := make([]int, 100111)
    b2 := make([]int, 100111)

    var ok bool = true
    for i := 0; i < n; i++ {
        if l <= i && i <= r {
            a2[a[i]] += 1
            b2[b[i]] += 1
        } else {
            if (a[i] != b[i]) {
                ok = false
            }
        }
    }

    for i := 0; i < 100111; i++ {
        if a2[i] != b2[i] {
            ok = false
        }
    }

    if ok {
        fmt.Printf("TRUTH\n");
    } else {
        fmt.Printf("LIE\n");
    }
}

package main

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

func main() {
	var n, l, r int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &n, &l, &r)
	a := new([100005]int)
	b := new([100005]int)
	for i := 1; i <= n; i++ {
		fmt.Fscan(in, &a[i])
	}
	for i := 1; i <= n; i++ {
		fmt.Fscan(in, &b[i])
	}
	fg := 0
	for i := 1; i < l; i++ {
		if a[i] != b[i] {
			fg = 1
		}
	}
	for i := r + 1; i <= n; i++ {
		if a[i] != b[i] {
			fg = 1
		}
	}
	if fg == 1 {
		fmt.Println("LIE")
	} else {
		fmt.Println("TRUTH")
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
    buf, _ := reader.ReadString('\n')
    buf = strings.TrimSpace(buf)

    list := strings.Split(buf, " ")

    n, _ := strconv.Atoi(list[0])
    l, _ := strconv.Atoi(list[1])
    r, _ := strconv.Atoi(list[2])
    l--
    r--

    as, _ := reader.ReadString('\n')
    as = strings.TrimSpace(as)
    bs, _ := reader.ReadString('\n')
    bs = strings.TrimSpace(bs)

    a := strings.Split(as, " ")
    b := strings.Split(bs, " ")

    for i := 0; i < l; i++ {
        if a[i] != b[i] {
            fmt.Println("LIE")
            return
        }
    }

    for i := r + 1; i < n; i++ {
        if a[i] != b[i] {
            fmt.Println("LIE")
            return
        }
    }

    var mid1 []int
    var mid2 []int

    for i := l; i <= r; i++ {
        aitem, _ := strconv.Atoi(a[i])
        bitem, _ := strconv.Atoi(b[i])

        mid1 = append(mid1, aitem)
        mid2 = append(mid2, bitem)
    }

    sort.Ints(mid1)
    sort.Ints(mid2)

    for i := range mid1 {
        if mid1[i] != mid2[i] {
            fmt.Println("LIE")
            return
        }
    }
    fmt.Println("TRUTH")
}

package main

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

func main() {
	var n, l ,r,i,count rune
	fmt.Scan(&n, &l, &r)
	in := bufio.NewReader(os.Stdin)
	a := make([]rune, n+5, n+5)
	for i=1; i <= n; i++ {
		fmt.Fscan(in,&a[i])
	}
	b := make([]rune, n+5, n+5)
	for i=1; i <= n; i++ {
		fmt.Fscan(in,&b[i])
	}
	for i=1;i < l; i++ {
	   if a[i]!=b[i] {
	      count++
	   }
	}
	for i=r+1 ;i <= n; i++ {
	   if a[i]!=b[i] {
	      count++
	   }
	}
	if count>0 {
	   fmt.Println("LIE")
	}else{
	   fmt.Println("TRUTH")
	}
}

package main

import (
    "io/ioutil"
    "os"
    "fmt"
    "sort"
)

func getInts() []int {
    //assumes POSITIVE INTEGERS. Check v for '-' if you have negative.
    var buf []byte
    buf, _ = ioutil.ReadAll(os.Stdin)
    var ints []int
    num := 0
    found := false
    for _, v := range buf {
        if '0' <= v && v <= '9' {
            num = 10*num + int(v - '0') //could use bitshifting here.
            found = true
        } else if found {
            ints = append(ints, num)
            found = false
            num = 0
        }
    }
    if found {
        ints = append(ints, num)
        found = false
        num = 0
    }
    return ints
}

func main() {
    var ints []int

    ints = getInts()

	var n, l, r int
	n = ints[0]
	l = ints[1]
	r = ints[2]

	var a []int
	var b []int

	a = ints[3:3+n]
	b = ints[3+n:3+2*n]

	sort.Ints(a[l-1:r])
	sort.Ints(b[l-1:r])

	for i := 0; i < n; i++ {
	    if a[i] != b[i] {
	        fmt.Println("LIE")
	        return
	    }
	}

	fmt.Println("TRUTH")
}

package main

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

func main() {
    var n int
    var l int
    var r int
    in := bufio.NewReader(os.Stdin)

    fmt.Fscan(in, &n)
    fmt.Fscan(in, &l)
    fmt.Fscan(in, &r)

    l -= 1
    r -= 1

    a := make([]int, 100111)
    b := make([]int, 100111)

    for i := 0; i < n; i++ {
        fmt.Fscan(in, &a[i])
    }
    for i := 0; i < n; i++ {
        fmt.Fscan(in, &b[i])
    }

    a2 := make([]int, r - l + 1)
    b2 := make([]int, r - l + 1)

    var cur int = 0
    var ok bool = true
    for i := 0; i < n; i++ {
        if l <= i && i <= r {
            a2[cur] = a[i]
            b2[cur] = b[i]
            cur += 1
        } else {
            if (a[i] != b[i]) {
                ok = false
            }
        }
    }

    sort.Ints(a2)
    sort.Ints(b2)

    for i := 0; i < len(a2); i++ {
        if a2[i] != b2[i] {
            ok = false
        }
    }

    if ok {
        fmt.Printf("TRUTH\n");
    } else {
        fmt.Printf("LIE\n");
    }
}

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

func main() {
    sc := NewScanner()
    n := sc.NextInt()
    l := sc.NextInt()
    r := sc.NextInt()
    var q[100001] int
    a := sc.NextIntArray()
    for i := 0; i < n; i++ {
        if i >= l - 1 && i <= r - 1 {
            q[a[i]]++
        }
    }
    b := sc.NextIntArray()
    for i := 0; i < n; i++ {
        if i >= l - 1 && i <= r - 1 {
            q[b[i]]--
        }
    }
    var z = 0
    for i := 0; i < n; i++ {
        if i < l - 1 || i > r - 1 {
            if a[i] != b[i] {
                z = 1
            }
        }
    }
    for i := 0; i <= n; i++ {
        if q[i] != 0 {
            z = 1
        }
    }
    if z == 0 {
        fmt.Println("TRUTH")
    } else {
        fmt.Println("LIE")
    }
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

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

const MAX_N = 100001 + 1

var (
	Inp  = bufio.NewReader(os.Stdin)
	N, l, r int
	A    [MAX_N]int
	B    [MAX_N]int
	q []int
	w []int
	flag bool
)

func main() {
	fmt.Fscan(Inp, &N, &l, &r)
	for i := 1; i <= N; i++ {
		fmt.Fscan(Inp, &A[i])
	}
	for i := 1; i <= N; i++ {
		fmt.Fscan(Inp, &B[i])
	}

	q = make([]int, r - l + 1)
	w = make([]int, r - l + 1)
	for i := l; i <= r; i++ {
	    q[i-l] = A[i]
	    w[i-l] = B[i]
	}
	sort.Ints(q)
	sort.Ints(w)

	flag = true
	for i := 0; i < r - l + 1; i++ {
	    if q[i] != w[i]{
	        flag = false
	    }
	}
	for i:= 1; i<=N; i++ {
	    if( i < l  || i > r){
	        if A[i] != B[i]{
	            flag = false
	        }
	    }
	}

	if flag {
		fmt.Print("TRUTH\n")
	} else {
		fmt.Print("LIE\n")
	}
}

package main

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

func main() {
	var n, l, r int
	fmt.Scan(&n, &l, &r)
	a := make([]int, n)
	b := make([]int, n)
	l--
	r--
	in := bufio.NewReader(os.Stdin)
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &a[i])
	}
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &b[i])
	}
	for i := 0; i < l; i++ {
        if (a[i] != b[i]) {
            fmt.Println("LIE");
            return;
        }
    }
    for i := r + 1; i < n; i++ {
        if a[i] != b[i] {
            fmt.Println("LIE");
            return;
        }
    }

    var cnta [100001]int
    var cntb [100001]int
    for i := l; i <= r; i++ {
        cnta[a[i]]++;
        cntb[b[i]]++;
    }
    for i := 0; i < 100001; i++ {
        if cnta[i] != cntb[i] {
            fmt.Println("LIE");
            return;
        }
    }
    fmt.Println("TRUTH");
}

package main

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

var stdReader *bufio.Reader = bufio.NewReader(os.Stdin)

func readInt() (result int) {
	var negative, started bool
READER_LOOP:
	for {
		char, err := stdReader.ReadByte()
		switch {
		case err != nil:
			break READER_LOOP
		case char == '-':
			negative = true
		case unicode.IsDigit(rune(char)):
			started = true
			result = result*10 + int(char&0xf)
		case started:
			break READER_LOOP
		}
	}
	if negative {
		result = -result
	}
	return
}

func main() {
	var n int
	var l int
	var r int
	n, l, r = readInt(), readInt(), readInt()
	a := make([]int, n)
	b := make([]int, n)
	cnt := make([]int, n + 1)

	var f bool
	f = true

	for i := range a {
		a[i] = readInt()
	}
	for i := range b {
		b[i] = readInt()
	}

	for i := 0; i < l-1; i++{
	    if a[i] != b[i]{
	        f = false
	    }
	}
	for i:=r; i<n; i++{
	    if a[i] != b[i]{
	        f = false
	    }
	}

	for i:=l-1; i<r; i++{
	    cnt[a[i]]++
	    cnt[b[i]]--
	}
	for i:=0; i<n+1; i++{
	    if cnt[i]!=0{
	        f=false;
	    }
	}
	if f {
	    fmt.Println("TRUTH")
	}	else{
	    fmt.Println("LIE")
	}

}

package main

import (
    "io/ioutil"
    "bufio"
    "os"
)

func main() {
    out := bufio.NewWriter(os.Stdout)
    ints := getInts()

    var n, l, r int
    n = ints[0]
    l = ints[1]
    r = ints[2]
    var ptr int
    ptr = 3

	var a[1488100] int
	var b[1488100] int
	var was[1488100] int
	l = l - 1
	r = r - 1
	for i := 0; i < n; i++ {
	    a[i] = ints[ptr]
	    ptr++
	}
	for i := 0; i < n; i++ {
		b[i] = ints[ptr]
	    ptr++
	}
	for i := 0; i<l; i++ {
    	if (a[i] != b[i]) {
	        out.WriteString("LIE")
	        out.Flush()
    	    return
        }
	}

	for i := r+1; i<n; i++ {
    	if (a[i] != b[i]) {
	        out.WriteString("LIE")
	        out.Flush()
    	    return
        }
	}

	for i := l; i<=r; i++ {
	    was[a[i]] = 1
	}

	var cnt int
	cnt = 0
	for i := l; i<=r; i++ {
	    if (was[b[i]] == 1) {
	        cnt++
	    }
	}
	if (cnt == r - l + 1) {
	    out.WriteString("TRUTH")
	}
	if (cnt != r - l + 1) {
	    out.WriteString("LIE")
    }

    out.Flush()
    }

func getInts() []int {
    //assumes POSITIVE INTEGERS. Check v for '-' if you have negative.
    var buf []byte
    buf, _ = ioutil.ReadAll(os.Stdin)
    var ints []int
    num := int(0)
    found := false
    for _, v := range buf {
        if '0' <= v && v <= '9' {
            num = 10*num + int(v - '0') //could use bitshifting here.
            found = true
        } else if found {
            ints = append(ints, num)
            found = false
            num = 0
        }
    }
    if found {
        ints = append(ints, num)
        found = false
        num = 0
    }
    return ints
}

package main

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

func main() {
	var n, l, r int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &n, &l, &r)
	var arr1, arr2 [100000]int
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &arr1[i])
	}
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &arr2[i])
	}
	var ans bool
	ans = true
	for i := 0; i < l - 1; i++ {
		if arr1[i] != arr2[i] {
			ans = false
			break
		}
	}
	for i := r; i < n; i++ {
		if arr1[i] != arr2[i] {
			ans = false
			break
		}
	}

	x1 := arr1[l - 1:r]
	x2 := arr2[l - 1:r]

	sort.Ints(x1)
	sort.Ints(x2)

	for i := 0; i <= r - l; i++ {
		if x1[i] != x2[i] {
			ans = false
			break
		}
	}

	if ans {
		fmt.Print("TRUTH")
	} else {
		fmt.Print("LIE")
	}
}

// main
package main

import (
	"fmt"
)

func main() {
	var n, l, r int
	fmt.Scan(&n, &l, &r)
	a := new([100005]int)
	b := new([100005]int)
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d", &a[i])
	}
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d", &b[i])
	}
	fg := 0
	for i := 1; i < l; i++ {
		if a[i] != b[i] {
			fg = 1
		}
	}
	for i := r + 1; i <= n; i++ {
		if a[i] != b[i] {
			fg = 1
		}
	}
	if fg == 1 {
		fmt.Println("LIE")
	} else {
		fmt.Println("TRUTH")
	}

}

// main
package main

import (
	"fmt"
)

func main() {
	var n, l, r int
	fmt.Scanf("%d ", &n)
	fmt.Scanf("%d ", &l)
	fmt.Scanf("%d ", &r)
	a := new([100005]int)
	b := new([100005]int)
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d ", &a[i])
	}
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d ", &b[i])
	}
	fg := 0
	for i := 1; i < l; i++ {
		if a[i] != b[i] {
			fg = 1
		}
	}
	for i := r + 1; i <= n; i++ {
		if a[i] != b[i] {
			fg = 1
		}
	}
	if fg == 1 {
		fmt.Println("LIE")
	} else {
		fmt.Println("TRUTH")
	}
}

// main
package main

import (
	"fmt"
)

func main() {
	var n, l, r int
	fmt.Scanf("%d %d %d", &n, &l, &r)
	a := new([100005]int)
	b := new([100005]int)
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d", &a[i])
	}
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d", &b[i])
	}
	fg := 0
	for i := 1; i < l; i++ {
		if a[i] != b[i] {
			fg = 1
		}
	}
	for i := r + 1; i <= n; i++ {
		if a[i] != b[i] {
			fg = 1
		}
	}
	if fg == 1 {
		fmt.Println("LIE")
	} else {
		fmt.Println("TRUTH")
	}

}

package main

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

func main() {
    var n int
    var l int
    var r int
    scanner := bufio.NewScanner(os.Stdin)

    scanner.Scan()
    fmt.Sscanf(scanner.Text(), "%d %d %d", &n, &l, &r)

    l -= 1
    r -= 1

    a := make([]int, 100111)
    b := make([]int, 100111)

    for i := 0; i < n; i++ {
        scanner.Scan()
        fmt.Sscanf(scanner.Text(), "%d", &a[i])
    }
    for i := 0; i < n; i++ {
        scanner.Scan()
        fmt.Sscanf(scanner.Text(), "%d", &b[i])
    }

    a2 := make([]int, 100111)
    b2 := make([]int, 100111)

    var ok bool = true
    for i := 0; i < n; i++ {
        if l <= i && i <= r {
            a2[a[i]] += 1
            b2[b[i]] += 1
        } else {
            if (a[i] != b[i]) {
                ok = false
            }
        }
    }

    for i := 0; i < 100111; i++ {
        if a2[i] != b2[i] {
            ok = false
        }
    }

    if ok {
        fmt.Printf("TRUTH\n");
    } else {
        fmt.Printf("LIE\n");
    }
}

package main

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

func main() {
    var n int
    var l int
    var r int
    scanner := bufio.NewScanner(os.Stdin)

    scanner.Scan()
    fmt.Sscanf(scanner.Text(), "%d %d %d", &n, &l, &r)

    l -= 1
    r -= 1

    a := make([]int, 100111)
    b := make([]int, 100111)

    scanner.Scan()
    for i := 0; i < n; i++ {
        fmt.Sscanf(scanner.Text(), "%d", &a[i])
    }
    scanner.Scan()
    for i := 0; i < n; i++ {
        fmt.Sscanf(scanner.Text(), "%d", &b[i])
    }

    a2 := make([]int, 100111)
    b2 := make([]int, 100111)

    var ok bool = true
    for i := 0; i < n; i++ {
        if l <= i && i <= r {
            a2[a[i]] += 1
            b2[b[i]] += 1
        } else {
            if (a[i] != b[i]) {
                ok = false
            }
        }
    }

    for i := 0; i < 100111; i++ {
        if a2[i] != b2[i] {
            ok = false
        }
    }

    if ok {
        fmt.Printf("TRUTH\n");
    } else {
        fmt.Printf("LIE\n");
    }
}

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

func main() {
    sc := NewScanner()
    n := sc.NextInt()
    l := sc.NextInt()
    r := sc.NextInt()
    var q[100001] int
    a := sc.NextIntArray()
    for i := 0; i < n; i++ {
        if i >= l - 1 && i <= r - 1 {
            q[a[i]]++
        }
    }
    b := sc.NextIntArray()
    for i := 0; i < n; i++ {
        if i >= l - 1 && i <= r - 1 {
            q[b[i]]--
        }
    }
    var z = 0
    for i := 0; i <= n; i++ {
        if q[i] != 0 {
            z = 1
        }
    }
    if z == 0 {
        fmt.Println("TRUTH")
    } else {
        fmt.Println("LIE")
    }
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

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

func main() {
	var n, l, r int
	fmt.Scan(&n, &l, &r)
	var a [100001]int
	var b [100001]int
	l--
	r--
	in := bufio.NewReader(os.Stdin)
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &a[i])
	}
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &a[i])
	}
	for i := 0; i < l; i++ {
        if (a[i] != b[i]) {
            fmt.Println("LIE");
            return;
        }
    }
    for i := r + 1; i < n; i++ {
        if a[i] != b[i] {
            fmt.Println("LIE");
            return;
        }
    }

    var cnta [100001]int
    var cntb [100001]int
    for i := l; i <= r; i++ {
        cnta[a[i]]++;
        cntb[b[i]]++;
    }
    for i := 0; i < 100001; i++ {
        if cnta[i] != cntb[i] {
            fmt.Println("LIE");
            return;
        }
    }
    fmt.Println("TRUTH");
}


package main

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

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

	var n, m, st int
	Fscan(in, &n, &m, &st)
	st--
	g := make([][]int, n)
	type edge struct{ v, w int }
	_edges := make([]edge, m)
	for i := range _edges {
		var v, w int
		Fscan(in, &v, &w)
		v--
		w--
		_edges[i] = edge{v, w}
		g[v] = append(g[v], w)
	}

	vis := make([]bool, n)
	var f func(v int)
	f = func(v int) {
		vis[v] = true
		for _, w := range g[v] {
			if !vis[w] {
				f(w)
			}
		}
	}
	f(st)
	edges := []edge{}
	for _, e := range _edges {
		if !vis[e.v] && !vis[e.w] {
			edges = append(edges, e)
		}
	}

	g = make([][]int, n)
	rg := make([][]int, n)
	for _, e := range edges {
		v, w := e.v, e.w
		g[v] = append(g[v], w)
		rg[w] = append(rg[w], v)
	}
	used := make([]bool, n)
	copy(used, vis)
	vs := make([]int, 0, n)
	var dfs func(int)
	dfs = func(v int) {
		used[v] = true
		for _, w := range g[v] {
			if !used[w] {
				dfs(w)
			}
		}
		vs = append(vs, v)
	}
	for v := range g {
		if !used[v] {
			dfs(v)
		}
	}

	used = make([]bool, n)
	copy(used, vis)
	var comp []int
	var rdfs func(int)
	rdfs = func(v int) {
		used[v] = true
		comp = append(comp, v)
		for _, w := range rg[v] {
			if !used[w] {
				rdfs(w)
			}
		}
	}
	comps := [][]int{}
	for i := len(vs) - 1; i >= 0; i-- {
		if v := vs[i]; !used[v] {
			comp = []int{}
			rdfs(v)
			comps = append(comps, comp)
		}
	}

	sccIDs := make([]int, n)
	for i, cp := range comps {
		for _, v := range cp {
			sccIDs[v] = i
		}
	}
	hasIn := make([]bool, len(comps))
	for _, e := range edges {
		if v, w := sccIDs[e.v], sccIDs[e.w]; v != w {
			hasIn[w] = true
		}
	}
	ans := 0
	for _, has := range hasIn {
		if !has {
			ans++
		}
	}
	Fprint(out, ans)
}

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

package main

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

const (
	Unmarked = 0
	CapitalColor = 1
)

var n, m, capital int
var graph [][]int
var marked []int
var colorSet map[int]bool

func mark(v, color int) {
	marked[v] = color
	for _, neighbour := range graph[v] {
		if marked[neighbour] != CapitalColor && marked[neighbour] != color {
			// Don't override cities reachable from capital and also avoid cycles
			mark(neighbour, color)
		}
	}
}

func main() {
	buf := bufio.NewReader(os.Stdin)
	fmt.Fscanf(buf, "%d %d %d\n", &n, &m, &capital)
	graph = make([][]int, n + 1)
	marked = make([]int, n + 1)
	colorSet = make(map[int]bool)

	for i := 0; i < m; i++ {
		var v1, v2 int
		fmt.Fscanf(buf, "%d %d\n", &v1, &v2)
		graph[v1] = append(graph[v1], v2)
	}

	mark(capital, CapitalColor)
	color := CapitalColor
	for i := 1; i <= n; i++ {
		if marked[i] == Unmarked {
			color++
			mark(i, color)
		}
	}
	ans := 0
	for i := 1; i <= n; i++ {
		if marked[i] != CapitalColor && !colorSet[marked[i]] {
			ans++
			colorSet[marked[i]] = true
		}
	}
	fmt.Println(ans)
}

package main

import (
	"fmt"
	"io/ioutil"
	"bytes"
	"os"
)

var n, m, s int
var edge, edgeRev [][]int
var visited []bool
var stack []int
var group []int

func dfs(x int) {
	if !visited[x] {
		visited[x] = true
		for i := 0;i < len(edge[x]);i ++ {
			dfs(edge[x][i])
		}
		stack = append(stack, x)
	}
}

func dfsRev(x, g int) {
	if visited[x] {
		visited[x] = false
		group[x] = g
		for i := 0;i < len(edgeRev[x]);i ++ {
			dfsRev(edgeRev[x][i], g)
		}
	}
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)
	fmt.Fscanf(reader, "%d %d %d\n", &n, &m, &s)
	s --
	edge = make([][]int, n)
	edgeRev = make([][]int, n)
	visited = make([]bool, n)
	stack = make([]int, n)
	group = make([]int, n)
	for i := 0;i < n;i ++ {
		edge[i] = []int{}
		edgeRev[i] = []int{}
	}
	for i := 0;i < m;i ++ {
		var u, v int
		fmt.Fscanf(reader, "%d %d\n", &u, &v)
		u, v = u - 1, v - 1
		edge[u] = append(edge[u], v)
		edgeRev[v] = append(edgeRev[v], u)
	}
	for i := 0;i < n;i ++ {
		dfs(i)
	}
	var g int
	for len(stack) != 0 {
		x := stack[len(stack) - 1]
		stack = stack[:len(stack) - 1]
		if visited[x] {
			dfsRev(x, g)
			g++
		}
	}
	var ans int
	deg := make([]bool, g)
	for i := 0;i < n;i ++ {
		for j := 0;j < len(edge[i]);j ++ {
			if group[i] != group[edge[i][j]] {
				deg[group[edge[i][j]]] = true
			}
		}
	}
	deg[group[s]] = true
	for i := 0;i < g;i ++ {
		if !deg[i] {
			ans ++
		}
	}

	fmt.Printf("%+v", ans)
}

package main

import (
	"fmt"
	"io/ioutil"
	"bytes"
	"os"
)

var n, m, s int
var edge [][]int
var u []int

func dfs(x int) {
	u[x] = s
	for i := 0;i < len(edge[x]);i ++ {
		if u[edge[x][i]] != s {
			dfs(edge[x][i])
		}
	}
}

func find(x int) int {
	if x == u[x] {
		return x
	} else {
		u[x] = find(u[x])
		return u[x]
	}
}

func join(x, y int) {
	u[find(x)] = find(y)
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)
	fmt.Fscanf(reader, "%d %d %d\n", &n, &m, &s)
	s --
	edge = make([][]int, n)
	degree := make([]int, n)
	u = make([]int, n)
	ans := 0
	for i := 0;i < n;i ++ {
		edge[i] = []int{}
		u[i] = i
	}
	for i := 0;i < m;i ++ {
		var u, v int
		fmt.Fscanf(reader, "%d %d\n", &u, &v)
		u, v = u - 1, v - 1
		edge[u] = append(edge[u], v)
		degree[v] ++
	}
	for i := 0;i < n;i ++ {
		if i != s && degree[i] == 0 {
			ans ++
			edge[s] = append(edge[s], i)
		}
	}
	dfs(s)
	for i := 0;i < n;i ++ {
		for j := 0;j < len(edge[i]);j ++ {
			if u[i] != s && u[edge[i][j]] != s {
				join(i, edge[i][j])
			}
		}
	}
	group := map[int]bool{}
	for i := 0;i < n;i ++ {
		group[find(i)] = true
	}
	fmt.Printf("%+v", ans + len(group) - 1)
}

package main

import (
	"fmt"
	"io/ioutil"
	"bytes"
	"os"
)

var n, m, s int
var edge [][]int
var u []int

func dfs(x int) {
	u[x] = s
	for i := 0;i < len(edge[x]);i ++ {
		if u[edge[x][i]] != s {
			dfs(edge[x][i])
		}
	}
}

func find(x int) int {
	if x == u[x] {
		return x
	} else {
		u[x] = find(u[x])
		return u[x]
	}
}

func join(x, y int) {
	u[find(x)] = find(y)
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)
	fmt.Fscanf(reader, "%d %d %d\n", &n, &m, &s)
	s --
	edge = make([][]int, n)
	degree := make([]int, n)
	u = make([]int, n)
	ans := 0
	for i := 0;i < n;i ++ {
		edge[i] = []int{}
		u[i] = i
	}
	for i := 0;i < m;i ++ {
		var u, v int
		fmt.Fscanf(reader, "%d %d\n", &u, &v)
		u, v = u - 1, v - 1
		edge[u] = append(edge[u], v)
		degree[v] ++
	}
	for i := 0;i < n;i ++ {
		if i != s && degree[i] == 0 {
			ans ++
			edge[s] = append(edge[s], i)
		}
	}
	dfs(s)
	for i := 0;i < n;i ++ {
		for j := 0;j < len(edge[i]);j ++ {
			if u[i] != s && u[edge[i][j]] != s {
				join(i, edge[i][j])
			}
		}
	}
	for i := 0;i < n;i ++ {
		if u[i] == i && i != s {
			ans ++
		}
	}
	fmt.Printf("%+v", ans)
}

package main

import (
	"fmt"
	"io/ioutil"
	"bytes"
	"os"
)

var n, m, s int
var edge [][]int
var visited []bool

func dfs(x int) {
	visited[x] = true
	for i := 0;i < len(edge[x]);i ++ {
		if !visited[edge[x][i]] {
			dfs(edge[x][i])
		}
	}
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)
	fmt.Fscanf(reader, "%d %d %d\n", &n, &m, &s)
	s --
	edge = make([][]int, n)
	degree := make([]int, n)
	visited = make([]bool, n)
	ans := 0
	for i := 0;i < n;i ++ {
		edge[i] = []int{}
	}
	for i := 0;i < m;i ++ {
		var u, v int
		fmt.Fscanf(reader, "%d %d\n", &u, &v)
		u, v = u - 1, v - 1
		edge[u] = append(edge[u], v)
		degree[v] ++
	}
	for i := 0;i < n;i ++ {
		if i != s && degree[i] == 0 {
			ans ++
			edge[s] = append(edge[s], i)
		}
	}
	dfs(s)
	for i := 0;i < n;i ++ {
		if !visited[i] {
			ans ++
			dfs(i)
		}
	}
	fmt.Printf("%+v", ans)
}

package main

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

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

	var n, m, st int
	Fscan(in, &n, &m, &st)
	st--
	g := make([][]int, n)
	type edge struct{ v, w int }
	edges := make([]edge, m)
	for i := range edges {
		var v, w int
		Fscan(in, &v, &w)
		v--
		w--
		edges[i] = edge{v, w}
		g[v] = append(g[v], w)
	}

	vis := make([]bool, n)
	var f func(v int)
	f = func(v int) {
		vis[v] = true
		for _, w := range g[v] {
			if !vis[w] {
				f(w)
			}
		}
	}
	f(st)

	hasIn := make([]bool, n)
	for _, e := range edges {
		v, w := e.v, e.w
		if !vis[v] && !vis[w] {
			hasIn[w] = true
		}
	}
	cntIn := 0
	f = func(v int) {
		vis[v] = true
		if !hasIn[v] {
			cntIn++
		}
		for _, w := range g[v] {
			if !vis[w] {
				f(w)
			}
		}
	}
	ans := 0
	for i := 0; i < n; i++ {
		if !vis[i] {
			cntIn = 0
			f(i)
			if cntIn == 0 {
				cntIn = 1
			}
			ans += cntIn
		}
	}
	Fprint(out, ans)
}

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


package main

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

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

type Line struct {
	A, B, C int
}

func Abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

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

func main() {

	defer out.Flush()
	in.Split(bufio.ScanWords)
	var n int = NextInt()
	x, y := make([]int, n), make([]int, n)
	for i := 0; i < n; i++ {
		x[i], y[i] = NextInt(), NextInt()
	}

	mp := make(map[Line]int)
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			var a, b int = y[j] - y[i], x[i] - x[j];
			var c int = -a * x[i] - b * y[i];

			var gcd int = Gcd(Abs(a), Abs(b))
			gcd = Gcd(gcd, Abs(c))

			a, b, c = a / gcd, b / gcd, c / gcd

			if a < 0 {
				a, b, c = -a, -b, -c
			}else if a == 0 {
				if b < 0 {
					b, c = -b, -c
				}
			}

			line := Line{A:a, B:b, C:c}
			mp[line]++
		}
	}

	var ret int64 = 0
	for _, m := range mp {

		// fmt.Fprintln(out, line, m)

		x := 1 + math.Sqrt(1 + 8 * float64(m))
		x /= 2

		ret += int64(x * (x - 1) / 2) * int64(n - int(x))
	}

	fmt.Fprintln(out, ret / 3)
}

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

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

package main

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

var scanner *bufio.Scanner
var writer *bufio.Writer

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

type Point struct {
  X, Y int
}

func gcd(a, b int) int {
  if a < 0 {
    a = -a
  }
  if b < 0 {
    b = -b
  }
  for b != 0 {
    a, b = b, a%b
  }
  return a
}

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

  n := getI()
  points := make([]*Point, n)
  for i := range points {
    points[i] = &Point{ getI(), getI() }
  }
  total := int64(0)
  for _, center := range points {
    x, y := center.X, center.Y
    subtotal := (n-1)*(n-2)/2
    slopeCount := make([]int, 401*401)
    for _, point := range points {
      if point != center {
        a, b := point.X, point.Y
        g := gcd(x-a, y-b)
        c, d := (x-a)/g, (y-b)/g
        slope := 400*(200+c) + 200+d
        subtotal -= slopeCount[slope]
        subtotal -= slopeCount[400*(200-c) + 200-d]
        slopeCount[slope]++
      }
    }
    total += int64(subtotal)
  }
  writer.WriteString(fmt.Sprintf("%d\n", total/3))
}

package main

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

func abs(a int64) int64 {
	if a > 0 {
		return a
	}
	return -a
}
func gcd(a int64, b int64) int64 {
	if (b == 0) {
		return a
	}
	return gcd(b, a%b)
}
func starPosition(stars [][]int64) int64 {
	x := [2005]int64{}
	y := [2005]int64{}
	a := map[int64]int64{}
	b := [20005][205]int64{}
	f := map[int64]int64{}

    i := int64(0)
    j := int64(0)

	for i = 1; i <= 20000; i++ {
		for j = 1; j <= 200; j++ {
			b[i][j] = gcd(i,j)
		}
	}
	for i = 1; i <= 20000; i++ {
		b[i][0] = i
	}

	for i = 1; i <= 200; i++ {
		b[0][i] = i
	}

 	for i = 2; i <= 2000; i++ {
		a[i*i-i] = i
	}

	n := int64(len(stars))
 	for i = 0; i < n; i++ {
		x[i] = int64(stars[i][0])
		y[i] = int64(stars[i][1])
	}

	for i = 0; i < n; i++ {
		for j = 0; j < n; j++ {
			if i != j {
				var kc int64 = y[j] - y[i];
				var kz int64 = x[j] - x[i];
				var bc int64 = y[i]*(x[j] - x[i]) - x[i]*(y[j]-y[i]);
				var bz int64 = x[j] - x[i];
				if kz != 0 {
					tmp := b[abs(kc)][abs(kz)];
					kc /= tmp; kz /= tmp;
					if (kc < 0) {
						kc = -kc
						kz = -kz
					}
					if (kc == 0) {
						kz = 1;
					}
					tmp = b[abs(bc)][abs(bz)]
					bc /= tmp
					bz /= tmp
					if (bc < 0) {
						bc = -bc
						bz = -bz
					}
					if (bc == 0) {
						bz = 1
					}
				} else {
					kc = x[i]
					bc = x[i]
				}
				var hsh int64 = bc*27000000000 + bz*9000000 + kc*300 + kz;
				f[hsh]+=2;

			}
		}
	}
	var ans int64 = (n*(n-1)*(n-2))/6
	for _, fv := range f {
		tmp, ok := a[fv/2]
		if ok {
			ans -= (tmp*(tmp-1)*(tmp-2))/6
		}

	}
	return ans
}

func main() {
	// s := [][]int{
	// 	{1,1},
	// }
	// fmt.Println(starPosition(s))
	scanner := bufio.NewScanner(os.Stdin)
    var n int64 = 0
    var s [][]int64
    i := int64(0)
    j := int64(0)
    for scanner.Scan() {
        if i > 0 && i > n {
            break
        }
        if i == 0 {
            strs := strings.Split(scanner.Text(), " ")
            n, _ = strconv.ParseInt(strs[0], 10, 64)
        } else {
            if i == 1 {
                s = make([][]int64, n)
            }
            s[j] = make([]int64, 2)
            strs := strings.Split(scanner.Text(), " ")
            s[j][0], _ = strconv.ParseInt(strs[0], 10, 64)
            s[j][1], _ = strconv.ParseInt(strs[1], 10, 64)
            j++
        }
        i++
	}
	fmt.Println(starPosition(s))
}

package main

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

type vec struct {
	x, y int
}

func (a vec) sub(b vec) vec   { return vec{a.x - b.x, a.y - b.y} }
func (a vec) cross(b vec) int { return a.x*b.y - a.y*b.x }
func (a vec) reverse() vec    { return vec{-a.x, -a.y} }
func (a vec) up() vec {
	if a.y < 0 || a.y == 0 && a.x < 0 {
		return a.reverse()
	}
	return a
}

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

	var n int
	Fscan(in, &n)
	if n < 3 {
		Fprint(out, 0)
		return
	}
	ps := make([]vec, n)
	for i := range ps {
		Fscan(in, &ps[i].x, &ps[i].y)
	}
	ans := int64(n) * int64(n-1) * int64(n-2) / 6
	for i, pi := range ps {
		ls := make([]vec, 0, n-i-1)
		for j := i + 1; j < n; j++ {
			ls = append(ls, ps[j].sub(pi).up())
		}
		sort.Slice(ls, func(i, j int) bool { return ls[i].cross(ls[j]) > 0 })
		for j := 0; j < len(ls); {
			j0 := j
			for j++; j < len(ls) && ls[j].cross(ls[j0]) == 0; j++ {
			}
			ans -= int64(j-j0) * int64(j-j0-1) / 2
		}
	}
	Fprint(out, ans)
}

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

package main

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

var scanner *bufio.Scanner
var writer *bufio.Writer

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

type Point struct {
  X, Y int
}

func gcd(a, b int) int {
  if a < 0 {
    a = -a
  }
  if b < 0 {
    b = -b
  }
  for b != 0 {
    a, b = b, a%b
  }
  return a
}

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

  n := getI()
  points := make([]*Point, n)
  for i := range points {
    points[i] = &Point{ getI(), getI() }
  }
  total := int64(0)
  for _, center := range points {
    x, y := center.X, center.Y
    subtotal := (n-1)*(n-2)/2
    slopeCount := map[Point]int{}
    for _, point := range points {
      if point != center {
        a, b := point.X, point.Y
        g := gcd(x-a, y-b)
        c, d := (x-a)/g, (y-b)/g
        slope := Point{ c, d }
        subtotal -= slopeCount[slope]
        subtotal -= slopeCount[Point{ -c, -d }]
        slopeCount[slope]++
      }
    }
    total += int64(subtotal)
  }
  writer.WriteString(fmt.Sprintf("%d\n", total/3))
}

package main

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

var scanner *bufio.Scanner
var writer *bufio.Writer

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

type Point struct {
  X, Y int
}

func gcd(a, b int) int {
  if a < 0 {
    a = -a
  }
  if b < 0 {
    b = -b
  }
  for b != 0 {
    a, b = b, a%b
  }
  return a
}

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

  n := getI()
  points := make([]*Point, n)
  for i := range points {
    points[i] = &Point{ getI(), getI() }
  }
  total := 0
  for _, center := range points {
    x, y := center.X, center.Y
    subtotal := (n-1)*(n-2)/2
    slopeCount := map[Point]int{}
    for _, point := range points {
      if point != center {
        a, b := point.X, point.Y
        g := gcd(x-a, y-b)
        c, d := (x-a)/g, (y-b)/g
        slope := Point{ c, d }
        subtotal -= slopeCount[slope]
        subtotal -= slopeCount[Point{ -c, -d }]
        slopeCount[slope]++
      }
    }
    total += subtotal
  }
  writer.WriteString(fmt.Sprintf("%d\n", total/3))
}

package main

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

var scanner *bufio.Scanner
var writer *bufio.Writer

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

type Point struct {
  X, Y int
}

func gcd(a, b int) int {
  if a < 0 {
    a = -a
  }
  if b < 0 {
    b = -b
  }
  for b != 0 {
    a, b = b, a%b
  }
  return a
}

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

  n := getI()
  points := make([]*Point, n)
  for i := range points {
    points[i] = &Point{ getI(), getI() }
  }
  total := int64(0)
  for _, center := range points {
    x, y := center.X, center.Y
    subtotal := (n-1)*(n-2)/2
    slopeCount := make([]int, 401*401)
    for _, point := range points {
      if point != center {
        a, b := point.X, point.Y
        g := gcd(x-a, y-b)
        c, d := (x-a)/g, (y-b)/g
        slope := 200*200 + 200*(200+c) + 200+d
        subtotal -= slopeCount[slope]
        subtotal -= slopeCount[200*200 + 200*(200-c) + 200-d]
        slopeCount[slope]++
      }
    }
    total += int64(subtotal)
  }
  writer.WriteString(fmt.Sprintf("%d\n", total/3))
}

package main

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

var scanner *bufio.Scanner
var writer *bufio.Writer

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

type Point struct {
  X, Y int
}

func gcd(a, b int) int {
  if a < 0 {
    a = -a
  }
  if b < 0 {
    b = -b
  }
  for b != 0 {
    a, b = b, a%b
  }
  return a
}

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

  n := getI()
  points := make([]*Point, n)
  for i := range points {
    points[i] = &Point{ getI(), getI() }
  }
  total := int64(0)
  for _, center := range points {
    x, y := center.X, center.Y
    subtotal := (n-1)*(n-2)/2
    slopeCount := make([]int, 600*600)
    for _, point := range points {
      if point != center {
        a, b := point.X, point.Y
        g := gcd(x-a, y-b)
        c, d := (x-a)/g, (y-b)/g
        slope := 300*300 + 250*c + d
        subtotal -= slopeCount[slope]
        subtotal -= slopeCount[300*300 + 250*-c - d]
        slopeCount[slope]++
      }
    }
    total += int64(subtotal)
  }
  writer.WriteString(fmt.Sprintf("%d\n", total/3))
}

package main

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

func abs(a int64) int64 {
	if a > 0 {
		return a
	}
	return -a
}
func gcd(a int64, b int64) int64 {
	if (b == 0) {
		return a
	}
	return gcd(b, a%b)
}
func starPosition(stars [][]int64) int64 {
	x := [2005]int64{}
	y := [2005]int64{}
	a := map[int64]int64{}
	b := [20005][205]int64{}
	f := map[int64]int64{}

    i := int64(0)
    j := int64(0)

	for i = 1; i <= 20000; i++ {
		for j = 1; j <= 200; j++ {
			b[i][j] = gcd(i,j)
		}
	}
	for i = 1; i <= 20000; i++ {
		b[i][0] = i
	}

	for i = 1; i <= 200; i++ {
		b[0][i] = i
	}

 	for i = 2; i <= 2000; i++ {
		a[i*i-i] = i
	}

	n := int64(len(stars))
 	for i = 0; i < n; i++ {
		x[i] = int64(stars[i][0])
		y[i] = int64(stars[i][1])
	}

	for i = 0; i < n; i++ {
		for j = 0; j < n; j++ {
			if i != j {
					var kc int64 = y[j] - y[i];
					var kz int64 = x[j] - x[i];
					var bc int64 = y[i]*(x[j] - x[i]) - x[i]*(y[j]-y[i]);
					var bz int64 = x[j] - x[i];
					if kz != 0 {
						tmp := b[abs(kc)][abs(kz)];
						kc /= tmp; kz /= tmp;
						if (kc < 0) {
							kc = -kc
							kz = -kz
						}
						if (kc == 0) {
							kz = 1;
						}
						tmp = b[abs(bc)][abs(bz)]
						bc /= tmp
						bz /= tmp
						if (bc < 0) {
							bc = -bc
							bz = -bz
						}
						if (bc == 0) {
							bz = 1
						}
					} else {
						kc = bc
						kc = x[i]
					}
					var hsh int64 = bc*27000000000 + bz*9000000 + kc*300 + kz;
					f[hsh]+=2;

			}
		}
	}
	var ans int64 = (n*(n-1)*(n-2))/6
	for _, fv := range f {
		tmp, ok := a[fv/2]
		if ok {
			ans -= (tmp*(tmp-1)*(tmp-2))/6
		}

	}
	return ans
}

func main() {
	// s := [][]int{
	// 	{1,1},
	// }
	// fmt.Println(starPosition(s))
	scanner := bufio.NewScanner(os.Stdin)
    var n int64 = 0
    var s [][]int64
    i := int64(0)
    j := int64(0)
    for scanner.Scan() {
        if i > 0 && i > n {
            break
        }
        if i == 0 {
            strs := strings.Split(scanner.Text(), " ")
            n, _ = strconv.ParseInt(strs[0], 10, 64)
        } else {
            if i == 1 {
                s = make([][]int64, n)
            }
            s[j] = make([]int64, 2)
            strs := strings.Split(scanner.Text(), " ")
            s[j][0], _ = strconv.ParseInt(strs[0], 10, 64)
            s[j][1], _ = strconv.ParseInt(strs[1], 10, 64)
            j++
        }
        i++
	}
	fmt.Println(starPosition(s))
}

package main

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

func abs(a int64) int64 {
	if a > 0 {
		return a
	}
	return -a
}
func gcd(a int64, b int64) int64 {
	if (b == 0) {
		return a
	}
	return gcd(b, a%b)
}
func starPosition(stars [][]int64) int {
	x := [2005]int64{}
	y := [2005]int64{}
	a := map[int64]int64{}
	b := [20005][205]int64{}
	f := map[int64]int64{}

    i := int64(0)
    j := int64(0)

	for i = 1; i <= 20000; i++ {
		for j = 1; j <= 200; j++ {
			b[i][j] = gcd(i,j)
		}
	}
	for i = 1; i <= 20000; i++ {
		b[i][0] = i
	}

	for i = 1; i <= 200; i++ {
		b[0][i] = i
	}

 	for i = 2; i <= 2000; i++ {
		a[i*i-i] = i
	}

	n := int64(len(stars))
 	for i = 0; i < n; i++ {
		x[i] = int64(stars[i][0])
		y[i] = int64(stars[i][1])
	}

	for i = 0; i < n; i++ {
		for j = 0; j < n; j++ {
			if i != j {
					var kc int64 = y[j] - y[i];
					var kz int64 = x[j] - x[i];
					var bc int64 = y[i]*(x[j] - x[i]) - x[i]*(y[j]-y[i]);
					var bz int64 = x[j] - x[i];
					if kz != 0 {
						tmp := b[abs(kc)][abs(kz)];
						kc /= tmp; kz /= tmp;
						if (kc < 0) {
							kc = -kc
							kz = -kz
						}
						if (kc == 0) {
							kz = 1;
						}
						tmp = b[abs(bc)][abs(bz)]
						bc /= tmp
						bz /= tmp
						if (bc < 0) {
							bc = -bc
							bz = -bz
						}
						if (bc == 0) {
							bz = 1
						}
					} else {
						kc = bc
						kc = x[i]
					}
					var hsh int64 = bc*27000000000 + bz*9000000 + kc*300 + kz;
					f[hsh]+=2;

			}
		}
	}
	var ans int64 = (n*(n-1)*(n-2))/6
	for _, fv := range f {
		tmp, ok := a[fv/2]
		if ok {
			ans -= (tmp*(tmp-1)*(tmp-2))/6
		}

	}
	return int(ans)
}

func main() {
	// s := [][]int{
	// 	{1,1},
	// }
	// fmt.Println(starPosition(s))
	scanner := bufio.NewScanner(os.Stdin)
    var n int64 = 0
    var s [][]int64
    i := int64(0)
    j := int64(0)
    for scanner.Scan() {
        if i > 0 && i > n {
            break
        }
        if i == 0 {
            strs := strings.Split(scanner.Text(), " ")
            n, _ = strconv.ParseInt(strs[0], 10, 64)
        } else {
            if i == 1 {
                s = make([][]int64, n)
            }
            s[j] = make([]int64, 2)
            strs := strings.Split(scanner.Text(), " ")
            s[j][0], _ = strconv.ParseInt(strs[0], 10, 64)
            s[j][1], _ = strconv.ParseInt(strs[1], 10, 64)
            j++
        }
        i++
	}
	fmt.Println(starPosition(s))
}

package main

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

type vec struct {
	x, y int
}

func (a vec) sub(b vec) vec   { return vec{a.x - b.x, a.y - b.y} }
func (a vec) cross(b vec) int { return a.x*b.y - a.y*b.x }

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

	var n int
	Fscan(in, &n)
	if n < 3 {
		Fprint(out, 0)
		return
	}
	ps := make([]vec, n)
	for i := range ps {
		Fscan(in, &ps[i].x, &ps[i].y)
	}
	ans := int64(n) * int64(n-1) * int64(n-2) / 6
	for i, pi := range ps {
		ls := make([]vec, 0, n-i-1)
		for j := i + 1; j < n; j++ {
			ls = append(ls, ps[j].sub(pi))
		}
		sort.Slice(ls, func(i, j int) bool { return ls[i].cross(ls[j]) > 0 })
		for j := 0; j < len(ls); {
			j0 := j
			for j++; j < len(ls) && ls[j].cross(ls[j0]) == 0; j++ {
			}
			ans -= int64(j-j0) * int64(j-j0-1) / 2
		}
	}
	Fprint(out, ans)
}

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

package main

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

var scanner *bufio.Scanner
var writer *bufio.Writer

func getI64() int64 {
  scanner.Scan()
  x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
  return x
}
func getI() int {
  return int(getI64())
}
func getF() float64 {
  scanner.Scan()
  x, _ := strconv.ParseFloat(scanner.Text(), 64)
  return x
}
func getS() string {
  scanner.Scan()
  return scanner.Text()
}

type Point struct {
  X, Y int
}

func gcd(a, b int) int {
  if a < 0 {
    a = -a
  }
  if b < 0 {
    b = -b
  }
  for b != 0 {
    a, b = b, a%b
  }
  return a
}

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

  n := getI()
  points := make([]*Point, n)
  for i := range points {
    points[i] = &Point{ getI(), getI() }
  }
  total := int64(0)
  for _, center := range points {
    x, y := center.X, center.Y
    subtotal := (n-1)*(n-2)/2
    slopeCount := make([]int, 600*600)
    for _, point := range points {
      if point != center {
        a, b := point.X, point.Y
        g := gcd(x-a, y-b)
        c, d := (x-a)/g, (y-b)/g
        slope := 300*300 + 200*c + d
        subtotal -= slopeCount[slope]
        subtotal -= slopeCount[300*300 + 200*-c - d]
        slopeCount[slope]++
      }
    }
    total += int64(subtotal)
  }
  writer.WriteString(fmt.Sprintf("%d\n", total/3))
}


package main

import (
	"fmt"
)

func findMin(a []int, u int) int {
	ret := -1
	for i := 0; i < len(a); i++ {
		if a[i] > u && (ret == -1 || a[i] < a[ret]) {
			ret = i
		}
	}
	return ret
}

func main() {
	var n int
	fmt.Scanf("%d\n", &n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &a[i])
	}
	m := findMin(a, -1)
	b := make([]int, n)
	b[0] = a[m]
	a[m] = 0
	ans := 0
	for i := 1; i < n; i++ {
		m = findMin(a, b[i-1])
		if m == -1 {
			m = findMin(a, 0)
		} else {
			ans++
		}
		b[i] = a[m]
		a[m] = 0
	}
	fmt.Println(ans)
}

package main

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

func main() {

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	scanner.Scan()
	input := scanner.Text()
	numbers := strings.Split(input, " ")

	m := make(map[string]int)
	numElements := 0
	// populate m with frequency
	for _, v := range numbers {
		if _, ok := m[v]; ok {
			m[v]++
		} else {
			m[v] = 1
			numElements++
		}
	}

	happy := 0
	for {

		if numElements <= 1 {
			fmt.Println(happy)
			return
		}
		happy += numElements - 1
		for k, _ := range m {
			m[k]--
			if m[k] <= 0 {
				delete(m, k)
				numElements--
			}
		}
	}

}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	paintings := make([]int, n)
	exists := make(map[int]int)

	for i := 0; i < n; i++ {
		var beauty int
		fmt.Scan(&beauty)
		if _, ok := exists[beauty]; !ok {
			paintings = append(paintings, beauty)
		}
		exists[beauty]++
	}

	sort.Sort(sort.IntSlice(paintings))
	var total int

	for len(exists) > 0 {
		for _, p := range paintings {
			if _, ok := exists[p]; ok {
				exists[p]--
				total++
				if exists[p] <= 0 {
					delete(exists, p)
				}
			}
		}
		total--
	}
	fmt.Println(total)
}

package main

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

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

	paintings := make([]int, n)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for i := 0; scanner.Scan() && i < n; i++ {
		a, err := strconv.Atoi(scanner.Text())
		if err != nil {
			return
		}
		paintings[i] = a
	}

	merge_sort(paintings, 0, n-1)

	happiness := 0
	finished := false
	for !finished {
		finished = true

		last := -1
		for i := 0; i < n; i++ {
			if paintings[i] != -1 {
				finished = false

				if last < 0 {
					last = paintings[i]
					paintings[i] = -1
				} else if last > 0 && paintings[i] > last {
					happiness++
					last = paintings[i]
					paintings[i] = -1
				}
			}
		}
	}

	fmt.Println(happiness)
}

func merge(buffer []int, start, middle, end int) {
	sorted := make([]int, end-start+1)

	i := start
	j := middle + 1
	k := 0
	for i <= middle && j <= end {
		if buffer[i] <= buffer[j] {
			sorted[k] = buffer[i]
			i++
		} else {
			sorted[k] = buffer[j]
			j++
		}
		k++
	}
	for i <= middle {
		sorted[k] = buffer[i]
		k++
		i++
	}
	for j <= end {
		sorted[k] = buffer[j]
		k++
		j++
	}

	i = start
	k = 0
	for i <= end {
		buffer[i] = sorted[k]
		i++
		k++
	}
}

func merge_sort(buffer []int, start, end int) {
	if end > start {
		middle := (end + start) / 2
		merge_sort(buffer, start, middle)
		merge_sort(buffer, middle+1, end)
		merge(buffer, start, middle, end)
	}
}

package main

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

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

	have := make(map[int]int)
	bt := make([]int, pictures)

	for i := 0; i < pictures; i++ {
		fmt.Fscan(reader, &bt[i])
		have[bt[i]]++
	}

	sort.Ints(bt)
	ans := 0
	for i := 0; i < pictures; i++ {
		count := 0
		// fmt.Println(have)
		if have[bt[i]] > 0 {
			prev := bt[i]
			have[prev]--
			for j := i + 1; j < pictures; j++ {
				if have[bt[j]] > 0 && bt[j] > prev {
					// fmt.Print(prev, " ")
					count++
					have[bt[j]]--
					prev = bt[j]
				}
			}
		}
		ans += count
	}

	fmt.Println(ans)
}

package main

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

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

	have := make(map[int]int)
	bt := make([]int, pictures)

	for i := 0; i < pictures; i++ {
		fmt.Fscan(reader, &bt[i])
		have[bt[i]]++
	}

	// fmt.Println(len(have))
	pairs, lens := 0, len(have)
	for {
		if len(have) <= 1 {
			fmt.Println(pairs)
			return
		}

		pairs += lens - 1
		for key := range have {
			have[key]--
			// fmt.Println(":-", key, have[key])
			if have[key] < 1 {
				delete(have, key)
				lens--
			}
		}

		// fmt.Println("->", pairs, lens)

	}
}

package main

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

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

	have := make(map[int]int)
	bt := make([]int, pictures)

	for i := 0; i < pictures; i++ {
		fmt.Fscan(reader, &bt[i])
		have[bt[i]]++
	}

	sort.Ints(bt)
	ans := 0
	for i := 0; i < pictures; i++ {
		count := 0
		if have[bt[i]] > 0 {
			for j := i + 1; j < pictures; j++ {
				if bt[j] > 0 && bt[j] > bt[i] {
					count++
					bt[j], bt[i] = bt[j]-1, bt[i]-1
				}
			}
		}

		ans += count
	}

	fmt.Println(ans)
}

package main

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

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

	have := make(map[int]int)
	bt := make([]int, pictures)

	for i := 0; i < pictures; i++ {
		fmt.Fscan(reader, &bt[i])
		have[bt[i]]++
	}

	sort.Ints(bt)
	ans := 0
	for i := 0; i < pictures; i++ {
		count := 0
		// fmt.Println(have)
		if have[bt[i]] > 0 {
			prev := bt[i]
			for j := i + 1; j < pictures; j++ {
				if have[bt[j]] > 0 && bt[j] > prev {
					// fmt.Print(prev, " ")
					count++
					have[bt[j]]--
					prev = bt[j]
				}
			}
		}
		ans += count
	}

	fmt.Println(ans)
}

package main

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

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

	have := make(map[int]int)
	bt := make([]int, pictures)

	for i := 0; i < pictures; i++ {
		fmt.Fscan(reader, &bt[i])
		have[bt[i]]++
	}

	sort.Ints(bt)
	ans := 0
	for i := 0; i < pictures; i++ {
		count := 0
		if have[bt[i]] > 0 {
			for j := i + 1; j < pictures; j++ {
				if have[bt[j]] > 0 && bt[j] > bt[i] {
					count++
					have[bt[j]], have[bt[i]] = have[bt[j]]-1, have[bt[i]]-1
				}
			}
		}

		ans += count
	}

	fmt.Println(ans)
}

package main

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

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

	have := make(map[int]int)
	bt := make([]int, pictures)

	for i := 0; i < pictures; i++ {
		fmt.Fscan(reader, &bt[i])
		have[bt[i]]++
	}

	ans := 0
	for i := 0; i < pictures; i++ {
		count := 0
		if have[bt[i]] > 0 {
			for j := i + 1; j < pictures; j++ {
				if bt[j] > 0 && bt[j] > bt[i] {
					count++
					bt[j], bt[i] = bt[j]-1, bt[i]-1
				}
			}
		}

		ans += count
	}

	fmt.Println(ans)
}

package main

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

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

	have := make(map[int]int)
	bt := make([]int, pictures)

	for i := 0; i < pictures; i++ {
		fmt.Fscan(reader, &bt[i])
		have[bt[i]]++
	}

	sort.Ints(bt)
	ans := 0
	for i := 0; i < pictures; i++ {
		count := 0
		// fmt.Println(have)
		if have[bt[i]] > 0 {
			prev := bt[i]
			for j := i + 1; j < pictures; j++ {
				if have[bt[j]] > 0 && bt[j] > prev {
					// fmt.Print(prev, " ")
					count++
					have[bt[j]]--
					prev = bt[j]
				}
			}
		}
		fmt.Println()
		ans += count
	}

	fmt.Println(ans)
}

package main

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

func main() {

	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	input := scanner.Text()
	numbers := strings.Split(input, " ")

	m := make(map[string]int)
	numElements := 0
	// populate m with frequency
	for _, v := range numbers {
		if _, ok := m[v]; ok {
			m[v]++
		} else {
			m[v] = 1
			numElements++
		}
	}

	happy := 0
	for {
		if numElements == 1 {
			fmt.Println(happy)
			return
		}
		happy += numElements - 1
		for k, _ := range m {
			m[k]--
			if m[k] <= 0 {
				delete(m, k)
				numElements--
			}
		}
	}

}


/*
URL:
https://codeforces.com/problemset/problem/1305/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 (
	n, m int64
	A    []int64
)

func main() {
	n, m = ReadInt64_2()
	A = ReadInt64Slice(int(n))

	if n <= m {
		solve()
	} else {
		fmt.Println(0)
	}
}

func solve() {
	res := int64(1)
	for i := int64(0); i < n; i++ {
		for j := i + 1; j < n; j++ {
			res *= AbsInt(A[i] - A[j])
			res %= m
		}
	}
	fmt.Println(res)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

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

/*********** 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"
    "bufio"
    "os"
)

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

    var n, m int
    fmt.Fscan(in, &n, &m)
    a := make([]int, n)
    for i := range a {
        fmt.Fscan(in, &a[i])
    }
    if n > m {
        fmt.Fprintln(out, 0)
        return
    }
    prd, dif := 1, 0
    for i := 0; i + 1 < n; i++ {
        for j := i + 1; j < n; j++ {
            dif = a[i] - a[j]
            if dif < 0 {
                dif = -dif
            }
            dif %= m
            prd = prd * dif % m
        }
    }
    fmt.Fprintln(out, prd)
}

package main

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

func main() {
	var n, m int64
	fmt.Scanf("%d %d\n", &n, &m)
	reader := bufio.NewReader(os.Stdin)
	line := readLine(reader)
	ans := strings.Split(string(line), " ")
	an := make([]int64, n)
	mm := make(map[int64]struct{})
	for i := int64(0); i < n; i++ {
		x, _ := strconv.ParseInt(ans[i], 10, 64)
		an[i] = x
		if _, ok := mm[x];ok {
			fmt.Println(0)
			return
		}
		if _, ok := mm[x+m];ok {
			fmt.Println(0)
			return
		}
		if _, ok := mm[x-m];ok {
			fmt.Println(0)
			return
		}
		mm[x] = struct{}{}
	}
	result := int64(1)
	for i := int64(0); i < n-1; i++ {
		for j := i+1; j < n; j++ {
			mul := an[i] - an[j]
			if mul < 0 {
				mul = -mul
			}
			result = result * mul
			result = result % m
			if result == 0 {
				fmt.Println(0)
				return
			}
		}
	}
	fmt.Println(result)
}

func readLine(reader *bufio.Reader) []byte {
	result := make([]byte, 0)
	for {
		s, isPrefix, err := reader.ReadLine()
		if err != nil {
			fmt.Printf("error=%+v\n", err)
			break
		}
		result = append(result, s...)
		if !isPrefix {
			// fmt.Println(string(result))
			break
		}
	}
	return result
}

package main

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

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

	var n int
	var mod int64
	Fscan(in, &n, &mod)
	a := make([]int64, n)
	for i := range a {
		Fscan(in, &a[i])
	}
	sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })
	abs := func(x int64) int64 {
		if x < 0 {
			return -x
		}
		return x
	}
	if n < 2000 {
		ans := int64(1)
		for i := 0; i < n; i++ {
			for j := i + 1; j < n; j++ {
				ans *= abs(a[i] - a[j])
				ans %= mod
			}
		}
		Fprintln(out, ans)
	} else {
		Fprintln(out, 0)
	}
}

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

package main

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

func main() {

    n, m := scanInt64(), scanInt64()
    givenArray := scanInt64Slice(int(n))
    answer := int64(1)
    if n > m{
		printFmt(0)
		return
	}
    for i := int64(0); i < n; i++{
    	for j := i+1; j < n; j++{
    		tatkalVariable := absoluteValue(givenArray[i] - givenArray[j]) % m
    		answer = answer * tatkalVariable % m
		}
	}
	printFmt(answer)
	close(channelType)
	oWg.Wait()
}

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

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

func init() {
	printFmt = fmt.Println

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

	channelType = 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 channelType {
			writer.WriteString(line + "\n")
		}
	}()
}

func scanString() string {in.Scan(); return in.Text() }
func scanInt() int {i, _ := strconv.Atoi(scanString()); return i}
func scanInt64() int64 {i, _ := strconv.ParseInt(scanString(), 10, 64); return i}
func scanStringSlice(n int) []string {s := make([]string, n); for i := 0; i < n; i++ {s[i] = scanString()}; 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 stringEquivalent(v interface{}) string {return fmt.Sprintf("%v", v)}
func spaceSeperatedStringFromArray(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 spaceSeperatedStringFromArray64(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 minMaxFromArray(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 minElementFromArray(args ...int64) int64 { mn, _ := minMaxFromArray(args...); return mn }
func maxElementFromArray(args ...int64) int64 { _, mx := minMaxFromArray(args...); return mx }
func lcmCalculation(a, b int64) int64 {return a / gcdCalculation(a, b) * b}
func gcdCalculation(a, b int64) int64 {if (a == 0) {return b}; return gcdCalculation(b%a, a)}
func sortInt64Slice(a []int64) {sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })}
func absoluteValue(x int64) int64 {if x < 0 {return -x}; return x}

package main
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)
func scanUint(s *bufio.Scanner) uint64 {
	s.Scan()
	x, _ := strconv.ParseUint(s.Text(), 10, 64)
	return  x
}
func main() {
	s := bufio.NewScanner(os.Stdin)
	s.Buffer(make([]byte, 1<<12), 1<<20)
	s.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	n, m := scanUint(s),scanUint(s)

	a := make([]uint64, n)
	for i := uint64(0); i < n; i++ {
		a[i] = scanUint(s)
	}
	var b uint64 = 1
	if n <= m {
		for i := uint64(0); i < n-1; i++ {
			for j := uint64(i+1); j < n; j++{
				var c uint64
				if a[i] > a[j] {
					c = a[i] - a[j]
				} else {
					c = a[j] - a[i]
				}
				b = (b * c)%m
			}
		}
	}else {
		b = 0
	}
	fmt.Fprintln(w, b)
}

package main

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

var reader io.Reader
var scanner *bufio.Scanner

func Init(io io.Reader, max_token_size int) {
	reader = bufio.NewReader(io)
	scanner = bufio.NewScanner(reader)
	// max token size
	scanner.Split(bufio.ScanWords)
	scanner.Buffer([]byte{}, max_token_size)
}

func stderr(v ...interface{}) {
	fmt.Fprintln(os.Stderr, v...)
}

func die(v ...interface{}) {
	fmt.Fprintln(os.Stderr, v...)
	os.Exit(1)
}

func NextInt() int {
	bytes := NextBytes()
	i, err := Atoi(bytes)
	if err != nil {
		die(err)
	}
	return i
}

func NextBytes() []byte {
	if !scanner.Scan() {
		die(scanner.Err())
	}
	bytes := scanner.Bytes()
	copied := make([]byte, len(bytes))
	copy(copied, bytes)
	return copied
}

func Atoi(b []byte) (int, error) {
	neg := false
	if b[0] == '+' {
		b = b[1:]
	} else if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		if v < '0' || v > '9' {
			return 0, strconv.ErrSyntax
		}
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n, nil
	}
	return n, nil
}

func ExtendByteArray(a []byte, size int) []byte {
	if size <= len(a) {
		return a
	} else {
		return append(a, make([]byte, size-len(a))...)
	}
}

func ExtendIntArray(a []int, size int) []int {
	if size <= len(a) {
		return a
	} else {
		return append(a, make([]int, size-len(a))...)
	}
}

func fastPow(a, p, mod int) int {
	d := 1 % mod
	for p > 0 {
		if (p & 1) == 1 {
			d *= a
			d %= mod
		}
		a *= a
		a %= mod
		p >>= 1
	}
	return d
}

func main() {
	inf := os.Stdin
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	// inf, err := os.Open("a.in")
	// if err != nil {
	// 	die(err)
	// }
	// out, err := os.Create("a.out")
	// if err != nil {
	// 	die(err)
	// }
	// defer out.Close()
	Init(inf, 1000010)

	n, m := NextInt(), NextInt()
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = NextInt()
	}
	if n > m {
		fmt.Fprintln(out, 0)
		return
	}
	sort.Ints(a)
	counts := make([]int, m)
	res := make([]int, m)
	for i := n - 1; i >= 0; i-- {
		t := a[i] % m
		start := -t
		if start < 0 {
			start += m
		}
		for i := 0; i < m; i++ {
			// stderr("adding to", start, counts[i])
			res[start] += counts[i]
			start++
			if start == m {
				start = 0
			}
		}
		// stderr("increast", t)
		counts[t]++
	}
	// x := m
	// phi := 1
	// for j := 2; j*j <= x; j++ {
	// 	if x%j == 0 {
	// 		pk := 1
	// 		for x%j == 0 {
	// 			x /= j
	// 			pk *= j
	// 		}
	// 		phi *= pk / j * (j - 1)
	// 	}
	// }
	// if x != 1 {
	// 	phi *= x - 1
	// }
	// stderr(phi)
	total := 1
	for i := 0; i < m; i++ {
		// stderr("fastpow", i, res[i]%phi)
		total *= fastPow(i, res[i], m)
		total %= m
	}
	fmt.Fprintln(out, total)
}

// Author: sighduck
// URL: https://codeforces.com/problemset/problem/1305/C

package main

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

func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

func Solve(n int, m int, a []int64) int64 {
	if n > m {
		return 0
	}
	product := int64(1)
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			product = product * abs(a[j]-a[i]) % int64(m)
		}
	}
	return product
}

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

	var n, m int
	fmt.Fscanf(reader, "%d %d\n", &n, &m)
	a := make([]int64, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(reader, "%d", &a[i])
	}

	fmt.Fprintf(writer, "%d\n", Solve(n, m, a))
}

// https://codeforces.com/contest/1352/problem/C
package main

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

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

func main() {
	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Println(solver())
}

func solver() int {
	var n, m int
	fmt.Fscan(input, &n, &m)
	a := make([]int, n)
	maa := make(map[int]bool)
	for i := 0; i < n; i++ {
		fmt.Fscan(input, &a[i])
		if maa[a[i]] {
			return 0
		}
		maa[a[i]] = true
	}

	if len(maa) > m {
		return 0
	}

	ans := 1
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			ans = (ans * ((a[i] - a[j]) % m)) % m
		}
	}

	return abs(ans)
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

package main

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

var reader io.Reader
var scanner *bufio.Scanner

func Init(io io.Reader, max_token_size int) {
	reader = bufio.NewReader(io)
	scanner = bufio.NewScanner(reader)
	// max token size
	scanner.Split(bufio.ScanWords)
	scanner.Buffer([]byte{}, max_token_size)
}

func stderr(v ...interface{}) {
	fmt.Fprintln(os.Stderr, v...)
}

func die(v ...interface{}) {
	fmt.Fprintln(os.Stderr, v...)
	os.Exit(1)
}

func NextInt() int {
	bytes := NextBytes()
	i, err := Atoi(bytes)
	if err != nil {
		die(err)
	}
	return i
}

func NextBytes() []byte {
	if !scanner.Scan() {
		die(scanner.Err())
	}
	bytes := scanner.Bytes()
	copied := make([]byte, len(bytes))
	copy(copied, bytes)
	return copied
}

func Atoi(b []byte) (int, error) {
	neg := false
	if b[0] == '+' {
		b = b[1:]
	} else if b[0] == '-' {
		neg = true
		b = b[1:]
	}
	n := 0
	for _, v := range b {
		if v < '0' || v > '9' {
			return 0, strconv.ErrSyntax
		}
		n = n*10 + int(v-'0')
	}
	if neg {
		return -n, nil
	}
	return n, nil
}

func ExtendByteArray(a []byte, size int) []byte {
	if size <= len(a) {
		return a
	} else {
		return append(a, make([]byte, size-len(a))...)
	}
}

func ExtendIntArray(a []int, size int) []int {
	if size <= len(a) {
		return a
	} else {
		return append(a, make([]int, size-len(a))...)
	}
}

func fastPow(a, p, mod int) int {
	d := 1
	for p > 0 {
		if (p & 1) == 1 {
			d *= a
			d %= mod
		}
		a *= a
		p >>= 1
	}
	return d
}

func main() {
	inf := os.Stdin
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	// inf, err := os.Open("a.in")
	// if err != nil {
	// 	die(err)
	// }
	// out, err := os.Create("a.out")
	// if err != nil {
	// 	die(err)
	// }
	// defer out.Close()
	Init(inf, 1000010)

	n, m := NextInt(), NextInt()
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = NextInt()
	}
	if n > m {
		fmt.Fprintln(out, 0)
		return
	}
	sort.Ints(a)
	counts := make([]int, m)
	res := make([]int, m)
	for i := n - 1; i >= 0; i-- {
		t := a[i] % m
		start := -t
		if start < 0 {
			start += m
		}
		for i := 0; i < m; i++ {
			// stderr("adding to", start, counts[i])
			res[start] += counts[i]
			start++
			if start == m {
				start = 0
			}
		}
		// stderr("increast", t)
		counts[t]++
	}
	x := m
	phi := 1
	for j := 2; j*j <= x; j++ {
		if x%j == 0 {
			pk := 1
			for x%j == 0 {
				x /= j
				pk *= j
			}
			phi *= pk / j * (j - 1)
		}
	}
	if x != 1 {
		phi *= x - 1
	}
	stderr(phi)
	total := 1
	for i := 0; i < m; i++ {
		total *= fastPow(i, res[i]%phi, m)
		total %= m
	}
	fmt.Fprintln(out, total)
}

// https://codeforces.com/contest/1352/problem/C
package main

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

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

func main() {
	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Println(solver())
}

func solver() int {
	var n, m int
	fmt.Fscan(input, &n, &m)
	a := make([]int, n)
	maa := make(map[int]bool)
	for i := 0; i < n; i++ {
		fmt.Fscan(input, &a[i])
		maa[a[i]] = true
	}

	if len(maa) > m {
		return 0
	}

	ans := 1
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			ans = (ans * (a[i] - a[j])) % m
		}
	}

	return abs(ans)
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

// https://codeforces.com/contest/1352/problem/C
package main

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

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

func main() {
	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Println(solver())
}

func solver() int {
	var n, m int
	fmt.Fscan(input, &n, &m)
	a := make([]int, n)
	maa := make(map[int]bool)
	for i := 0; i < n; i++ {
		fmt.Fscan(input, &a[i])
		maa[a[i]] = true
	}

	if len(maa) >= m {
		return 0
	}

	ans := 1
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			ans = (ans * ((a[i] - a[j]) % m)) % m
		}
	}

	return abs(ans)
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

// https://codeforces.com/contest/1352/problem/C
package main

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

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

func main() {
	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Println(solver())
}

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

	if n >= m {
		return 0
	}

	ans := 1
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			ans = (ans * (a[i] - a[j])) % m
		}
	}

	return abs(ans)
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

// https://codeforces.com/contest/1352/problem/C
package main

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

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

func main() {
	//f, _ := os.Open("input.txt")
	//input := bufio.NewReader(f)
	input = bufio.NewReader(os.Stdin)
	fmt.Println(solver())
}

func solver() int {
	var n, m int
	fmt.Fscan(input, &n, &m)
	a := make([]int, n)
	maa := make(map[int]bool)
	for i := 0; i < n; i++ {
		fmt.Fscan(input, &a[i])
		maa[a[i]] = true
	}

	if len(maa) >= m {
		return 0
	}

	ans := 1
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			ans = (ans * (a[i] - a[j])) % m
		}
	}

	return abs(ans)
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

package main

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

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

    var n, m int
    fmt.Fscan(in, &n, &m)
    a := make([]int, n)
    for i := range a {
        fmt.Fscan(in, &a[i])
    }
    if n > m {
        fmt.Fprintln(out, 0)
        return
    }
    prd, dif := 1, 0
    for i := 0; i + 1 < n; i++ {
        for j := i + 1; j < n; j++ {
            dif = a[i] - a[j]
            if dif < 0 {
                dif = -dif
            }
            prd = prd * dif % m
        }
    }
    fmt.Fprintln(out, prd)
    out.Flush()
}

package main

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

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

    var n, m int
    fmt.Fscan(in, &n, &m)
    a := make([]int, n)
    for i := range a {
        fmt.Fscan(in, &a[i])
    }
    if n > m {
        fmt.Fprintln(out, 0)
        return
    }
    prd, dif := 1, 0
    for i := 0; i + 1 < n; i++ {
        for j := i + 1; j < n; j++ {
            dif = a[i] - a[j]
            if dif < 0 {
                dif = -dif
            }
            dif %= m
            prd = prd * dif % m
        }
    }
    fmt.Fprintln(out, prd)
    out.Flush()
}

package main

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

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

    var n, m int
    fmt.Fscan(in, &n, &m)
    a := make([]int, n)
    for i := range a {
        fmt.Fscan(in, &a[i])
    }
    if n >= m {
        fmt.Fprintln(out, 0)
        return
    }
    prd, dif := 1, 0
    for i := 0; i + 1 < n; i++ {
        for j := i + 1; j < n; j++ {
            dif = a[i] - a[j]
            if dif < 0 {
                dif = -dif
            }
            prd = prd * dif % m
        }
    }
    fmt.Fprintln(out, prd)
    out.Flush()
}

package main
import (
	"bufio"
	"fmt"
	"os"
	"math"
)
func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	var n, m int
	fmt.Fscan(r, &n, &m)
	a := make([]int, n)
	c := make([]int, 0, n*n)
	for i := 0; i < n; i++ {
		fmt.Fscan(r, &a[i])
	}
	for i := 0; i < n-1; i++ {
		for j := i+1; j < n; j++{
			c = append(c, int(math.Abs(float64(a[i] - a[j]))))
		}
	}
	b := 1
	for _, e := range c {
		if e == 0 {
			b = 0
			break
		}
		b = (b * e)%m
	}
	fmt.Fprintln(w, b)
}

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

	var n, m uint64
	fmt.Fscan(r, &n, &m)
	a := make([]uint64, n)
	c := make([]uint64, 0, n*n)
	for i := uint64(0); i < n; i++ {
		fmt.Fscan(r, &a[i])
	}
	for i := uint64(0); i < n-1; i++ {
		for j := uint64(i+1); j < n; j++{
			c = append(c, a[i] - a[j])
		}
	}
	var b uint64 = c[0]
	for _, e := range c[1:] {
		if e == 0 {
			b = 0
			break
		}
		b = (b * uint64(e))%m
	}
	fmt.Fprintln(w, b)
}

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

	var n, m uint64
	fmt.Fscan(r, &n, &m)
	a := make([]uint64, n)
	c := make([]uint64, 0, n*n)
	for i := uint64(0); i < n; i++ {
		fmt.Fscan(r, &a[i])
	}
	for i := uint64(0); i < n-1; i++ {
		for j := uint64(i+1); j < n; j++{
			c = append(c, a[i] - a[j])
		}
	}
	var b uint64 = 1
	for _, e := range c {
		if e == 0 {
			b = 0
			break
		}
		b = (b * uint64(e))%m
	}
	fmt.Fprintln(w, b)
}

package main
import (
	"bufio"
	"fmt"
	"os"
	"math"
)
func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	var n, m int
	fmt.Fscan(r, &n, &m)
	a := make([]int, n)
	c := make([]int, 0, n*n)
	for i := 0; i < n; i++ {
		fmt.Fscan(r, &a[i])
	}
	for i := 0; i < n-1; i++ {
		for j := i+1; j < n; j++{
			c = append(c, int(math.Abs(float64(a[i] - a[j]))))
		}
	}
	b := 1
	for _, e := range c {
		b *= e
		if b >= m {
			b %= m
		}
	}
	fmt.Fprintln(w, b)
}

package main
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)
func scanUint(s *bufio.Scanner) uint64 {
	s.Scan()
	x, _ := strconv.ParseUint(s.Text(), 10, 64)
	return  x
}
func main() {
	s := bufio.NewScanner(os.Stdin)
	s.Buffer(make([]byte, 1<<12), 1<<20)
	s.Split(bufio.ScanWords)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	n, m := scanUint(s),scanUint(s)

	a := make([]uint64, n)
	for i := uint64(0); i < n; i++ {
		a[i] = scanUint(s)
	}
	var b uint64 = 1
	if n < m {
		for i := uint64(0); i < n-1; i++ {
			for j := uint64(i+1); j < n; j++{
				var c uint64
				if a[i] > a[j] {
					c = a[i] - a[j]
				} else {
					c = a[j] - a[i]
				}
				b = (b * c)%m
			}
		}
	}else {
		b = 0
	}
	fmt.Fprintln(w, b)
}

package main
import (
	"bufio"
	"fmt"
	"os"
	"math"
)
func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	var n, m int
	fmt.Fscan(r, &n, &m)
	a := make([]int, n)
	c := make([]int, 0, n*n)
	for i := 0; i < n; i++ {
		fmt.Fscan(r, &a[i])
	}
	for i := 0; i < n-1; i++ {
		for j := i+1; j < n; j++{
			c = append(c, int(math.Abs(float64(a[i] - a[j]))))
		}
	}
	b := 1
	for _, e := range c {
		if e == 0 {
			b = 0
			break
		}
		b *= e
		if b >= m {
			b %= m
		}
	}
	fmt.Fprintln(w, b)
}

// Author: sighduck
// URL: https://codeforces.com/problemset/problem/1305/C

package main

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

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

func Solve(n, m int, a []int) int {
	if n > m {
		return 0
	}
	product := 1
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			product *= abs(a[j]-a[i]) % m
		}
	}
	return product % m
}

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

	var n, m int
	fmt.Fscanf(reader, "%d %d\n", &n, &m)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(reader, "%d", &a[i])
	}

	fmt.Fprintf(writer, "%d\n", Solve(n, m, a))
}

// Author: sighduck
// URL: https://codeforces.com/problemset/problem/1305/C

package main

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

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

func Solve(n, m int, a []int) int {
	if n > m {
		return 0
	}
	product := 1
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			product = (product * abs(a[j]-a[i])) % m
		}
	}
	return product
}

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

	var n, m int
	fmt.Fscanf(reader, "%d %d\n", &n, &m)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscanf(reader, "%d", &a[i])
	}

	fmt.Fprintf(writer, "%d\n", Solve(n, m, a))
}