This is an interactive problem. Remember to flush your output while communicating with the testing program. You may use fflush(stdout) in C++, system.out.flush() in Java, stdout.flush() in Python or flush(output) in Pascal to flush the output. If you use some other programming language, consult its documentation. You may also refer to the guide on interactive problems: https://codeforces.com/blog/entry/45307.The jury guessed some array $$$a$$$ consisting of $$$6$$$ integers. There are $$$6$$$ special numbers — $$$4$$$, $$$8$$$, $$$15$$$, $$$16$$$, $$$23$$$, $$$42$$$ — and each of these numbers occurs in $$$a$$$ exactly once (so, $$$a$$$ is some permutation of these numbers).You don't know anything about their order, but you are allowed to ask up to $$$4$$$ queries. In each query, you may choose two indices $$$i$$$ and $$$j$$$ ($$$1 \le i, j \le 6$$$, $$$i$$$ and $$$j$$$ are not necessarily distinct), and you will get the value of $$$a_i \cdot a_j$$$ in return.Can you guess the array $$$a$$$?The array $$$a$$$ is fixed beforehand in each test, the interaction program doesn't try to adapt to your queries.

NoteIf you want to submit a hack for this problem, your test should contain exactly six space-separated integers $$$a_1$$$, $$$a_2$$$, ..., $$$a_6$$$. Each of $$$6$$$ special numbers should occur exactly once in the test. The test should be ended with a line break character.

package main

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

func solve(j Jam) {
	j.PF("? 1 2\n")
	p01 := j.Int()
	j.PF("? 2 3\n")
	p12 := j.Int()
	j.PF("? 3 4\n")
	p23 := j.Int()
	j.PF("? 4 5\n")
	p34 := j.Int()

	nums := [6]int64{4, 8, 15, 16, 23, 42}
	perm := PermNew(6)

	for {
		t01 := nums[perm[0]] * nums[perm[1]]
		t12 := nums[perm[1]] * nums[perm[2]]
		t23 := nums[perm[2]] * nums[perm[3]]
		t34 := nums[perm[3]] * nums[perm[4]]
		if p01 == t01 && p12 == t12 && p23 == t23 && p34 == t34 {
			fmt.Printf("! %d %d %d %d %d %d\n",
				nums[perm[0]], nums[perm[1]],
				nums[perm[2]], nums[perm[3]],
				nums[perm[4]], nums[perm[5]],
			)
			return
		}
		if !perm.Next() {
			panic("not possible")
		}
	}
}

func main() {
	jam, closeFunc := JamNew()
	defer closeFunc()
	solve(jam)
}

type Jam interface {
	Scanner() *bufio.Scanner
	Writer() *bufio.Writer
	Close()

	Str() string
	Int() int64
	Float() float64

	P(format string, values ...interface{})
	PF(format string, values ...interface{})
}

func JamNew() (Jam, func()) {
	if len(os.Args) > 1 {
		panic("running with input file path is not supported")
	}

	var scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 0, 1024*1024), 1024*1024)

	var writer = bufio.NewWriter(os.Stdout)
	jam := &jam{scanner, writer}
	return jam, jam.Close
}

type jam struct {
	sc *bufio.Scanner
	wr *bufio.Writer
}

func (j *jam) Close() {
	if err := j.wr.Flush(); err != nil {
		panic(err)
	}
}

func (j *jam) Scanner() *bufio.Scanner {
	return j.sc
}

func (j *jam) Writer() *bufio.Writer {
	return j.wr
}

func (j *jam) Str() string {
	if !j.sc.Scan() {
		panic("failed to scan next token")
	}

	return j.sc.Text()
}

func (j *jam) Int() int64 {
	if !j.sc.Scan() {
		panic("failed to scan next token")
	}

	res, err := strconv.ParseInt(j.sc.Text(), 10, 64)
	if err != nil {
		panic(err)
	}

	return res
}

func (j *jam) Float() float64 {
	j.sc.Scan()
	res, err := strconv.ParseFloat(j.sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return res
}

func (j *jam) P(format string, values ...interface{}) {
	_, err := fmt.Fprintf(j.wr, format, values...)
	if err != nil {
		panic(err)
	}
}

func (j *jam) PF(format string, values ...interface{}) {
	_, err := fmt.Fprintf(j.wr, format, values...)
	if err != nil {
		panic(err)
	}
	if err = j.wr.Flush(); err != nil {
		panic(err)
	}
}

//	GoLang shorthand methods for math go below
//	TODO wipe unused methods before submitting

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

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

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

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

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

func abs64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

type Perm []uint32

func PermNew(size int) Perm {
	perm := make([]uint32, size)
	for i := range perm {
		perm[i] = uint32(i)
	}
	return perm
}

//	https://www.nayuki.io/page/next-lexicographical-permutation-algorithm

func (perm Perm) Next() bool {
	rollPos := len(perm) - 2
	for rollPos >= 0 && perm[rollPos] > perm[rollPos+1] {
		rollPos -= 1
	}
	if rollPos < 0 {
		return false
	}

	swapPos := rollPos + 1
	for pos := rollPos + 2; pos < len(perm); pos++ {
		if perm[rollPos] < perm[pos] && perm[pos] < perm[swapPos] {
			swapPos = pos
		}
	}
	perm[rollPos], perm[swapPos] = perm[swapPos], perm[rollPos]

	for i, j := rollPos+1, len(perm)-1; i < j; i, j = i+1, j-1 {
		perm[i], perm[j] = perm[j], perm[i]
	}

	return true
}

package main

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

var reader = bufio.NewReader(os.Stdin)
var 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...) }

var m map[int][]int

func main() {
	defer writer.Flush()

	a := []int{4, 8, 15, 16, 23, 42}
	m = make(map[int][]int)
	for _, i := range a {
		for _, j := range a {
			if i > j {
				m[i*j] = []int{j, i}
				continue
			}
			m[i*j] = []int{i, j}
		}
	}

	ans := make([]int, 6)
	ansMap := map[int]struct{}{}

	var resp int
	printf("? 1 2\n")
	writer.Flush()
	scanf("%v\n", &resp)
	v := m[resp]
	ans[0] = v[0]
	ans[1] = v[1]
	ansMap[v[0]] = struct{}{}
	ansMap[v[1]] = struct{}{}

	printf("? 2 3\n")
	writer.Flush()
	scanf("%v\n", &resp)
	v = m[resp]
	if _, ok := ansMap[v[0]]; !ok {
		ans[2] = v[0]
		ansMap[v[0]] = struct{}{}
	} else {
		ans[2] = v[1]
		ansMap[v[1]] = struct{}{}
	}
	if ans[1]*ans[2] != resp {
		ans[0], ans[1] = ans[1], ans[0]
	}

	printf("? 3 4\n")
	writer.Flush()
	scanf("%v\n", &resp)
	v = m[resp]
	if _, ok := ansMap[v[0]]; !ok {
		ans[3] = v[0]
		ansMap[v[0]] = struct{}{}
	} else {
		ans[3] = v[1]
		ansMap[v[1]] = struct{}{}
	}

	printf("? 4 5\n")
	writer.Flush()
	scanf("%v\n", &resp)
	v = m[resp]
	if _, ok := ansMap[v[0]]; !ok {
		ans[4] = v[0]
		ansMap[v[0]] = struct{}{}
	} else {
		ans[4] = v[1]
		ansMap[v[1]] = struct{}{}
	}

	for _, v := range a {
		if _, ok := ansMap[v]; !ok {
			ans[5] = v
			break
		}
	}

	printf("! %d %d %d %d %d %d\n", ans[0], ans[1], ans[2], ans[3], ans[4], ans[5])
}

package main

import (
	"fmt"
	"os"
)

func perm(ori []int, cur []int, vis []bool, pos int, res *[][]int) {
	if pos == len(ori) {
		*res = append(*res, append([]int{}, cur...))
		return
	}
	for i := 0; i < len(ori); i++ {
		if !vis[i] {
			vis[i] = true
			cur[pos] = ori[i]
			perm(ori, cur, vis, pos+1, res)
			vis[i] = false
		}
	}
}

func main() {
	ori := []int{4, 8, 15, 16, 23, 42}
	res := [][]int{}

	perm(ori, make([]int, len(ori)), make([]bool, len(ori)), 0, &res)

	m := make(map[string]int)
	for i := 0; i < len(res); i++ {
		cur := res[i]
		key := fmt.Sprintf("%d,%d,%d,%d", cur[0]*cur[1], cur[2]*cur[3], cur[0]*cur[4], cur[2]*cur[4])
		m[key] = i
	}

	var q1, q2, q3, q4 int

	fmt.Printf("? 1 2\n")
	os.Stdout.Sync()
	fmt.Scanf("%d\n", &q1)

	fmt.Printf("? 3 4\n")
	os.Stdout.Sync()
	fmt.Scanf("%d\n", &q2)

	fmt.Printf("? 1 5\n")
	os.Stdout.Sync()
	fmt.Scanf("%d\n", &q3)

	fmt.Printf("? 3 5\n")
	os.Stdout.Sync()
	fmt.Scanf("%d\n", &q4)

	//fmt.Printf("%d %d %d %d", q1, q2, q3, q4)

	key := fmt.Sprintf("%d,%d,%d,%d", q1, q2, q3, q4)
	if v, ok := m[key]; ok {
		fmt.Printf("! %d %d %d %d %d %d\n", res[v][0], res[v][1], res[v][2], res[v][3], res[v][4], res[v][5])
		os.Stdout.Sync()
	}
}


You are given a positive integer $$$n$$$. You have to find $$$4$$$ positive integers $$$a, b, c, d$$$ such that  $$$a + b + c + d = n$$$, and $$$\gcd(a, b) = \operatorname{lcm}(c, d)$$$.If there are several possible answers you can output any of them. It is possible to show that the answer always exists.In this problem $$$\gcd(a, b)$$$ denotes the greatest common divisor of $$$a$$$ and $$$b$$$, and $$$\operatorname{lcm}(c, d)$$$ denotes the least common multiple of $$$c$$$ and $$$d$$$.

The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Description of the test cases follows. Each test case contains a single line with integer $$$n$$$ ($$$4 \le n \le 10^9$$$) — the sum of $$$a$$$, $$$b$$$, $$$c$$$, and $$$d$$$.

For each test case output $$$4$$$ positive integers $$$a$$$, $$$b$$$, $$$c$$$, $$$d$$$ such that $$$a + b + c + d = n$$$ and $$$\gcd(a, b) = \operatorname{lcm}(c, d)$$$.

package main

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

// if it is an even number, then c and d will be 1 and 1 and we just need to find two primes number to a and b and a + b = n - 2

// if it is an odd number, then b and c and d will be 1, a will be n - 3 which is an even number

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

	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())

	for i := 0; i < t; i++ {
		scanner.Scan()
		n, _ := strconv.Atoi(scanner.Text())
		fmt.Printf("%d %d %d %d\n", n-3, 1, 1, 1)
	}

}

package main

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

func main_div2_781_A() {
	_in, _out := os.Stdin, os.Stdout
	in, out := bufio.NewReader(_in), bufio.NewWriter(_out)
	defer out.Flush()
	var cas int = 1
	Fscan(in, &cas)
	var sol func()
	/* Begin Coding */
	sol = func() {
		var n int
		Fscan(in, &n)
		// if n == 6 {

		// 	return
		// }
		// if n%4 == 0 {
		// 	Fprintln(out, n/4, " ", n/4, " ", n/4, " ", n/4)
		// } else if n%4 == 1 || n%4 == 3 {
		// 	Fprintln(out, 1, " ", n-3, " ", 1, " ", 1)
		// } else {
		// 	Fprintln(out, 2, " ", n-6, " ", 2, " ", 2)
		// }
		Fprintln(out, n-3, " ", 1, " ", 1, " ", 1)
	}
	/* Code Ending */
	for i := 0; i < cas; i++ {
		sol()
	}

}

func main() {
	main_div2_781_A()
}

package main

import "fmt"

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

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

func main() {
	var t int
	fmt.Scan(&t)

	for ; t > 0; t-- {
		var n int64
		fmt.Scan(&n)

		if n == 4 {
			fmt.Println(1, 1, 1, 1)
		} else {
			fmt.Println(n-3, 1, 1, 1)
		}
	}
}

package main

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

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

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

	var c int
	var n int
	Fscan(in, &c)
	for ; c > 0; c-- {
		ans := [4]int{}
		Fscan(in, &n)
		if n%4 == 0 {
			for i := range ans {
				ans[i] = n / 4
			}
		} else {
			n -= 2
			if n%2 == 0 && n != 2 {
				ans[0] = n/2 - 1
				ans[1] = n/2 + 1
			} else {
				ans[0] = n / 2
				ans[1] = n/2 + 1
			}
			ans[2] = 1
			ans[3] = 1
		}
		Fprintf(out, "%d %d %d %d\n", ans[0], ans[1], ans[2], ans[3])
	}
}

package main
import(
    "fmt"
    "bufio"
    "os"
)
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var x int
		fmt.Fscan(in,&x)
		if x%4 == 0 {
			fmt.Fprintln(out, x/4,x/4,x/4,x/4)
			continue
		}
		fmt.Fprintln(out,x-3,1,1,1)
	}
}

package main

import "fmt"

func main() {
	var t int
	fmt.Scan(&t)
	for ; t > 0; t-- {
		var n int
		fmt.Scan(&n)
		fmt.Printf("%d %d %d %d\n", n-3, 1, 1, 1)
	}
}

package main

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

type CF1665A struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1665A) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1665A) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1665A) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1665A) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1665A) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1665A
Date: 28/04/22
User: pepradere
URL: https://codeforces.com/problemset/problem/1665/A
Problem: CF1665A
**/
func (in *CF1665A) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		fmt.Println(1, n-3, 1, 1)

	}
}

func NewCF1665A(r *bufio.Reader) *CF1665A {
	return &CF1665A{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1665A(bufio.NewReader(os.Stdin)).Run()
}

package main

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

const mod = 998244353

func solve(in *bufio.Reader, out *bufio.Writer) {
	defer out.Flush()
	var n int
	fmt.Fscan(in,&n)
	fmt.Fprintf(out,"%d %d %d %d\n",n-3,1,1,1)
}

func abs(a,b int)int{
	if a > b{
		return a - b
	}
	return b - a
}
func sum(a,b int64)int64{
	return (b + a) * (b - a + 1) / 2
}

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

func main() {
	stdin := os.Stdin
	stdout := os.Stdout
	in := bufio.NewReader(stdin)
	out := bufio.NewWriter(stdout)
	n := 1
	fmt.Fscan(in, &n)
	for i := 0; i < n; i++ {
		solve(in, out)
	}
}

package main

// Problem description URL https://atcoder.jp/contests/abc236/tasks/abc240_a

import (
	"bufio"
	"container/list"
	"fmt"
	"os"
)

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

func scan(a ...interface{})             { fmt.Fscan(in, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(out, f, a...) }

type pair struct {
	Color int
	Size  int
}

var (
	n   = 0
	t   = 0
	a []int
	res []int
	s   *list.List
	cur = 0
)

func gcd(a int, b int) int {
	if a%b==0 {
		return b
	}
	return gcd(b, a%b)
}
func solve() {
	scan(&t)
	for t != 0 {
		t--
		scan(&n)
		if n%4 == 0 {
			printf("%d %d %d %d\n", n/4,n/4,n/4,n/4)
		}else {
			a,b := 1,n-3
			for ;a<n-2;a++{
				if gcd(a, b) == 1 {
					break
				}
				b--
			}
			printf("%d %d %d %d\n",  a,b,1,1)
		}
	}
}

func main() {
	defer out.Flush()
	solve()
}

package main

import "fmt"

func main() {
	var t int

	fmt.Scan(&t)

	for ; t > 0 ; t--  {

		var n int

		fmt.Scan(&n)

		fmt.Println(n - 3, 1, 1, 1);

	}

}

package main

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

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

	var T, n int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		Fprintln(out, n-3, 1, 1, 1)
	}
}

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

package main

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

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

	var tests int
	_, _ = fmt.Fscan(reader, &tests)

	for t := 0; t < tests; t++ {
		var n int
		fmt.Fscan(reader, &n)
		fmt.Fprintln(writer, n-3, 1, 1, 1)
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var t int
	_, _ = fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		var n int
		_, _ = fmt.Fscan(reader, &n)
		var m = n - 2 - 1
		fmt.Printf("%v 1 1 1\n", m)
	}
}

package main

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

func main() {

	reader := bufio.NewReader(os.Stdin)
	writter := bufio.NewWriter(os.Stdout)
	defer writter.Flush()

	t := 0
	fmt.Fscan(reader, &t)

	for t > 0 {
		n := 0
		fmt.Fscan(reader, &n)

		result := solve(n)

		for i := range result {
			fmt.Fprintf(writter, "%d ", result[i])
		}
		fmt.Fprintln(writter)

		t--
	}

	// n := 7
	// fmt.Println(solve(n))

	//ethereum.Ethereum()

}

func solve(n int) []int {

	result := []int{n - 3, 1, 1, 1}

	return result
}

package main

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

var (
	sc *bufio.Scanner
	wr *bufio.Writer
)

func init() {
	sc = bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	wr = bufio.NewWriter(os.Stdout)
}

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

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

func main() {
	defer wr.Flush()
	T := scanInt()

	for ; T > 0; T-- {
		a, b, c, d := solve(scanInt())
		fmt.Fprintln(wr, a, b, c, d)
	}
}

func solve(n int) (int, int, int, int) {
	return 1, n - 3, 1, 1
}

package main

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

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

	var t int
	Fscan(in, &t)
	for ; t > 0; t-- {
		var n int
		Fscan(in, &n)
		// var solve func() = func ()  {
		// 	for i := 1; i <= n; i++ {
		// 		for j := 1; j <= n; j++ {
		// 			for k := 1; k <= n; k++ {
		// 				l := n - i - j - k
		// 				if l < 0 { break }
		// 				if gcd(i, j) == lcm(k, l) {
		// 					Fprintln(out, i, j, k, l)
		// 					return
		// 				}
		// 			}
		// 		}
		// 	}
		// }
		// solve()
		Fprintln(out, 1, n - 3, 1, 1)
	}
}

func min(a, b int) int { if a > b { return b }; return a }
func max(a, b int) int { if a < b { return b }; return a }
func abs(v int) int { if v > 0 { return v }; return -v }
func gcd(a, b int) int { if b > 0 { return gcd(b, a % b) }; return a }
func lcm(a, b int) int { return a * b / gcd(a, b) }

package main

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

const (
	INF = 3e5 + 10
)

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

	var t int
	Fscan(in, &t)

	for i := 1; i <= t; i++ {
		var n int
		Fscan(in, &n)
		Fprintln(out, n-3, 1, 1, 1)

	}

}

package main

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

const MOD int64 = 1000000007

var n int

// ByAge implements sort.Interface based on the Age field.
type ByV []*pair

func (a ByV) Len() int           { return len(a) }
func (a ByV) Less(i, j int) bool { return a[i].v < a[j].v }
func (a ByV) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {

	read := bufio.NewReader(os.Stdin)

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

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

		fmt.Fscan(read, &n)

		solve()
	}
}

type pair struct {
	v int
	idx []int
}

//a b c d

//20 12 -- 4
//4  2  -- 4

func solve()  {
	//c = k1 * p
	//d = k2 * p
	//

	//11

	//8 1 1 1

	fmt.Println(n - 3, 1, 1, 1)
}

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

package main

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

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

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

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

		fmt.Fprintln(out, n-3, 1, 1, 1)
	}
}

package main

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

func main_div2_781_A() {
	_in, _out := os.Stdin, os.Stdout
	in, out := bufio.NewReader(_in), bufio.NewWriter(_out)
	defer out.Flush()
	var cas int = 1
	Fscan(in, &cas)
	var sol func()
	/* Begin Coding */
	sol = func() {
		var n int
		Fscan(in, &n)
		if n%4 == 0 {
			Fprintln(out, n/4, " ", n/4, " ", n/4, " ", n/4)
		} else if n%4 == 1 || n%4 == 3 {
			Fprintln(out, 2, " ", n-4, " ", 1, " ", 1)
		} else {
			Fprintln(out, 2, " ", n-6, " ", 2, " ", 2)
		}
	}
	/* Code Ending */
	for i := 0; i < cas; i++ {
		sol()
	}

}

func main() {
	main_div2_781_A()
}

package main

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

func main_div2_781_A() {
	_in, _out := os.Stdin, os.Stdout
	in, out := bufio.NewReader(_in), bufio.NewWriter(_out)
	defer out.Flush()
	var cas int = 1
	Fscan(in, &cas)
	var sol func()
	/* Begin Coding */
	sol = func() {
		var n int
		Fscan(in, &n)
		if n%4 == 0 {
			Fprintln(out, n/4, " ", n/4, " ", n/4, " ", n/4)
		} else if n%4 == 1 || n%4 == 3 {
			Fprintln(out, 2, " ", n-4, " ", 1, " ", 1)
		} else {
			Fprintln(out, 3, " ", n-5, " ", 1, " ", 1)
		}
	}
	/* Code Ending */
	for i := 0; i < cas; i++ {
		sol()
	}

}

func main() {
	main_div2_781_A()
}

package main

import "fmt"

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

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

func main() {
	var t int
	fmt.Scan(&t)

	for ; t > 0; t-- {
		var n int64
		fmt.Scan(&n)

		if n == 4 {
			fmt.Println(1, 1, 1, 1)
		} else if n%2 == 0 {
			n = n - 2
			fmt.Println(n/2+1, n/2-1, 1, 1)
		} else {
			n = n - 2
			fmt.Println(n/2, n/2+1, 1, 1)
		}
	}
}

package main

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

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

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

	var c int
	var n int
	Fscan(in, &c)
	for ; c > 0; c-- {
		ans := [4]int{}
		Fscan(in, &n)
		if n%4 == 0 {
			for i := range ans {
				ans[i] = n / 4
			}
		} else {
			n -= 2
			ans[0] = n / 2
			ans[1] = n/2 + 1
			ans[2] = 1
			ans[3] = 1
		}
		Fprintf(out, "%d %d %d %d\n", ans[0], ans[1], ans[2], ans[3])
	}
}


Andryusha goes through a park each day. The squares and paths between them look boring to Andryusha, so he decided to decorate them.The park consists of n squares connected with (n - 1) bidirectional paths in such a way that any square is reachable from any other using these paths. Andryusha decided to hang a colored balloon at each of the squares. The baloons' colors are described by positive integers, starting from 1. In order to make the park varicolored, Andryusha wants to choose the colors in a special way. More precisely, he wants to use such colors that if a, b and c are distinct squares that a and b have a direct path between them, and b and c have a direct path between them, then balloon colors on these three squares are distinct.Andryusha wants to use as little different colors as possible. Help him to choose the colors!

The first line contains single integer n (3 ≤ n ≤ 2·105) — the number of squares in the park. Each of the next (n - 1) lines contains two integers x and y (1 ≤ x, y ≤ n) — the indices of two squares directly connected by a path. It is guaranteed that any square is reachable from any other using the paths.

In the first line print single integer k — the minimum number of colors Andryusha has to use. In the second line print n integers, the i-th of them should be equal to the balloon color on the i-th square. Each of these numbers should be within range from 1 to k.

NoteIn the first sample the park consists of three squares: 1 → 3 → 2. Thus, the balloon colors have to be distinct.    Illustration for the first sample. In the second example there are following triples of consequently connected squares:   1 → 3 → 2  1 → 3 → 4  1 → 3 → 5  2 → 3 → 4  2 → 3 → 5  4 → 3 → 5  We can see that each pair of squares is encountered in some triple, so all colors have to be distinct.    Illustration for the second sample. In the third example there are following triples:   1 → 2 → 3  2 → 3 → 4  3 → 4 → 5  We can see that one or two colors is not enough, but there is an answer that uses three colors only.    Illustration for the third sample.

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

package main

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

type Edge struct {
	from int
	to   int
}

type Answer struct {
	maxColor int
	colors   []int
}

type Item struct {
	vertex      int
	color       int
	parentColor int
}

func Solve(n int, edges []Edge) Answer {
	graph := make(map[int][]int)
	for _, edge := range edges {
		graph[edge.from] = append(graph[edge.from], edge.to)
		graph[edge.to] = append(graph[edge.to], edge.from)
	}
	colors := make([]int, n+1)
	visited := make([]bool, n+1)
	visited[1] = true
	stack := []Item{{1, 1, 0}}
	for len(stack) > 0 {
		item := stack[len(stack)-1]
		stack = stack[:len(stack)-1]
		colors[item.vertex] = item.color
		i := 1
		for _, v := range graph[item.vertex] {
			if !visited[v] {
				visited[v] = true
				for item.parentColor == i || item.color == i {
					i += 1
				}
				stack = append(stack, Item{v, i, item.color})
				i += 1
			}
		}
	}
	maxColor := 0
	for _, elem := range colors {
		if elem > maxColor {
			maxColor = elem
		}
	}
	return Answer{maxColor, colors[1:]}
}

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

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	edges := make([]Edge, n-1)
	for i := 0; i < n-1; i++ {
		fmt.Fscanf(reader, "%d %d\n", &edges[i].from, &edges[i].to)
	}

	ans := Solve(n, edges)
	fmt.Fprintf(writer, "%d\n", ans.maxColor)
	for _, elem := range ans.colors {
		fmt.Fprintf(writer, "%d ", elem)
	}
	fmt.Fprintf(writer, "\n")
}

package main

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

var res []int

type Vertex struct {
	color int
	adj   []*Vertex
}

func (v *Vertex) add(u *Vertex) {
	v.adj = append(v.adj, u)
}

func (v *Vertex) dfs(us int, skip int) {
	v.color = us
	nxt := 1
	for nxt == us || nxt == skip {
		nxt++
	}
	for _, next := range v.adj {
		if next.color == 0 {
			next.dfs(nxt, us)
			nxt++
			for nxt == us || nxt == skip {
				nxt++
			}
		}
	}
}

func solve() {
	n := readInt()
	vertexes := make([]*Vertex, n)
	for i := 0; i < n; i++ {
		vertexes[i] = &Vertex{0, make([]*Vertex, 0)}
	}
	for i := 0; i < n-1; i++ {
		x := readInt() - 1
		y := readInt() - 1
		vertexes[y].add(vertexes[x])
		vertexes[x].add(vertexes[y])
	}
	vertexes[0].dfs(1, 0)
	max := 0
	for _, v := range vertexes {
		if max < len(v.adj)+1 {
			max = len(v.adj) + 1
		}
	}
	fmt.Println(max)
	var buffer bytes.Buffer
	for i, v := range vertexes {
		if i > 0 {
			buffer.WriteString(" ")
		}
		buffer.WriteString(strconv.Itoa(v.color))
	}
	fmt.Println(buffer.String())
}

var scanner *bufio.Scanner

type MinHeap struct {
	a    []int
	vmap []int
	imap []int
	n    int
	pos  int
}

const INF = math.MaxInt32

func NewMinHeap(m int) *MinHeap {
	heap := &MinHeap{}
	m += 2
	heap.n = m
	heap.a = make([]int, heap.n)
	heap.vmap = make([]int, heap.n)
	heap.imap = make([]int, heap.n)
	heap.pos = 1
	for i := 0; i < heap.n; i++ {
		heap.a[i] = INF
		heap.vmap[i] = -1
		heap.imap[i] = -1
	}
	return heap
}

func (h *MinHeap) Add(ind, x int) int {
	ret := h.imap[ind]
	if h.imap[ind] < 0 {
		h.a[h.pos] = x
		h.vmap[h.pos] = ind
		h.imap[ind] = h.pos
		h.pos++
		h.up(h.pos - 1)
	}
	if ret != -1 {
		return h.a[ret]
	}
	return x
}

func (h *MinHeap) Update(ind, x int) int {
	ret := h.imap[ind]
	if h.imap[ind] < 0 {
		h.a[h.pos] = x
		h.vmap[h.pos] = ind
		h.imap[ind] = h.pos
		h.pos++
		h.up(h.pos - 1)
	} else {
		h.a[ret] = x
		h.up(ret)
		h.down(ret)
	}
	return x
}

func (h *MinHeap) Remove(ind int) int {
	if h.pos == 1 {
		return INF
	}
	if h.imap[ind] == -1 {
		return INF
	}

	h.pos--
	rem := h.imap[ind]
	ret := h.a[rem]
	h.vmap[rem] = h.vmap[h.pos]
	h.imap[h.vmap[h.pos]] = rem
	h.imap[ind] = -1
	h.a[rem] = h.a[h.pos]
	h.a[h.pos] = INF
	h.vmap[h.pos] = -1

	h.up(rem)
	h.down(rem)
	return ret
}

func (h *MinHeap) Min() int {
	return h.a[1]
}

func (h *MinHeap) ArgMin() int {
	return h.vmap[1]
}

func (h *MinHeap) Size() int {
	return h.pos - 1
}

func (h *MinHeap) up(cur int) {
	for c, p := cur, cur>>1; p >= 1 && h.a[p] > h.a[c]; c, p = c>>1, p>>1 {
		h.a[p], h.a[c] = h.a[c], h.a[p]
		h.imap[h.vmap[p]], h.imap[h.vmap[c]] = h.imap[h.vmap[c]], h.imap[h.vmap[p]]
		h.vmap[p], h.vmap[c] = h.vmap[c], h.vmap[p]
	}
}

func (h *MinHeap) down(cur int) {
	for c := cur; 2*c < h.pos; {
		b := 0
		if h.a[2*c] < h.a[2*c+1] {
			b = 2 * c
		} else {
			b = 2*c + 1
		}
		if h.a[b] < h.a[c] {
			h.a[c], h.a[b] = h.a[b], h.a[c]
			h.imap[h.vmap[c]], h.imap[h.vmap[b]] = h.imap[h.vmap[b]], h.imap[h.vmap[c]]
			h.vmap[c], h.vmap[b] = h.vmap[b], h.vmap[c]
			c = b
		} else {
			break
		}
	}
}
func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// IO

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

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

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

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

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

package main

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

var scanner = bufio.NewScanner(os.Stdin)

const (
	//MaxScanTokenSize = 64 * 1024 // package default
	MaxScanTokenSize = 8 * 1024 * 1024 // 8M
)

func init() {
	scanner.Buffer(make([]byte, 0, MaxScanTokenSize), MaxScanTokenSize)
	scanner.Split(bufio.ScanWords)
}

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

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

type Edge struct {
	From int
	To   int
	Cap  int
	Flow int
}

type Graph struct {
	NNode  int
	NEdge  int
	Edges  []Edge
	Nodes  [][]int

	Colors []int
}

func NewGraph(nNode, nEdge int) *Graph {
	g := &Graph{
		NNode: nNode,
		NEdge: nEdge,
		Edges: make([]Edge, 0, nEdge),
		Nodes: make([][]int, nNode, nNode),

		Colors: make([]int, nNode, nNode),
	}
	return g
}

func (g *Graph) AddEdge(from, to, cap, flow int) {
	g.Nodes[from] = append(g.Nodes[from], len(g.Edges))
	g.Edges = append(g.Edges, Edge{from, to, cap, flow})
	g.Nodes[to] = append(g.Nodes[to], len(g.Edges))
	g.Edges = append(g.Edges, Edge{to, from, cap, flow})
}

func (g *Graph) Show() {
	fmt.Printf("n node = %d, n edge = %d\n", g.NNode, g.NEdge)
	for i, cur := range g.Nodes {
		fmt.Printf("[%d]", i)
		for _, next := range cur {
			fmt.Printf(" %d", g.Edges[next].To)
		}
		fmt.Println()
	}
}

func paint(g *Graph, pre, cur int) {
	color := 1
	for _, ie := range g.Nodes[cur] {
		next := g.Edges[ie].To
		if pre == next {
			continue
		}
		for (pre != -1 && color == g.Colors[pre]) || (color == g.Colors[cur]) {
			color++
		}
		g.Colors[next] = color
		color++

		if pre != next {
			paint(g, cur, next)
		}
	}
}

func main() {
	n := readInt()
	g := NewGraph(n, n - 1)

	for i := 1; i < n; i++ {
		from, to := readInt(), readInt()
		g.AddEdge(from - 1, to - 1, 0, 0)
	}
	//g.Show()

	g.Colors[0] = 1
	paint(g, -1, 0)

	maxColor := 0
	for _, color := range g.Colors {
		if color > maxColor {
			maxColor = color
		}
	}

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

	fmt.Fprintln(w, maxColor)
	for i := 0; i < n; i++ {
		fmt.Fprintf(w, "%d ", g.Colors[i])
	}
	fmt.Fprintln(w)
}

package main

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

var scanner = bufio.NewScanner(os.Stdin)

const (
	//MaxScanTokenSize = 64 * 1024 // package default
	MaxScanTokenSize = 8 * 1024 * 1024 // 8M
)

func init() {
	scanner.Buffer(make([]byte, 0, MaxScanTokenSize), MaxScanTokenSize)
	scanner.Split(bufio.ScanWords)
}

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

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

type Edge struct {
	From int
	To   int
	Cap  int
	Flow int
}

type Graph struct {
	NNode  int
	NEdge  int
	Edges  []Edge
	Nodes  [][]int

	Colors []int
}

func NewGraph(nNode, nEdge int) *Graph {
	g := &Graph{
		NNode: nNode,
		NEdge: nEdge,
		Edges: make([]Edge, 0, nEdge),
		Nodes: make([][]int, nNode, nNode),

		Colors: make([]int, nNode, nNode),
	}
	return g
}

func (g *Graph) AddEdge(from, to, cap, flow int) {
	g.Nodes[from] = append(g.Nodes[from], len(g.Edges))
	g.Edges = append(g.Edges, Edge{from, to, cap, flow})
	g.Nodes[to] = append(g.Nodes[to], len(g.Edges))
	g.Edges = append(g.Edges, Edge{to, from, cap, flow})
}

func (g *Graph) Show() {
	fmt.Printf("n node = %d, n edge = %d\n", g.NNode, g.NEdge)
	for i, cur := range g.Nodes {
		fmt.Printf("[%d]", i)
		for _, next := range cur {
			fmt.Printf(" %d", g.Edges[next].To)
		}
		fmt.Println()
	}
}

func paint(g *Graph, pre, cur int) {
	color := 1
	for _, ie := range g.Nodes[cur] {
		next := g.Edges[ie].To
		if pre == next {
			continue
		}
		for (pre != -1 && color == g.Colors[pre]) || (color == g.Colors[cur]) {
			color++
		}
		g.Colors[next] = color
		color++

		if pre != next {
			paint(g, cur, next)
		}
	}
}

func main() {
	n := readInt()
	g := NewGraph(n, n - 1)

	for i := 1; i < n; i++ {
		from, to := readInt(), readInt()
		g.AddEdge(from - 1, to - 1, 0, 0)
	}
	//g.Show()

	g.Colors[0] = 1
	paint(g, -1, 0)

	maxColor := 0
	for _, color := range g.Colors {
		if color > maxColor {
			maxColor = color
		}
	}
	fmt.Println(maxColor)
	for i := 0; i < n; i++ {
		fmt.Printf("%d ", g.Colors[i])
	}
	fmt.Println("")
}

package main

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

var scanner = bufio.NewScanner(os.Stdin)

const (
	//MaxScanTokenSize = 64 * 1024 // package default
	MaxScanTokenSize = 8 * 1024 * 1024 // 8M
)

func init() {
	scanner.Buffer(make([]byte, 0, MaxScanTokenSize), MaxScanTokenSize)
	scanner.Split(bufio.ScanWords)
}

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

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

type Edge struct {
	From int
	To   int
	Cap  int
	Flow int
}

type Graph struct {
	NNode  int
	NEdge  int
	Edges  []Edge
	Nodes  [][]int

	Colors []int
}

func NewGraph(nNode, nEdge int) *Graph {
	g := &Graph{
		NNode: nNode,
		NEdge: nEdge,
		Edges: make([]Edge, 0, nEdge),
		Nodes: make([][]int, nNode, nNode),

		Colors: make([]int, nNode, nNode),
	}
	return g
}

func (g *Graph) AddEdge(from, to, cap, flow int) {
	g.Nodes[from] = append(g.Nodes[from], len(g.Edges))
	g.Edges = append(g.Edges, Edge{from, to, cap, flow})
	g.Nodes[to] = append(g.Nodes[to], len(g.Edges))
	g.Edges = append(g.Edges, Edge{to, from, cap, flow})
}

func (g *Graph) Show() {
	fmt.Printf("n node = %d, n edge = %d\n", g.NNode, g.NEdge)
	for i, cur := range g.Nodes {
		fmt.Printf("[%d]", i)
		for _, next := range cur {
			fmt.Printf(" %d", g.Edges[next].To)
		}
		fmt.Println()
	}
}

func paint(g *Graph, pre, cur int) {
	color := 1
	for _, ie := range g.Nodes[cur] {
		next := g.Edges[ie].To
		if pre == next {
			continue
		}
		for (pre != -1 && color == g.Colors[pre]) || (color == g.Colors[cur]) {
			color++
		}
		g.Colors[next] = color
		color++

		if pre != next {
			paint(g, cur, next)
		}
	}
}

func main() {
	n := readInt()
	g := NewGraph(n, n - 1)

	for i := 1; i < n; i++ {
		from, to := readInt(), readInt()
		g.AddEdge(from - 1, to - 1, 0, 0)
	}
	//g.Show()

	g.Colors[0] = 1
	paint(g, -1, 0)

	maxColor := 0
	for _, color := range g.Colors {
		if color > maxColor {
			maxColor = color
		}
	}

	w := bufio.NewWriter(os.Stdout)

	fmt.Fprintln(w, maxColor)
	//fmt.Println(maxColor)
	for i := 0; i < n; i++ {
		fmt.Fprintf(w, "%d ", g.Colors[i])
		//fmt.Printf("%d ", g.Colors[i])
	}
	fmt.Fprintln(w)
	//fmt.Println("")
	w.Flush()
}

package main

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

var res []int

type Vertex struct {
	color int
	adj   []*Vertex
}

func (v *Vertex) add(u *Vertex) {
	v.adj = append(v.adj, u)
}

func (v *Vertex) dfs(us int, skip int) {
	v.color = us
	nxt := 0
	for nxt == us || nxt == skip {
		nxt++
	}
	for _, next := range v.adj {
		if next.color == 0 {
			next.dfs(nxt, us)
			nxt++
			for nxt == us || nxt == skip {
				nxt++
			}
		}
	}
}

func solve() {
	n := readInt()
	vertexes := make([]*Vertex, n)
	for i := 0; i < n; i++ {
		vertexes[i] = &Vertex{0, make([]*Vertex, 0)}
	}
	for i := 0; i < n-1; i++ {
		x := readInt() - 1
		y := readInt() - 1
		vertexes[y].add(vertexes[x])
		vertexes[x].add(vertexes[y])
	}
	vertexes[0].dfs(1, 0)
	max := 0
	for _, v := range vertexes {
		if max < len(v.adj)+1 {
			max = len(v.adj) + 1
		}
	}
	fmt.Println(max)
	var buffer bytes.Buffer
	for i, v := range vertexes {
		if i > 0 {
			buffer.WriteString(" ")
		}
		buffer.WriteString(strconv.Itoa(v.color))
	}
	fmt.Println(buffer.String())
}

var scanner *bufio.Scanner

type MinHeap struct {
	a    []int
	vmap []int
	imap []int
	n    int
	pos  int
}

const INF = math.MaxInt32

func NewMinHeap(m int) *MinHeap {
	heap := &MinHeap{}
	m += 2
	heap.n = m
	heap.a = make([]int, heap.n)
	heap.vmap = make([]int, heap.n)
	heap.imap = make([]int, heap.n)
	heap.pos = 1
	for i := 0; i < heap.n; i++ {
		heap.a[i] = INF
		heap.vmap[i] = -1
		heap.imap[i] = -1
	}
	return heap
}

func (h *MinHeap) Add(ind, x int) int {
	ret := h.imap[ind]
	if h.imap[ind] < 0 {
		h.a[h.pos] = x
		h.vmap[h.pos] = ind
		h.imap[ind] = h.pos
		h.pos++
		h.up(h.pos - 1)
	}
	if ret != -1 {
		return h.a[ret]
	}
	return x
}

func (h *MinHeap) Update(ind, x int) int {
	ret := h.imap[ind]
	if h.imap[ind] < 0 {
		h.a[h.pos] = x
		h.vmap[h.pos] = ind
		h.imap[ind] = h.pos
		h.pos++
		h.up(h.pos - 1)
	} else {
		h.a[ret] = x
		h.up(ret)
		h.down(ret)
	}
	return x
}

func (h *MinHeap) Remove(ind int) int {
	if h.pos == 1 {
		return INF
	}
	if h.imap[ind] == -1 {
		return INF
	}

	h.pos--
	rem := h.imap[ind]
	ret := h.a[rem]
	h.vmap[rem] = h.vmap[h.pos]
	h.imap[h.vmap[h.pos]] = rem
	h.imap[ind] = -1
	h.a[rem] = h.a[h.pos]
	h.a[h.pos] = INF
	h.vmap[h.pos] = -1

	h.up(rem)
	h.down(rem)
	return ret
}

func (h *MinHeap) Min() int {
	return h.a[1]
}

func (h *MinHeap) ArgMin() int {
	return h.vmap[1]
}

func (h *MinHeap) Size() int {
	return h.pos - 1
}

func (h *MinHeap) up(cur int) {
	for c, p := cur, cur>>1; p >= 1 && h.a[p] > h.a[c]; c, p = c>>1, p>>1 {
		h.a[p], h.a[c] = h.a[c], h.a[p]
		h.imap[h.vmap[p]], h.imap[h.vmap[c]] = h.imap[h.vmap[c]], h.imap[h.vmap[p]]
		h.vmap[p], h.vmap[c] = h.vmap[c], h.vmap[p]
	}
}

func (h *MinHeap) down(cur int) {
	for c := cur; 2*c < h.pos; {
		b := 0
		if h.a[2*c] < h.a[2*c+1] {
			b = 2 * c
		} else {
			b = 2*c + 1
		}
		if h.a[b] < h.a[c] {
			h.a[c], h.a[b] = h.a[b], h.a[c]
			h.imap[h.vmap[c]], h.imap[h.vmap[b]] = h.imap[h.vmap[b]], h.imap[h.vmap[c]]
			h.vmap[c], h.vmap[b] = h.vmap[b], h.vmap[c]
			c = b
		} else {
			break
		}
	}
}
func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// IO

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

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

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

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

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

package main

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

var res []int

func solve() {
	n := readInt()
	g := make([][]int, n)
	for i := 0; i < n; i++ {
		g[i] = make([]int, 0)
	}
	res = make([]int, n)
	for i := 0; i < n-1; i++ {
		x := readInt() - 1
		y := readInt() - 1
		g[y] = append(g[y], x)
		g[x] = append(g[x], y)
	}
	colors := make([]bool, n)
	q := make([]int, 1)
	time := make([]int, 1)
	q[0] = 0
	time[0] = 1
	for i := 0; i < len(q); i++ {
		c := q[i]
		curTime := time[i]
		for j := len(time) - 1; j >= 0; j-- {
			if curTime-time[j] >= 3 {
				cl := res[q[j]] - 1
				if !colors[cl] {
					break
				}
				colors[cl] = false
			}
		}
		for i := 0; i < len(colors); i++ {
			if !colors[i] {
				res[c] = i + 1
				colors[i] = true
				break
			}
		}
		for i := 0; i < len(g[c]); i++ {
			next := g[c][i]
			if res[next] == 0 {
				q = append(q, next)
				time = append(time, curTime+1)
			}
		}
	}
	max := 0
	for i := 0; i < len(res); i++ {
		if max < res[i] {
			max = res[i]
		}
	}
	var buffer bytes.Buffer
	for i := 0; i < len(res); i++ {
		if i > 0 {
			buffer.WriteString(" ")
		}
		buffer.WriteString(strconv.Itoa(res[i]))
	}
	fmt.Println(max)
	fmt.Println(buffer.String())
}

var scanner *bufio.Scanner

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

// IO

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

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

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

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

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

package main

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

var res []int

func solve() {
	n := readInt()
	g := make([][]int, n)
	for i := 0; i < n; i++ {
		g[i] = make([]int, 0)
	}
	res = make([]int, n)
	for i := 0; i < n-1; i++ {
		x := readInt() - 1
		y := readInt() - 1
		g[y] = append(g[y], x)
		g[x] = append(g[x], y)
	}
	colors := make([]int, n)
	q := make([]int, 1)
	time := make([]int, 1)
	q[0] = 0
	time[0] = 1
	for i := 0; i < n; i++ {
		colors[i] = -100
	}
	for i := 0; i < len(q); i++ {
		c := q[i]
		curTime := time[i]
		for j := 0; j < len(colors); j++ {
			if colors[j]+3 <= curTime {
				res[c] = j + 1
				colors[j] = curTime
				break
			}
		}
		for j := 0; j < len(g[c]); j++ {
			next := g[c][j]
			if res[next] == 0 {
				q = append(q, next)
				time = append(time, curTime+1)
			}
		}
	}
	max := 0
	for i := 0; i < len(res); i++ {
		if max < res[i] {
			max = res[i]
		}
	}
	var buffer bytes.Buffer
	for i := 0; i < len(res); i++ {
		if i > 0 {
			buffer.WriteString(" ")
		}
		buffer.WriteString(strconv.Itoa(res[i]))
	}
	fmt.Println(max)
	fmt.Println(buffer.String())
}

var scanner *bufio.Scanner

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

// IO

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

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

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

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

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

package main

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

var res []int

func solve() {
	n := readInt()
	g := make([][]int, n)
	for i := 0; i < n; i++ {
		g[i] = make([]int, 0)
	}
	res = make([]int, n)
	for i := 0; i < n-1; i++ {
		x := readInt() - 1
		y := readInt() - 1
		g[y] = append(g[y], x)
		g[x] = append(g[x], y)
	}
	colors := make([]int, n)
	q := make([]int, 1)
	time := make([]int, 1)
	q[0] = 0
	time[0] = 1
	for i := 0; i < n; i++ {
		colors[i] = -100
	}
	for i := 0; i < len(q); i++ {
		c := q[i]
		curTime := time[i]
		for i := 0; i < len(colors); i++ {
			if colors[i]+3 <= curTime {
				res[c] = i + 1
				colors[i] = curTime
				break
			}
		}
		for i := 0; i < len(g[c]); i++ {
			next := g[c][i]
			if res[next] == 0 {
				q = append(q, next)
				time = append(time, curTime+1)
			}
		}
	}
	max := 0
	for i := 0; i < len(res); i++ {
		if max < res[i] {
			max = res[i]
		}
	}
	var buffer bytes.Buffer
	for i := 0; i < len(res); i++ {
		if i > 0 {
			buffer.WriteString(" ")
		}
		buffer.WriteString(strconv.Itoa(res[i]))
	}
	fmt.Println(max)
	fmt.Println(buffer.String())
}

var scanner *bufio.Scanner

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

// IO

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

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

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

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

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

package main

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

var res []int

func solve() {
	n := readInt()
	g := make([][]int, n)
	for i := 0; i < n; i++ {
		g[i] = make([]int, 0)
	}
	res = make([]int, n)
	for i := 0; i < n-1; i++ {
		x := readInt() - 1
		y := readInt() - 1
		g[y] = append(g[y], x)
		g[x] = append(g[x], y)
	}
	q := make([]int, 1)
	time := make([]int, 1)
	q[0] = 0
	time[0] = 1
	heap := NewMinHeap(n + 1)
	nextColor := 1
	for i := 0; i < len(q); i++ {
		curIndex := q[i]
		curTime := time[i]
		if heap.Size() == 0 || curTime < heap.Min() {
			heap.Add(nextColor, curTime)
			nextColor++
		}
		color := heap.ArgMin()
		res[curIndex] = color
		heap.Update(color, curTime+3)
		for j := 0; j < len(g[curIndex]); j++ {
			next := g[curIndex][j]
			if res[next] == 0 {
				q = append(q, next)
				time = append(time, curTime+1)
			}
		}
	}
	var buffer bytes.Buffer
	for i := 0; i < len(res); i++ {
		if i > 0 {
			buffer.WriteString(" ")
		}
		buffer.WriteString(strconv.Itoa(res[i]))
	}
	fmt.Println(nextColor - 1)
	fmt.Println(buffer.String())
}

var scanner *bufio.Scanner

type MinHeap struct {
	a    []int
	vmap []int
	imap []int
	n    int
	pos  int
}

const INF = math.MaxInt32

func NewMinHeap(m int) *MinHeap {
	heap := &MinHeap{}
	m += 2
	heap.n = m
	heap.a = make([]int, heap.n)
	heap.vmap = make([]int, heap.n)
	heap.imap = make([]int, heap.n)
	heap.pos = 1
	for i := 0; i < heap.n; i++ {
		heap.a[i] = INF
		heap.vmap[i] = -1
		heap.imap[i] = -1
	}
	return heap
}

func (h *MinHeap) Add(ind, x int) int {
	ret := h.imap[ind]
	if h.imap[ind] < 0 {
		h.a[h.pos] = x
		h.vmap[h.pos] = ind
		h.imap[ind] = h.pos
		h.pos++
		h.up(h.pos - 1)
	}
	if ret != -1 {
		return h.a[ret]
	}
	return x
}

func (h *MinHeap) Update(ind, x int) int {
	ret := h.imap[ind]
	if h.imap[ind] < 0 {
		h.a[h.pos] = x
		h.vmap[h.pos] = ind
		h.imap[ind] = h.pos
		h.pos++
		h.up(h.pos - 1)
	} else {
		h.a[ret] = x
		h.up(ret)
		h.down(ret)
	}
	return x
}

func (h *MinHeap) Remove(ind int) int {
	if h.pos == 1 {
		return INF
	}
	if h.imap[ind] == -1 {
		return INF
	}

	h.pos--
	rem := h.imap[ind]
	ret := h.a[rem]
	h.vmap[rem] = h.vmap[h.pos]
	h.imap[h.vmap[h.pos]] = rem
	h.imap[ind] = -1
	h.a[rem] = h.a[h.pos]
	h.a[h.pos] = INF
	h.vmap[h.pos] = -1

	h.up(rem)
	h.down(rem)
	return ret
}

func (h *MinHeap) Min() int {
	return h.a[1]
}

func (h *MinHeap) ArgMin() int {
	return h.vmap[1]
}

func (h *MinHeap) Size() int {
	return h.pos - 1
}

func (h *MinHeap) up(cur int) {
	for c, p := cur, cur>>1; p >= 1 && h.a[p] > h.a[c]; c, p = c>>1, p>>1 {
		h.a[p], h.a[c] = h.a[c], h.a[p]
		h.imap[h.vmap[p]], h.imap[h.vmap[c]] = h.imap[h.vmap[c]], h.imap[h.vmap[p]]
		h.vmap[p], h.vmap[c] = h.vmap[c], h.vmap[p]
	}
}

func (h *MinHeap) down(cur int) {
	for c := cur; 2*c < h.pos; {
		b := 0
		if h.a[2*c] < h.a[2*c+1] {
			b = 2 * c
		} else {
			b = 2*c + 1
		}
		if h.a[b] < h.a[c] {
			h.a[c], h.a[b] = h.a[b], h.a[c]
			h.imap[h.vmap[c]], h.imap[h.vmap[b]] = h.imap[h.vmap[b]], h.imap[h.vmap[c]]
			h.vmap[c], h.vmap[b] = h.vmap[b], h.vmap[c]
			c = b
		} else {
			break
		}
	}
}
func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// IO

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

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

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

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}

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

package main

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

var scanner = bufio.NewScanner(os.Stdin)

const (
	//MaxScanTokenSize = 64 * 1024 // package default
	MaxScanTokenSize = 8 * 1024 * 1024 // 8M
)

func init() {
	scanner.Buffer(make([]byte, 0, MaxScanTokenSize), MaxScanTokenSize)
	scanner.Split(bufio.ScanWords)
}

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

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

type Edge struct {
	From int
	To   int
	Cap  int
	Flow int
}

type Graph struct {
	NNode  int
	NEdge  int
	Edges  []Edge
	Nodes  [][]int

	Colors []int
}

func NewGraph(nNode, nEdge int) *Graph {
	g := &Graph{
		NNode: nNode,
		NEdge: nEdge,
		Edges: make([]Edge, 0, nEdge),
		Nodes: make([][]int, nNode, nNode),

		Colors: make([]int, nNode, nNode),
	}
	return g
}

func (g *Graph) AddEdge(from, to, cap, flow int) {
	g.Nodes[from] = append(g.Nodes[from], len(g.Edges))
	g.Edges = append(g.Edges, Edge{from, to, cap, flow})
	g.Nodes[to] = append(g.Nodes[to], len(g.Edges))
	g.Edges = append(g.Edges, Edge{to, from, cap, flow})
}

func (g *Graph) Show() {
	fmt.Printf("n node = %d, n edge = %d\n", g.NNode, g.NEdge)
	for i, cur := range g.Nodes {
		fmt.Printf("[%d]", i)
		for _, next := range cur {
			fmt.Printf(" %d", g.Edges[next].To)
		}
		fmt.Println()
	}
}

func paint(g *Graph, pre, cur int) {
	color := 1
	for _, ie := range g.Nodes[cur] {
		next := g.Edges[ie].To
		if pre == next {
			continue
		}
		if pre != -1 && color == g.Colors[pre] {
			color++
		}
		if color == g.Colors[cur] {
			color++
		}
		g.Colors[next] = color
		color++

		if pre != next {
			paint(g, cur, next)
		}
	}
}

func main() {
	n := readInt()
	g := NewGraph(n, n - 1)

	for i := 1; i < n; i++ {
		from, to := readInt(), readInt()
		g.AddEdge(from - 1, to - 1, 0, 0)
	}
	//g.Show()

	g.Colors[0] = 1
	paint(g, -1, 0)

	maxColor := 0
	for _, color := range g.Colors {
		if color > maxColor {
			maxColor = color
		}
	}
	fmt.Println(maxColor)
	for i := 0; i < n; i++ {
		fmt.Printf("%d ", g.Colors[i])
	}
	fmt.Println("")
}

package main

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

type Edge struct {
	From int
	To int
	Cap int
	Flow int
}

type Graph struct {
	NNode int
	NEdge int
	Edges []Edge
	Nodes [][]int

	Visited []bool
	Colors []int
}

func NewGraph(nNode, nEdge int) *Graph {
	g := &Graph{
		NNode: nNode,
		NEdge: nEdge,
		Edges: make([]Edge, 0, nEdge),
		Nodes: make([][]int, nNode, nNode),

		Visited: make([]bool, nNode, nNode),
		Colors: make([]int, nNode, nNode),
	}
	return g
}

func (g *Graph) AddEdge(from, to, cap, flow int) {
	g.Nodes[from] = append(g.Nodes[from], len(g.Edges))
	g.Edges = append(g.Edges, Edge{from, to, cap, flow})
	g.Nodes[to] = append(g.Nodes[to], len(g.Edges))
	g.Edges = append(g.Edges, Edge{to, from, cap, flow})
}

func (g *Graph) Show() {
	fmt.Printf("n node = %d, n edge = %d\n", g.NNode, g.NEdge)
	for i, cur := range g.Nodes {
		fmt.Printf("[%d]", i)
		for _, next := range cur {
			fmt.Printf(" %d", g.Edges[next].To)
		}
		fmt.Println()
	}
}

func paint(g *Graph, pre, cur int) {
	color := 1
	g.Visited[cur] = true
	for _, ie := range g.Nodes[cur] {
		next := g.Edges[ie].To
		if g.Visited[next] {
			continue
		}
		if pre != -1 && color == g.Colors[pre] {
			color++
		}
		if color == g.Colors[cur] {
			color++
		}
		g.Colors[next] = color
		color++
	}

	for _, ie := range g.Nodes[cur] {
		next := g.Edges[ie].To
		if !g.Visited[next] {
			paint(g, cur, next)
		}
	}
}

func main() {
	n := readInt()
	g := NewGraph(n, n - 1)

	for i := 1; i < n; i++ {
		from, to := readInt(), readInt()
		g.AddEdge(from - 1, to - 1, 0, 0)
	}
	//g.Show()

	g.Colors[0] = 1
	paint(g, -1, 0)

	maxColor := 0
	for _, color := range g.Colors {
		if color > maxColor {
			maxColor = color
		}
	}
	fmt.Println(maxColor)
	for i := 0; i < n; i++ {
		fmt.Printf("%d ", g.Colors[i])
	}
	fmt.Println("")
}

var scanner = bufio.NewScanner(os.Stdin)

const (
	//MaxScanTokenSize = 64 * 1024 // package default
	MaxScanTokenSize = 8 * 1024 * 1024 // 8M
)

func init() {
	scanner.Buffer(make([]byte, 0, MaxScanTokenSize), MaxScanTokenSize)
	scanner.Split(bufio.ScanWords)
}

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

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

package main

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

var scanner = bufio.NewScanner(os.Stdin)

const (
	//MaxScanTokenSize = 64 * 1024 // package default
	MaxScanTokenSize = 8 * 1024 * 1024 // 8M
)

func init() {
	scanner.Buffer(make([]byte, 0, MaxScanTokenSize), MaxScanTokenSize)
	scanner.Split(bufio.ScanWords)
}

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

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

type Edge struct {
	From int
	To   int
	Cap  int
	Flow int
}

type Graph struct {
	NNode  int
	NEdge  int
	Edges  []Edge
	Nodes  [][]int

	Colors []int
}

func NewGraph(nNode, nEdge int) *Graph {
	g := &Graph{
		NNode: nNode,
		NEdge: nEdge,
		Edges: make([]Edge, 0, nEdge),
		Nodes: make([][]int, nNode, nNode),

		Colors: make([]int, nNode, nNode),
	}
	return g
}

func (g *Graph) AddEdge(from, to, cap, flow int) {
	g.Nodes[from] = append(g.Nodes[from], len(g.Edges))
	g.Edges = append(g.Edges, Edge{from, to, cap, flow})
	g.Nodes[to] = append(g.Nodes[to], len(g.Edges))
	g.Edges = append(g.Edges, Edge{to, from, cap, flow})
}

func (g *Graph) Show() {
	fmt.Printf("n node = %d, n edge = %d\n", g.NNode, g.NEdge)
	for i, cur := range g.Nodes {
		fmt.Printf("[%d]", i)
		for _, next := range cur {
			fmt.Printf(" %d", g.Edges[next].To)
		}
		fmt.Println()
	}
}

func paint(g *Graph, pre, cur int) {
	color := 1
	for _, ie := range g.Nodes[cur] {
		next := g.Edges[ie].To
		if pre == next {
			continue
		}
		for (pre != -1 && color == g.Colors[pre]) || (color == g.Colors[cur]) {
			color++
		}
		g.Colors[next] = color
		color++

		if pre != next {
			paint(g, cur, next)
		}
	}
}

func main() {
	n := readInt()
	g := NewGraph(n, n - 1)

	for i := 1; i < n; i++ {
		from, to := readInt(), readInt()
		g.AddEdge(from - 1, to - 1, 0, 0)
	}
	//g.Show()

	g.Colors[0] = 1
	paint(g, -1, 0)

	maxColor := 0
	for _, color := range g.Colors {
		if color > maxColor {
			maxColor = color
		}
	}

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

	fmt.Fprintln(w, maxColor)
	for i := 0; i < n; i++ {
		fmt.Fprintf(w, "%d ", g.Colors[i])
	}
	fmt.Fprintln(w)
}