import sys
#sys.stdin = open("input.txt")

t = int(input())
for i in range (t):
    n = int(input())
    p = []

    for k in range (n):
        x,y,s,a,d,b = map(int,input().split())  #LETTURA
        p.append([x,y,s,a,d,b])
    X = p[0][0]
    Y = p[0][1]
    S = p[0][2]
    A = p[0][3]
    D = p[0][4]
    B = p[0][5]
    if (n == 1):                                #CASO PARTICOLARE
        if (p[0][5] == 1 and p[0][2] == 1 ):
            X = -100000
            Y = -100000
        else:
            X = p[0][0]
            Y = p[0][1]
        print(1,X,Y)

    else:
        verdetto = True                         #CONTROLLO
        for k in range (n-1):
            for z in range (k+1,n):
                if ( p[k][0] > p[z][0]):
                    if (p[z][4] == 0 and p[k][2] == 0):
                        verdetto = False
                if (p[k][0] < p[z][0]):
                    if (p[k][4] == 0 and p[z][2] == 0):
                        verdetto = False
                if (p[k][1] > p[z][1]):
                    if (p[z][3] == 0 and p[k][5] == 0):
                        verdetto = False
                if (p[k][1] < p[z][1]):
                    if (p[k][3] == 0 and p[z][5] == 0):
                        verdetto = False

        if verdetto == True:                    #CALCOLO
            for k in range (1,n):
                #print(X,Y)
                if (X != p[k][0]):
                    if ( X < p[k][0]):
                        if (p[k][2] == 1):
                            X = X
                        else:
                            S = 0
                            if (D == 1):
                                X = p[k][0]
                    else:
                        if (p[k][4] == 1):
                            X = X
                        else:
                            D = 0
                            if (S == 1):
                                X = p[k][0]
                else:
                    X = p[k][0]

                if (Y != p[k][1]):
                    if (Y < p[k][1]):
                        if (p[k][5] == 1):
                            Y = Y
                        else:
                            B = 0
                            if (A == 1):
                                Y = p[k][1]
                    else:
                        if (p[k][3] == 1):
                            Y = Y
                        else:
                            A = 0
                            if (B == 1):
                                Y = p[k][1]
                else:
                    Y = p[k][1]

            print(1,X,Y)
        else:
            print(0)
        #print("____________")


#import sys
#sys.stdin=open("input.txt")
T=int(input())
for t in range (T):
    N=int(input())
    x=-100000
    X=100000
    y=-100000
    Y=100000
    for n in range (N):
        L= list(map(int,input().split()))
        if L[2]==0:
            x=max(x,L[0])
        if L[4]==0:
            X=min(X,L[0])
        if L[3]==0:
            Y=min(Y,L[1])
        if L[5]==0:
            y=max(y,L[1])
    if x>X or y>Y:
        print(0)
    else:
        a=(X+x)//2
        b=(Y+y)//2
        print (1,a,b)


for _ in range(int(input())):
	n=int(input())
	xt=10**5
	xb=-10**5
	yt=10**5
	yb=-10**5
	possible=1
	for i in range(n):
		x,y,f1,f2,f3,f4=map(int,input().split())
		if f1==0:#x left
			if xt<x:
				possible=0
			xb=max(xb,x)
		if f2==0:
			if yb>y:
				possible=0
			yt=min(yt,y)
		if f3==0:
			if xb>x:
				possible=0
			xt=min(x,xt)
		if f4==0:
			if yt<y:
				possible=0
			yb=max(yb,y)
		print(xt,xb,yt,yb)
	if possible==0:
		print(0)
	else:
		print(1,xb,yb)


for _ in range(int(input())):
	n=int(input())
	robots=[]
	xt=10**5
	xb=-10**5
	yt=10**5
	yb=-10**5
	possible=1
	for i in range(n):
		x,y,f1,f2,f3,f4=map(int,input().split())
		if f1==0:
			if xt<x:
				possible=0
			xb=x
		if f2==0:
			if yb>y:
				possible=0
			yt=y
		if f3==0:
			if xb>x:
				possible=0
			xt=x
		if f4==0:
			if yt<y:
				possible=0
			yb=y
	if possible==0:
		print(0)
	else:
		print(1,xb,yb)


for _ in range(int(input())):
	n=int(input())
	xt=10**5
	xb=-10**5
	yt=10**5
	yb=-10**5
	possible=1
	for i in range(n):
		x,y,f1,f2,f3,f4=map(int,input().split())
		if f1==0:#x left
			if xt<x:
				possible=0
			xb=max(xb,x)
		if f2==0:
			if yb>y:
				possible=0
			yt=min(yt,y)
		if f3==0:
			if xb>x:
				possible=0
			xt=min(x,xt)
		if f4==0:
			if yt<y:
				possible=0
			yb=max(yb,y)
	if possible==0:
		print(0)
	else:
		print(1,xb,yb)


def intersect(rec1, rec2):
    if rec1[0] > rec2[1] or rec2[0] > rec1[1]or rec1[2] < rec2[3] or rec2[2] < rec1[3]:
        return False
    else:
        #Find intersection
        xs = [rec1[0], rec1[1], rec2[0], rec2[1]]
        xs = sorted(xs)
        x1 = xs[1]
        x2 = xs[2]

        ys = [rec1[2], rec1[3], rec2[2], rec2[3]]
        ys = sorted(ys)
        y1 = ys[2]
        y2 = ys[1]
    return (x1, x2, y1, y2)
if __name__ == "__main__":
    q = int(input())
    inf = float("inf")
    minf = float("-inf")
    for _ in range(q):
        N = int(input())
        recs = [[0 for i in range(4)] for i in range(N)]
        ok = True
        for i in range(N):
            s = list(map(int, input().rstrip().split()))
            x0 = s[0]
            y0 = s[1]
            if (i == 0):
                rec = [minf, inf, inf, minf]
            _sum = s[2] + s[3] + s[4] + s[5]
            if _sum == 0:
                if rec[0] <= x0 and x0 <= rec[1] and rec[3] <= y0 and y0 <= rec[2]:
                    rec = [x0, x0, y0, y0]
                    continue
                else:
                    print(0)
                    ok = False
                    break
            elif _sum == 1:
                if s[2] == 1:
                    nrec = [minf, x0, y0, y0]
                elif s[3] == 1:
                    nrec = [x0, x0, inf, y0]
                elif s[4] == 1:
                    nrec = [x0, inf, y0, y0]
                elif s[5] == 1:
                    nrec = [x0, x0, y0, minf]
            elif _sum == 2:
                if s[2] == 1 and s[3] == 1:
                    nrec = [minf, x0, inf, y0]
                elif s[2] == 1 and s[4] == 1:
                    nrec = [minf, inf, y0, y0]
                elif s[2] == 1 and s[5] == 1:
                    nrec = [minf, x0, y0, minf]
                elif s[3] == 1 and s[4] == 1:
                    nrec = [x0, inf, inf, y0]
                elif s[3] == 1 and s[5] == 1:
                    nrec = [x0, x0, inf, minf]
                elif s[4] == 1 and s[5] == 1:
                    nrec = [x0, inf, y0, minf]
            elif _sum == 3:
                if s[2] == 0:
                    nrec = [x0, inf, inf, minf]
                elif s[3] == 0:
                    nrec = [minf, inf, y0, minf]
                elif s[4] == 0:
                    nrec = [minf, x0, inf, minf]
                elif s[5] == 0:
                    nrec = [minf, inf, inf, y0]
            else:
                continue
            rec = intersect(rec, nrec)
            if (not rec):
                print(0)
                ok = False
                break
        #print(rec)
        if not ok:
            continue
        if rec[0] == float("-inf"):
            rec[0] = -100000
        elif rec[0] == float("inf"):
            rec[0] = 1000000
        if rec[3] == float("-inf"):
            rec[3] = -100000
        elif rec[3] == float("inf"):
            rec[3] = 1000000
        print("1 " + str(rec[0]) + " " + str(rec[3]))


if __name__ == "__main__":
    q = int(input())

    for _ in range(q):
        ss = list(map(int, input().rstrip().split()))
        N = ss[0]
        K = ss[1]
        a = list(map(int, input().rstrip().split()))
        nodd = 0
        s = sum(a)
        lst = [0 for i in range(N)]
        cnt = 0
        for i in range(N):
            if a[i] % 2 != 0:
                nodd += 1
                lst[cnt] = i
                cnt += 1
        if nodd < K or (K % 2 == 1 and s % 2 == 0 or K % 2 == 0 and s % 2 == 1):
            print("NO")
        else:
            print("YES")
            for i in range(K - 1):
                print(lst[i] + 1, end = " ")
            print(N)


def intersect(rec1, rec2):
    if rec1[0] > rec2[1] or rec2[0] > rec1[1]or rec1[2] < rec2[3] or rec2[2] < rec1[3]:
        return False
    else:
        #Find intersection
        xs = [rec1[0], rec1[1], rec2[0], rec2[1]]
        xs = sorted(xs)
        x1 = xs[1]
        x2 = xs[2]

        ys = [rec1[2], rec1[3], rec2[2], rec2[3]]
        ys = sorted(ys)
        y1 = ys[2]
        y2 = ys[1]
    return (x1, x2, y1, y2)
if __name__ == "__main__":
    q = int(input())
    inf = float("inf")
    minf = float("-inf")
    for _ in range(q):
        N = int(input())
        recs = [[0 for i in range(4)] for i in range(N)]
        ok = True
        for i in range(N):
            s = list(map(int, input().rstrip().split()))
            x0 = s[0]
            y0 = s[1]
            if (i == 0):
                rec = [minf, inf, inf, minf]
            _sum = s[2] + s[3] + s[4] + s[5]
            if _sum == 0:
                if rec[0] <= x0 and x0 <= rec[1] and rec[3] <= y0 and y0 <= rec[2]:
                    rec = [x0, x0, y0, y0]
                    continue
                else:
                    print(0)
                    ok = False
                    break
            elif _sum == 1:
                if s[2] == 1:
                    nrec = [minf, x0, y0, y0]
                elif s[3] == 1:
                    nrec = [x0, x0, inf, y0]
                elif s[4] == 1:
                    nrec = [x0, inf, y0, y0]
                elif s[5] == 1:
                    nrec = [x0, x0, y0, minf]
            elif _sum == 2:
                if s[2] == 1 and s[3] == 1:
                    nrec = [minf, x0, inf, y0]
                elif s[2] == 1 and s[4] == 1:
                    nrec = [minf, inf, y0, y0]
                elif s[2] == 1 and s[5] == 1:
                    nrec = [minf, x0, y0, minf]
                elif s[3] == 1 and s[4] == 1:
                    nrec = [x0, inf, inf, y0]
                elif s[3] == 1 and s[5] == 1:
                    nrec = [x0, x0, inf, minf]
                elif s[4] == 1 and s[5] == 1:
                    nrec = [x0, inf, y0, minf]
            elif _sum == 3:
                if s[2] == 0:
                    nrec = [x0, inf, inf, minf]
                elif s[3] == 0:
                    nrec = [minf, inf, y0, minf]
                elif s[4] == 0:
                    nrec = [minf, x0, inf, minf]
                elif s[5] == 0:
                    nrec = [minf, inf, inf, y0]
            else:
                continue
            rec = intersect(rec, nrec)
            if (not rec):
                print(0)
                ok = False
                break
        #print(rec)
        if not ok:
            continue
        if rec[0] == float("-inf"):
            rec[0] = -100000
        elif rec[0] == float("inf"):
            rec[0] = 1000000
        if rec[2] == float("-inf"):
            rec[2] = -100000
        elif rec[2] == float("inf"):
            rec[2] = 1000000
        print("1 " + str(rec[0]) + " " + str(rec[2]))


def intersect(rec1, rec2):
    if rec1[0] > rec2[1] or rec2[0] > rec1[1]or rec1[2] < rec2[3] or rec2[2] < rec1[3]:
        return False
    else:
        #Find intersection
        xs = [rec1[0], rec1[1], rec2[0], rec2[1]]
        xs = sorted(xs)
        x1 = xs[1]
        x2 = xs[2]

        ys = [rec1[2], rec1[3], rec2[2], rec2[3]]
        ys = sorted(ys)
        y1 = ys[2]
        y2 = ys[1]
    return (x1, x2, y1, y2)
if __name__ == "__main__":
    q = int(input())
    inf = float("inf")
    minf = float("-inf")
    for _ in range(q):
        N = int(input())
        recs = [[0 for i in range(4)] for i in range(N)]
        ok = True
        for i in range(N):
            s = list(map(int, input().rstrip().split()))
            x0 = s[0]
            y0 = s[1]
            if (i == 0):
                rec = [minf, inf, inf, minf]
            _sum = s[2] + s[3] + s[4] + s[5]
            if _sum == 0:
                if rec[0] <= x0 and x0 <= rec[1] and rec[3] <= y0 and y0 <= rec[2]:
                    rec = [x0, x0, y0, y0]
                    continue
                else:
                    print(0)
                    ok = False
                    break
            elif _sum == 1:
                if s[2] == 1:
                    nrec = [minf, x0, y0, y0]
                elif s[3] == 1:
                    nrec = [x0, x0, inf, y0]
                elif s[4] == 1:
                    nrec = [x0, inf, y0, y0]
                elif s[5] == 1:
                    nrec = [x0, x0, y0, minf]
            elif _sum == 2:
                if s[2] == 1 and s[3] == 1:
                    nrec = [minf, x0, inf, y0]
                elif s[2] == 1 and s[4] == 1:
                    nrec = [minf, inf, y0, y0]
                elif s[2] == 1 and s[5] == 1:
                    nrec = [minf, x0, y0, minf]
                elif s[3] == 1 and s[4] == 1:
                    nrec = [x0, inf, inf, y0]
                elif s[3] == 1 and s[5] == 1:
                    nrec = [x0, x0, inf, minf]
                elif s[4] == 1 and s[5] == 1:
                    nrec = [x0, inf, y0, minf]
            elif _sum == 3:
                if s[2] == 0:
                    nrec = [x0, inf, inf, minf]
                elif s[3] == 0:
                    nrec = [minf, inf, y0, minf]
                elif s[4] == 0:
                    nrec = [minf, x0, inf, minf]
                elif s[5] == 0:
                    nrec = [minf, inf, inf, y0]
            else:
                continue
            rec = intersect(rec, nrec)
            if (not rec):
                print(0)
                ok = False
                break
        #print(rec)
        if not ok:
            continue
        if rec[0] == float("-inf"):
            rec[0] = -100000
        elif rec[0] == float("inf"):
            rec[0] = 1000000
        if rec[2] == float("-inf"):
            rec[2] = -100000
        elif rec[2] == float("inf"):
            rec[2] = 1000000
        print("1 " + str(rec[0]) + " " + str(rec[3]))


def intersect(rec1, rec2):
    if rec1[0] > rec2[1] or rec2[0] > rec1[1]or rec1[2] < rec2[3] or rec2[2] < rec1[3]:
        return False
    else:
        #Find intersection
        xs = [rec1[0], rec1[1], rec2[0], rec2[1]]
        xs = sorted(xs)
        x1 = xs[1]
        x2 = xs[2]

        ys = [rec1[2], rec1[3], rec2[2], rec2[3]]
        ys = sorted(ys)
        y1 = ys[2]
        y2 = ys[1]
    return [x1, x2, y1, y2]
if __name__ == "__main__":
    q = int(input())
    inf = float("inf")
    minf = float("-inf")
    for _ in range(q):
        N = int(input())
        #recs = [[0 for i in range(4)] for i in range(N)]
        ok = True
        ss = []
        for i in range(N):
            ss.append(list(map(int, input().rstrip().split())))
        rec = [minf, inf, inf, minf]
        for s in ss:
            x0 = s[0]
            y0 = s[1]
            _sum = s[2] + s[3] + s[4] + s[5]
            if _sum == 0:
                if rec[0] <= x0 and x0 <= rec[1] and rec[3] <= y0 and y0 <= rec[2]:
                    rec = [x0, x0, y0, y0]
                    continue
                else:
                    print(0)
                    ok = False
                    break
            elif _sum == 1:
                if s[2] == 1:
                    nrec = [minf, x0, y0, y0]
                elif s[3] == 1:
                    nrec = [x0, x0, inf, y0]
                elif s[4] == 1:
                    nrec = [x0, inf, y0, y0]
                elif s[5] == 1:
                    nrec = [x0, x0, y0, minf]
            elif _sum == 2:
                if s[2] == 1 and s[3] == 1:
                    nrec = [minf, x0, inf, y0]
                elif s[2] == 1 and s[4] == 1:
                    nrec = [minf, inf, y0, y0]
                elif s[2] == 1 and s[5] == 1:
                    nrec = [minf, x0, y0, minf]
                elif s[3] == 1 and s[4] == 1:
                    nrec = [x0, inf, inf, y0]
                elif s[3] == 1 and s[5] == 1:
                    nrec = [x0, x0, inf, minf]
                elif s[4] == 1 and s[5] == 1:
                    nrec = [x0, inf, y0, minf]
            elif _sum == 3:
                if s[2] == 0:
                    nrec = [x0, inf, inf, minf]
                elif s[3] == 0:
                    nrec = [minf, inf, y0, minf]
                elif s[4] == 0:
                    nrec = [minf, x0, inf, minf]
                elif s[5] == 0:
                    nrec = [minf, inf, inf, y0]
            else:
                continue
            rec = intersect(rec, nrec)
            if (not rec):
                print(0)
                ok = False
                break
        #print(rec)
        if not ok:
            continue
        if rec[0] == float("-inf"):
            rec[0] = -100000
        elif rec[0] == float("inf"):
            rec[0] = 1000000
        if rec[3] == float("-inf"):
            rec[3] = -100000
        elif rec[3] == float("inf"):
            rec[3] = 1000000
        print("1 " + str(rec[0]) + " " + str(rec[3]))


def intersect(rec1, rec2):
    if rec1[0] > rec2[1] or rec2[0] > rec1[1]or rec1[2] < rec2[3] or rec2[2] < rec1[3]:
        return False
    else:
        #Find intersection
        xs = [rec1[0], rec1[1], rec2[0], rec2[1]]
        xs = sorted(xs)
        x1 = xs[1]
        x2 = xs[2]

        ys = [rec1[2], rec1[3], rec2[2], rec2[3]]
        ys = sorted(ys)
        y1 = ys[2]
        y2 = ys[1]
    return (x1, x2, y1, y2)
if __name__ == "__main__":
    q = int(input())
    inf = float("inf")
    minf = float("-inf")
    for _ in range(q):
        N = int(input())
        recs = [[0 for i in range(4)] for i in range(N)]
        ok = True
        ss = []
        for i in range(N):
            ss.append(list(map(int, input().rstrip().split())))
        rec = [minf, inf, inf, minf]
        for s in ss:
            x0 = s[0]
            y0 = s[1]
            _sum = s[2] + s[3] + s[4] + s[5]
            if _sum == 0:
                if rec[0] <= x0 and x0 <= rec[1] and rec[3] <= y0 and y0 <= rec[2]:
                    rec = [x0, x0, y0, y0]
                    continue
                else:
                    print(0)
                    ok = False
                    break
            elif _sum == 1:
                if s[2] == 1:
                    nrec = [minf, x0, y0, y0]
                elif s[3] == 1:
                    nrec = [x0, x0, inf, y0]
                elif s[4] == 1:
                    nrec = [x0, inf, y0, y0]
                elif s[5] == 1:
                    nrec = [x0, x0, y0, minf]
            elif _sum == 2:
                if s[2] == 1 and s[3] == 1:
                    nrec = [minf, x0, inf, y0]
                elif s[2] == 1 and s[4] == 1:
                    nrec = [minf, inf, y0, y0]
                elif s[2] == 1 and s[5] == 1:
                    nrec = [minf, x0, y0, minf]
                elif s[3] == 1 and s[4] == 1:
                    nrec = [x0, inf, inf, y0]
                elif s[3] == 1 and s[5] == 1:
                    nrec = [x0, x0, inf, minf]
                elif s[4] == 1 and s[5] == 1:
                    nrec = [x0, inf, y0, minf]
            elif _sum == 3:
                if s[2] == 0:
                    nrec = [x0, inf, inf, minf]
                elif s[3] == 0:
                    nrec = [minf, inf, y0, minf]
                elif s[4] == 0:
                    nrec = [minf, x0, inf, minf]
                elif s[5] == 0:
                    nrec = [minf, inf, inf, y0]
            else:
                continue
            rec = intersect(rec, nrec)
            if (not rec):
                print(0)
                ok = False
                break
        #print(rec)
        if not ok:
            continue
        if rec[0] == float("-inf"):
            rec[0] = -100000
        elif rec[0] == float("inf"):
            rec[0] = 1000000
        if rec[3] == float("-inf"):
            rec[3] = -100000
        elif rec[3] == float("inf"):
            rec[3] = 1000000
        print("1 " + str(rec[0]) + " " + str(rec[3]))


q = int(input())

for _ in range(q):
	n = int(input())
	maxX = maxY = 10**5
	minX = minY = -(10**5)
	for i in range(n):
		x, y, *rest = map(int, input().split())
		if rest[0] == 0:
			minX = max(minX, x)
		if rest[1] == 0:
			maxY = min(maxY, y)
		if rest[2] == 0:
			maxX = min(maxX, x)
		if rest[3] == 0:
			minY = max(minY, y)
	if minX > maxX or minY > maxY:
		print(0)
	else:
		print(1, minX, minY)


n = int(input())
for i in range(n):
    a,b,c = map(int,input().split())
    print((a+b+c)//2)


import sys
for q in range(int(input())):
    mxx= 10**5
    mxy = 10 ** 5
    mnx = -10 ** 5
    mny = -10 ** 5

    for n in range(int(input())):
        x,y,f1,f2,f3,f4 = map(int, sys.stdin.readline().split())
        if f1==0: mnx = max(x,mnx)
        if f2==0: mxy = min(y,mxy)
        if f3==0: mxx = min(x,mxx)
        if f4==0: mny = max(y,mny)

    if mnx<=mxx and mny<=mxy:
        print(1,mnx,mny)
    else:
        print(0)


q = int(input())
for _ in range(q):
       n=int(input())
       minx=miny=-1*(10**5)
       maxx=maxy=(10**5)
       for _ in range(n):
              a=[int(i) for i in input().split()]
              if(a[2]==0)   minx=max(minx,a[0])
              if(a[3]==0)   maxy=min(maxy,a[1])
              if(a[4]==0)   maxx=min(maxx,f[0])
              if(a[5]==0)   miny=max(miny,f[1])
       if(minx<=maxx and miny<=maxy):print(1,maxx,maxy)
       else:print(0)


q = int(input())
for _ in range(q):
       n=int(input())
       minx=miny=-1*(10**5)
       maxx=maxy=(10**5)
       for _ in range(n):
              a=[int(i) for i in input().split()]
              if(a[2]==0)   minx=max(minx,a[2])
              if(a[3]==0)   maxy=min(maxy,a[3])
              if(a[4]==0)   maxx=min(maxx,f[4])
              if(a[5]==0)   miny=max(miny,f[5])
       if(minx<=maxx and miny<=maxy):print(1,maxx,maxy)
       else:print(0)


q = int(input())
for _ in range(q):
       n=int(input())
       b=c=-1*(10**5)
       d=e=(10**5)
       for _ in range(n):
              a=[int(i) for i in input().split()]
              if(a[2]==0)   b=max(b,a[0])
              if(a[3]==0)   e=min(e,a[1])
              if(a[4]==0)   d=min(d,f[0])
              if(a[5]==0)   c=max(c,f[1])
       if(b<=d and c<=e):print(1,d,e)
       else:print(0)


# x = [int(x) for x in input().split()]
q = int(input())

def solve():
	n = int(input())
	min_x, max_x, min_y, max_y = -1e6,1e6,-1e6,1e6

	for _ in range(n):
		x,y,f1,f2,f3,f4 = [int(x) for x in input().split()]

		if f1 == 0:
			min_x = max(min_x, x)
		if f2 == 0:
			max_y = min(max_y, y)
		if f3 == 0:
			max_x = min(max_x, x)
		if f4 == 0:
			min_y = max(min_y, y)

	if min_x > max_x or min_y > max_y:
		print(0)
	else:
		print(1, (min_x + max_x) // 2, (min_y + max_y) // 2)

for _ in range(q):
	solve()


# x = [int(x) for x in input().split()]
q = int(input())

def solve():
	n,k = [int(x) for x in input().split()]
	res = []
	for i,x in enumerate(input().split()):
		if x[-1] in '13579':
			res.append(i+1)

	if len(res) < k or ((len(res) - k) % 2 == 1):
		print('NO')
	else:
		print('YES')
		res = res[:k-1]
		res.append(n)
		print(' '.join(str(x) for x in res))

for _ in range(q):
	solve()


# x = [int(x) for x in input().split()]
q = int(input())

def solve():
	n = int(input())
	min_x, max_x, min_y, max_y = -1e5,1e5,-1e5,1e5

	for _ in range(n):
		x,y,f1,f2,f3,f4 = [int(x) for x in input().split()]

		if f1 == 0:
			min_x = max(min_x, x)
		if f2 == 0:
			max_y = min(max_y, y)
		if f3 == 0:
			max_x = min(max_x, x)
		if f4 == 0:
			min_y = max(min_y, y)

	if min_x > max_x or min_y > max_y:
		print(0)
	else:
		print(1, min_x, min_y)

for _ in range(q):
	solve()


# x = [int(x) for x in input().split()]
q = int(input())

def solve():
	n = int(input())
	min_x, max_x, min_y, max_y = -100000,100000,-100000,100000

	for _ in range(n):
		x,y,f1,f2,f3,f4 = [int(x) for x in input().split()]

		if f1 == 0:
			min_x = max(min_x, x)
		if f2 == 0:
			max_y = min(max_y, y)
		if f3 == 0:
			max_x = min(max_x, x)
		if f4 == 0:
			min_y = max(min_y, y)

	if min_x > max_x or min_y > max_y:
		print(0)
	else:
		print(1, min_x, min_y)

for _ in range(q):
	solve()


# x = [int(x) for x in input().split()]
q = int(input())

def solve():
	n = int(input())
	min_x, max_x, min_y, max_y = -10000,10000,-10000,10000

	for _ in range(n):
		x,y,f1,f2,f3,f4 = [int(x) for x in input().split()]

		if f1 == 0:
			min_x = max(min_x, x)
		if f2 == 0:
			max_y = min(max_y, y)
		if f3 == 0:
			max_x = min(max_x, x)
		if f4 == 0:
			min_y = max(min_y, y)

	if min_x > max_x or min_y > max_y:
		print(0)
	else:
		print(1, min_x, min_y)

for _ in range(q):
	solve()


# x = [int(x) for x in input().split()]
q = int(input())

def solve():
	n = int(input())
	min_x, max_x, min_y, max_y = -1e6,1e6,-1e6,1e6

	for _ in range(n):
		x,y,f1,f2,f3,f4 = [int(x) for x in input().split()]

		if f1 == 0:
			min_x = max(min_x, x)
		if f2 == 0:
			max_y = min(max_y, y)
		if f3 == 0:
			max_x = min(max_x, x)
		if f4 == 0:
			min_y = max(min_y, y)

	if min_x > max_x or min_y > max_y:
		print(0)
	else:
		print(1, int((min_x + max_x) // 2), int((min_y + max_y) // 2))

for _ in range(q):
	solve()


for _ in range(int(input())):
    n=int(input())
    ansx,ansy,left,up,right,down=map(int , input().split())
    c=0
    for i in range(n-1):
        x,y , left1 , up1 , right1 , down1 = map(int , input().split())
        if x==ansx:
            ansx=x
        elif x>ansx:
            if right==1:
                ansx=x
            elif left1==1:
                ansx=ansx
            else:
                c+=1
        else:
            if right1==1:
                ansx=ansx
            elif left==1:
                ansx=x
            else:
                c+=1
        if y==ansy:
            ansy=y
        elif y>ansy:
            if up==1:
                ansy=y
            elif down1==1:
                ansy=ansy
            else:
                c+=1
        else:
            if down==1:
                ansy=y
            elif up1==1:
                ansy=ansy
            else:
                c+=1
        left , up , right , down=left1,up1,right1,down1

    if c==0:
        print(1,ansx,ansy)
    else:
        print(0)


for _ in range(int(input())):
    n = int(input())
    l = d = - 10 ** 5
    r = t = 10 ** 5
    for i in range(n):
        x, y, f1, f2, f3, f4 = map(int, input().split())
        if f1 == 0:
            l = max(l, x)
        if f2 == 0:
            t = min(t, y)
        if f3 == 0:
            r = min(r, x)
        if f4 == 0:
            d = max(d, y)
    if l <= r and d <= t:
        print(1, l, d)
    else:
        print(0)


q = int(input())
for i in range(q):
    x = []
    y = []
    f = []
    n = int(input())
    for i in range(n):
        xi, yi, fi = input().split(' ', 2)
        xi, yi = int(xi), int(yi)
        fi = list(map(int,fi.split()))
        x.append(xi)
        y.append(yi)
        f.append(fi)

    no_left = [x[i] for i in range(n) if f[i][0]==0]
    no_up = [y[i] for i in range(n) if f[i][1]==0]
    no_right = [x[i] for i in range(n) if f[i][2]==0]
    no_down = [y[i] for i in range(n) if f[i][3]==0]

    if len(no_left)==0:
        x1 = -100000
    else:
        x1 = max(no_left)

    if len(no_up)==0:
        y2 = 100000
    else:
        y2 = min(no_up)

    if len(no_right)==0:
        x2 = 100000
    else:
        x2 = min(no_right)

    if len(no_down)==0:
        y1 = -100000
    else:
        y1 = max(no_down)

    # x_2 = max(no_left)
    # x_1 = min(no_right)
    # y_2 = max(no_down)
    # y_1 = min(no_up)

    if x2 >= x1 and y2 >= y1:
        print(1, x1, y1)
    else:
        print(0)


numOfQueries = int(input())
targets = []
for i in range(0,numOfQueries):
    numOfRobotsInQuery = int(input())
    # if numOfRobotsInQuery == 1:
    #     x1, y1, f11, f12, f13, f14 = list(map(int, input().split()))
    #     if x1 > 100000 or x1 < -100000 or y1 > 100000 or y < -100000:
    #         exit(0)
    #     if f11 == 1:
    #         xtarget = -100000
    #     else:
    #         xtarget = x1
    #     if f13 == 1:
    #         ytarget = -100000
    #     else:
    #         ytarget = y1
    #     targets.append([1, xtarget, ytarget])
    # elif numOfRobotsInQuery > 1:
    robots = []
    for j in range(0, numOfRobotsInQuery):
        xi, yi, fi1, fi2, fi3, fi4 = list(map(int, input().split()))
        robots.append([xi, yi, fi1, fi2, fi3, fi4])

    robotsCantMoveLeft = [_[0] for _ in robots if _[2] == 0]
    leftBound = -100000
    if len(robotsCantMoveLeft) > 0:
        leftBound = max(robotsCantMoveLeft)

    rightBound = 100000
    robotsCantMoveRight = [_[0] for _ in robots if _[4] == 0]
    if len(robotsCantMoveRight) > 0:
        rightBound = min(robotsCantMoveRight)

    upperBound = 100000
    robotsCantMoveUp = [_[1] for _ in robots if _[3] == 0]
    if len(robotsCantMoveUp) > 0:
        upperBound = min(robotsCantMoveUp)

    lowerBound = -100000
    robotsCantMoveDown = [_[1] for _ in robots if _[5] == 0]
    if len(robotsCantMoveDown) > 0:
        lowerBound = max(robotsCantMoveDown)

    # print("L-R bounds:", leftBound, " ", rightBound)
    # print("D-UP bounds:",lowerBound, " ", upperBound)
    # print("")

    if leftBound > rightBound or lowerBound > upperBound:
        targets.append([0, 0, 0])
    else:
        targets.append([1, leftBound, lowerBound])

for i in targets:
    if i[0] == 0:
        print(0)
    else:
        print(1, " ", i[1], " ", i[2])

exit(0)


try:
    numOfQueries = int(input())
except:
    exit(0)

targets = []
for i in range(0,numOfQueries):
    try:
        numOfRobotsInQuery = int(input())
    except:
        exit(0)
    if numOfRobotsInQuery == 1:
        x1, y1, f11, f12, f13, f14 = list(map(int, input().split()))
        if f11 == 1:
            xtarget = -100000
        else:
            xtarget = x1
        if f13 == 1:
            ytarget = -100000
        else:
            ytarget = y1
        targets.append([1, xtarget, ytarget])
    elif numOfRobotsInQuery > 1:
        robots = []
        for j in range(0, numOfRobotsInQuery):
            xi, yi, fi1, fi2, fi3, fi4 = list(map(int, input().split()))
            robots.append([xi, yi, fi1, fi2, fi3, fi4])

        robotsCantMoveLeft = [_[0] for _ in robots if _[2] == 0]
        leftBound = -100000
        if len(robotsCantMoveLeft) > 0:
            leftBound = max(robotsCantMoveLeft)

        rightBound = 100000
        robotsCantMoveRight = [_[0] for _ in robots if _[4] == 0]
        if len(robotsCantMoveRight) > 0:
            rightBound = min(robotsCantMoveRight)

        upperBound = 100000
        robotsCantMoveUp = [_[1] for _ in robots if _[3] == 0]
        if len(robotsCantMoveUp) > 0:
            upperBound = min(robotsCantMoveUp)

        lowerBound = -100000
        robotsCantMoveDown = [_[1] for _ in robots if _[5] == 0]
        if len(robotsCantMoveDown) > 0:
            lowerBound = max(robotsCantMoveDown)

        # print("L-R bounds:", leftBound, " ", rightBound)
        # print("D-UP bounds:",lowerBound, " ", upperBound)
        # print("")

        if leftBound > rightBound or lowerBound > upperBound:
            targets.append([0, 0, 0])
        else:
            targets.append([1, leftBound, lowerBound])

for i in targets:
    if i[0] == 0:
        print(0)
    else:
        print(1, " ", i[1], " ", i[2])

exit(0)


#include <bits/stdc++.h>
using namespace std;

#define what_is(x)    cerr<<#x<<" is "<<x<<"\n";
#define rep(i,a,n)    for(int i=a; i<n; ++i)
#define rep1(i,a,n)   for(int i=a; i>=n; --i)
#define pb            push_back
#define mp            make_pair
#define ll            long long
#define fr            first
#define sc            second
#define vc            vector
#define sz(v)         (int)v.size()
#define all(x)        (x).begin(),(x).end()
#define rall(x)       (x).rbegin(),(x).rend()
#define M             1000000007
#define MM            998244353
#define PI            3.14159265358979
#define INF           1000000000000000

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef map<int,int> mii;

int main()
{
    ios::sync_with_stdio(0);
    int n,count=0;
    float avg;
    cin>>n;
    int a[n],b[n];
    vi v;
    rep(i,0,n)
    cin>>a[i];
    b[0]=a[0];
    rep(i,1,n)
    b[i]=b[i-1]+a[i];
    rep(i,0,n)
    {
    	avg=(b[n-1]-a[i])/(n-1);
		if(avg==a[i])
		{count++; v.pb(i+1);}
	}
	cout<<count<<endl;
	rep(i,0,v.size())
	cout<<v[i]<<" ";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define what_is(x)    cerr<<#x<<" is "<<x<<"\n";
#define rep(i,a,n)    for(int i=a; i<n; ++i)
#define rep1(i,a,n)   for(int i=a; i>=n; --i)
#define pb            push_back
#define mp            make_pair
#define ll            long long
#define fr            first
#define sc            second
#define vc            vector
#define sz(v)         (int)v.size()
#define all(x)        (x).begin(),(x).end()
#define rall(x)       (x).rbegin(),(x).rend()
#define M             1000000007
#define MM            998244353
#define PI            3.14159265358979
#define INF           1000000000000000

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef map<int,int> mii;

int main()
{
    ios::sync_with_stdio(0);
    int n,count=0;
    ll s=0;
    float avg;
    cin>>n;
    int a[n];
    vi v;
    rep(i,0,n)
    {
    	cin>>a[i];
    	s+=a[i];
    }
    rep(i,0,n)
    {
    	avg=(s-a[i])/(n-1);
		if(avg==a[i])
		{count++; v.pb(i+1);}
	}
	cout<<count<<endl;
	rep(i,0,v.size())
	cout<<v[i]<<" ";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define what_is(x)    cerr<<#x<<" is "<<x<<"\n";
#define rep(i,a,n)    for(int i=a; i<n; ++i)
#define rep1(i,a,n)   for(int i=a; i>=n; --i)
#define pb            push_back
#define mp            make_pair
#define ll            long long
#define fr            first
#define sc            second
#define vc            vector
#define sz(v)         (int)v.size()
#define all(x)        (x).begin(),(x).end()
#define rall(x)       (x).rbegin(),(x).rend()
#define M             1000000007
#define MM            998244353
#define PI            3.14159265358979
#define INF           1000000000000000

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef map<int,int> mii;

int main()
{
    ios::sync_with_stdio(0);
    int n;
    ll s=0;
    cin>>n;
    int a[n];
    vi v;
    rep(i,0,n)
    {
    	cin>>a[i];
    	s+=a[i];
    }
    rep(i,0,n)
    {
		if(s-a[i]==(ll)a[i]*(n-1))
		v.pb(i+1);
	}
	cout<<v.size()<<endl;
	rep(i,0,v.size())
	cout<<v[i]<<" ";
	return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define fast ios::sync_with_stdio(0);cin.tie(0), cout.tie(0)
using namespace std;
int n,a[200005],sum;
vector<int> v;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
    cin>>a[i];
    sum+=a[i];
}
if(sum%n!=0){
    cout<<0;
    return 0;
}
sum/=n;
for(int i=1;i<=n;i++){
    if(a[i]==sum) v.push_back(i);
}
if(v.size()==0){
    cout<<0;
    return 0;
}
cout<<v.size()<<endl;
sort(v.begin(),v.end());
for(int i=0;i<v.size();i++){
    cout<<v[i]<<" ";
}
}


#include <bits/stdc++.h>
#define ll long long int
#define fast ios::sync_with_stdio(0);cin.tie(0), cout.tie(0)
using namespace std;
int n,a[200005],sum;
vector<int> v;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
    cin>>a[i];
    sum+=a[i];
}
sum/=n;
for(int i=1;i<=n;i++){
    if(a[i]==sum) v.push_back(i);
}
if(v.size()==0){
    cout<<0;
    return 0;
}
cout<<v.size()<<endl;
sort(v.begin(),v.end());
for(int i=0;i<v.size();i++){
    cout<<v[i]<<" ";
}
}


#include <bits/stdc++.h>
#define ll long long int
#define fast ios::sync_with_stdio(0);cin.tie(0), cout.tie(0)
using namespace std;
int n,a[200005],sum;
vector<int> v;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
    cin>>a[i];
    sum+=a[i];
}
sum/=n;
for(int i=1;i<=n;i++){
    if(a[i]==sum) v.push_back(i);
}
cout<<v.size()<<endl;
sort(a,a+n);
for(int i=0;i<v.size();i++){
    cout<<v[i]<<" ";
}
}


#include <bits/stdc++.h>
#define ll long long int
#define fast ios::sync_with_stdio(0);cin.tie(0), cout.tie(0)
using namespace std;
int n,a[200005],sum;
vector<int> v;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
    cin>>a[i];
    sum+=a[i];
}
sum/=n;
for(int i=1;i<=n;i++){
    if(a[i]==sum) v.push_back(i);
}
cout<<v.size()<<endl;
sort(v.begin(),v.end());
for(int i=0;i<v.size();i++){
    cout<<v[i]<<" ";
}
}


#include <bits/stdc++.h>
#define ll long long int
#define fast ios::sync_with_stdio(0);cin.tie(0), cout.tie(0)
using namespace std;
int n,a[200005],sum;
vector<int> v;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
    cin>>a[i];
    sum+=a[i];
}
sum/=n;
sort(a,a+n);
for(int i=1;i<=n;i++){
    if(a[i]==sum) v.push_back(i);
}
cout<<v.size()<<endl;
for(int i=0;i<v.size();i++){
    cout<<v[i]<<" ";
}
}


#include <bits/stdc++.h>
#define ll long long int
#define fast ios::sync_with_stdio(0);cin.tie(0), cout.tie(0)
using namespace std;
int n,a[200005],sum;
vector<int> v;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
    cin>>a[i];
    sum+=a[i];
}
if(sum%n!=0){
    cout<<0;
    return 0;
}
sum/=n;
for(int i=1;i<=n;i++){
    if(a[i]==sum) v.push_back(i);
}
cout<<v.size()<<endl;
sort(v.begin(),v.end());
for(int i=0;i<v.size();i++){
    cout<<v[i]<<" ";
}
}


#include <bits/stdc++.h>

using namespace std;
const int N=2e5+9;
int a[N] , n  , cnt ;
double ave , sum ;
vector<int>v;
int main()
{
    cin>>n;
    for(int i=1 ; i<=n ; i++)
    {
        cin>>a[i];
        sum+=(int)a[i];
    }
    ave=(double)(sum/n);
    for(int i=1 ; i<=n ; i++)
    {
        if(a[i]==ave)
        {
            cnt++;
            v.push_back(i);
        }
    }
    if(cnt==0)
        puts("0");
    else
    {
        cout<<cnt<<"\n";
        for(int i=0 ; i<v.size() ; i++)
            cout<<v[i]<<" ";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int N=2e5+9;
int a[N] , n , ave , cnt , sum;
vector<int>v;
int main()
{
    cin>>n;
    for(int i=1 ; i<=n ; i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    ave=sum/n;
    for(int i=1 ; i<=n ; i++)
    {
        if(a[i]==ave)
        {
            cnt++;
            v.push_back(i);
        }
    }
    if(cnt==0)
        puts("0");
    else
    {
        cout<<cnt<<"\n";
        for(int i=0 ; i<v.size() ; i++)
            cout<<v[i]<<" ";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int N=2e5+9;
int a[N] , n , ave , cnt , sum;
vector<int>v;
int main()
{
    cin>>n;
    for(int i=1 ; i<=n ; i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    ave=sum/n;
    for(int i=1 ; i<=n ; i++)
    {
        if(a[i]==ave)
        {
            cnt++;
            v.push_back(i);
        }
    }
    if(cnt==0)
        puts("0");
    else
    {
        cout<<cnt<<"\n";
        for(x:v)
            cout<<x<<" ";
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(void)
{
    long long int n,sum=0,j=0,i;
    cin>>n;
    long long int arr[n],brr[n];
    for(i=0;i<n;i++)
    {
        cin>>arr[i];
        sum+=arr[i];
    }
     for(i=0;i<n;i++)
     {
         if((sum-arr[i])==arr[i]*(n-1))
         {
             //cout<<i<<" "<<arr[i]<<endl;
             brr[j]=i+1;
             j++;
         }
     }
     cout<<j<<endl;
     for(i=0;i<j;i++) cout<<brr[i]<<" ";
}


#include<bits/stdc++.h>
using namespace std;
int main(void)
{
    long long int n,sum=0,j=0,i;
    cin>>n;
    long long int arr[n],brr[n];
    for(i=0;i<n;i++)
    {
        cin>>arr[i];
        sum+=arr[i];
    }
     for(i=0;i<n;i++)
     {
         if(((sum-arr[i])/(n-1))==arr[i])
         {
             //cout<<i<<" "<<arr[i]<<endl;
             brr[j]=i+1;
             j++;
         }
     }
     cout<<j<<endl;
     for(i=0;i<j;i++) cout<<brr[i]<<" ";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	int n;
	vector <int> v;
	cin>>n;
	int a[n];
	ll s=0;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		s=s+a[i];
	}
	int c=0;
	for(int i=0;i<n;i++)
	{
		if(((s-a[i])/(n-1))==a[i])
		{
			c++;
			v.push_back(i+1);
		}
	}
	cout<<v.size()<<endl;
	for(int i=0;i<v.size();i++)
	{
		cout<<v[i]<<" ";
	}
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	int n;
	vector <int> v;
	cin>>n;
	int a[n];
	ll s=0;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		s=s+a[i];
	}
	int c=0;
	for(int i=0;i<n;i++)
	{
		if(((s-a[i])/(n-1))==a[i])
		{
			c++;
			v.push_back(a[i]);
		}
	}
	cout<<v.size()<<endl;
	for(int i=0;i<v.size();i++)
	{
		cout<<v[i]<<" ";
	}
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	int n;
	vector <int> v;
	cin>>n;
	int a[n];
	ll s=0;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		s=s+a[i];
	}
	int c=0;
	for(int i=0;i<n;i++)
	{
		if((((s-a[i])/(n-1))==a[i]&&(((s-a[i])%(n-1)==0))))
		{
			c++;
			v.push_back(i+1);
		}
	}
	cout<<v.size()<<endl;
	for(int i=0;i<v.size();i++)
	{
		cout<<v[i]<<" ";
	}
	cout<<endl;
	return 0;
}


	#include <bits/stdc++.h>
	#include <cstdio>
	#include <cstring>
	#include <cmath>
	#include <cstring>
	#include <chrono>
	#include <complex>
	#define endl "\n"
	#define ll long long int
	#define vi vector<int>
	#define vll vector<ll>
	#define vvi vector < vi >
	#define pii pair<int,int>
	#define pll pair<long long, long long>
	#define mod 1000000007
	#define inf 1000000000000000001;
	#define all(c) c.begin(),c.end()
	#define mp(x,y) make_pair(x,y)
	#define mem(a,val) memset(a,val,sizeof(a))
	#define eb emplace_back
	#define f first
	#define s second

	using namespace std;
	int main()
	{

	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif

		int n;

		cin>>n;

		int a[n];

		float sum=0;

		for(int i=0;i<n;i++) {
			cin>>a[i];
			sum+=a[i];
		}

		vector<int> v;

		for(int i=0;i<n;i++) {
			if(((sum-a[i])/(n-1))==a[i]) {
				v.eb(i+1);
			}
		}

		cout<<v.size()<<endl;

		for(int i=0;i<v.size();i++) {
			cout<<v[i]<<" ";
		}

		return 0;
	}


	#include <bits/stdc++.h>
	#include <cstdio>
	#include <cstring>
	#include <cmath>
	#include <cstring>
	#include <chrono>
	#include <complex>
	#define endl "\n"
	#define ll long long int
	#define vi vector<int>
	#define vll vector<ll>
	#define vvi vector < vi >
	#define pii pair<int,int>
	#define pll pair<long long, long long>
	#define mod 1000000007
	#define inf 1000000000000000001;
	#define all(c) c.begin(),c.end()
	#define mp(x,y) make_pair(x,y)
	#define mem(a,val) memset(a,val,sizeof(a))
	#define eb emplace_back
	#define f first
	#define s second

	using namespace std;
	int main()
	{

	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif

		int n;

		cin>>n;

		int a[n];

		int sum=0;

		for(int i=0;i<n;i++) {
			cin>>a[i];
			sum+=a[i];
		}

		vector<int> v;

		for(int i=0;i<n;i++) {
			if(((sum-a[i])/(n-1))==a[i]&&(sum-a[i])%(n-1)==0) {
				v.eb(i+1);
			}
		}

		cout<<v.size()<<endl;

		for(int i=0;i<v.size();i++) {
			cout<<v[i]<<" ";
		}

		return 0;
	}


	#include <bits/stdc++.h>
	#include <cstdio>
	#include <cstring>
	#include <cmath>
	#include <cstring>
	#include <chrono>
	#include <complex>
	#define endl "\n"
	#define ll long long int
	#define vi vector<int>
	#define vll vector<ll>
	#define vvi vector < vi >
	#define pii pair<int,int>
	#define pll pair<long long, long long>
	#define mod 1000000007
	#define inf 1000000000000000001;
	#define all(c) c.begin(),c.end()
	#define mp(x,y) make_pair(x,y)
	#define mem(a,val) memset(a,val,sizeof(a))
	#define eb emplace_back
	#define f first
	#define s second

	using namespace std;
	int main()
	{

	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif

		int n;

		cin>>n;

		int a[n];

		int sum=0;

		for(int i=0;i<n;i++) {
			cin>>a[i];
			sum+=a[i];
		}

		vector<int> v;

		for(int i=0;i<n;i++) {
			if(((sum-a[i])/(n-1))==a[i]) {
				v.eb(i+1);
			}
		}

		cout<<v.size()<<endl;

		for(int i=0;i<v.size();i++) {
			cout<<v[i]<<" ";
		}

		return 0;
	}


#include <iostream>
#include <bits/stdc++.h>
#include <iomanip>
typedef long long int lli;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define JUGAD freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pb push_back
#define pf push_front
#define mp make_pair
#define ff first
#define ss second
using namespace std;

int main(){
    FAST;
    int n;
    cin>>n;
    int ar[n];
    lli total=0;
    for(int i=0;i<n;i++){
        cin>>ar[i];
        total+=ar[i];
    }
    vector<int> v;
    for(int i=0;i<n;i++){
        if(ar[i]==(total-ar[i])/(n-1) && (total-ar[i])%(n-1)==0){v.pb(i+1);}
    }
    cout<<v.size()<<endl;
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
}


#include <iostream>
#include <bits/stdc++.h>
#include <iomanip>
typedef long long int lli;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define JUGAD freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pb push_back
#define pf push_front
#define mp make_pair
#define ff first
#define ss second
using namespace std;

int main(){
    FAST;
    int n;
    cin>>n;
    int ar[n];
    lli total=0;
    for(int i=0;i<n;i++){
        cin>>ar[i];
        total+=ar[i];
    }
    vector<int> v;
    for(int i=0;i<n;i++){
        if(ar[i]==(total-ar[i])/(n-1)){v.pb(i+1);}
    }
    cout<<v.size()<<endl;
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
}


// !=D
#include <iostream>
#include <vector>

using namespace std;

vector<int> vec;
int a[1005];
int main()
{
    int n;
    cin>> n;
    long long sum=0;
    for(int i=0; i<n; i++)
    {
        cin>> a[i];
        sum+=a[i];
    }
    for(int i=0; i<n; i++)
    {
        if((sum-a[i])/((n-1)/1.0)==a[i])
            vec.push_back(i+1);
    }
    cout<< vec.size() << endl;
    for(int i=0; i<vec.size(); i++)
        cout<< vec[i] << ' ';
    cout<< endl;

    return 0;
}


// !=D
#include <iostream>
#include <vector>

using namespace std;

vector<int> vec;
int a[200005];
int main()
{
    int n;
    cin>> n;
    long long sum=0;
    for(int i=0; i<n; i++)
    {
        cin>> a[i];
        sum+=a[i];
    }
    for(int i=0; i<n; i++)
    {
        if((sum-a[i])/((n-1)/1.0)==a[i])
            vec.push_back(i+1);
    }
    cout<< vec.size() << endl;
    for(int i=0; i<vec.size(); i++)
        cout<< vec[i] << ' ';
    cout<< endl;

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
 int main()
 {
    ll n;
    cin >> n;
    int x[n + 1000];
    vector <int> v;
    vector <int> Q;
    int ANS = 0;
    for ( int i = 0; i < n; ++i ){
    	cin >> x[i];
    	ANS += x[i];
    }
    if (ANS % n){
    	cout << "0";
    	return 0;
	}
    ANS /= n;
    int IND = 0;
    for ( int i = 0; i < n; ++i ){
    	if (ANS == x[i])++IND;
	}
	cout << IND << "\n";
	for ( int i = 0; i < n; ++i ){
    	if (ANS == x[i])cout << i + 1 << " ";
	}
 }


#include <bits/stdc++.h>
#define ll long long
using namespace std;
 int main()
 {
    ll n;
    cin >> n;
    int x[n + 1000];
    vector <int> v;
    vector <int> Q;
    int ANS = 0;
    for ( int i = 0; i < n; ++i ){
    	cin >> x[i];
    	ANS += x[i];
    }
    ANS /= n;
    int IND = 0;
    for ( int i = 0; i < n; ++i ){
    	if (ANS == x[i])++IND;
	}
	cout << IND << "\n";
	for ( int i = 0; i < n; ++i ){
    	if (ANS == x[i])cout << i + 1 << " ";
	}
 }


#include <bits/stdc++.h>
#define ll long long
using namespace std;
 int main()
 {
    ll n;
    cin >> n;
    int x[n + 100000];
    vector <int> v;
    vector <int> Q;
    long long ANS = 0;
    for ( long long i = 0; i < n; ++i ){
    	cin >> x[i];
    }
    for ( int i= 0; i < n; ++i ){
    	for ( int j = 0; j < n; ++j ){
    		if (j != i)ANS += x[j];
		}
	    v.push_back(ANS / (n - 1));
	    ANS = 0;
    }
	for ( int i = 0; i < v.size(); ++i ){
		if (x[i] == v[i]){
			Q.push_back(i + 1);
		}
	}
	cout << Q.size() << "\n";
	for ( int i = 0; i < Q.size(); ++i )cout << Q[i] << " ";
 }


#include <bits/stdc++.h>
#define ll long long
using namespace std;
 int main()
 {
    ll n;
    cin >> n;
    int x[n + 1000];
    vector <int> v;
    vector <int> Q;
    int ANS = 0;
    for ( int i = 0; i < n; ++i ){
    	cin >> x[i];
    }
    for ( int i= 0; i < n; ++i ){
    	for ( int j = 0; j < n; ++j ){
    		if (j != i)ANS += x[j];
		}
	    v.push_back(ANS / (n - 1));
	    ANS = 0;
    }
	int IND = 0;
	for ( int i = 0; i < v.size(); ++i ){
		if (x[i] == v[i]){
			Q.push_back(i + 1);
		}
	}
	cout << Q.size() << "\n";
	for ( int i = 0; i < Q.size(); ++i )cout << Q[i] << " ";
 }


#include <bits/stdc++.h>
#define ll long long
using namespace std;
 int main()
 {
    ll n;
    cin >> n;
    int x[n + 1000];
    vector <int> v;
    vector <int> Q;
    int ANS = 0;
    for ( int i = 0; i < n; ++i ){
    	cin >> x[i];
    }
    for ( int i= 0; i < n; ++i ){
    	for ( int j = 0; j < n; ++j ){
    		if (j != i)ANS += x[j];
		}
	    v.push_back(ANS / (n - 1));
	    ANS = 0;
    }
	int IND = 0;
	for ( int i = 0; i < v.size(); ++i ){
		if (x[i] == v[i]){
			Q.push_back(v[i]);
		}
	}
	cout << Q.size() << "\n";
	for ( int i = 0; i < Q.size(); ++i )cout << Q[i] << " ";
 }


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;

    vector<int> reads;
    vector<int> indices;
    double sum = 0;

    for (int i = 1; i <= n; ++i) {
        int read;
        cin >> read;
        sum += read;
        reads.emplace_back(read);
    }

    double average = sum / n;

    for (int i = 1; i <= n; ++i) {
        if (average == reads[i-1]) {
            indices.emplace_back(i);
        }
    }

    cout << indices.size() << endl;

    for (auto i : indices) {
        cout << i << " ";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;

    vector<int> reads;
    vector<int> indices;
    int sum = 0;

    for (int i = 1; i <= n; ++i) {
        int read;
        cin >> read;
        sum += read;
        reads.emplace_back(read);
    }

    double average = sum / n;

    for (int i = 1; i <= n; ++i) {
        if (average == reads[i-1]) {
            indices.emplace_back(i);
        }
    }

    cout << indices.size() << endl;

    for (auto i : indices) {
        cout << i << " ";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define name ""
#define ini freopen(name".inp","r",stdin); freopen(name".out","w",stdout)
#define long long long
#define db double
#define pii pair <int, int>
#define pll pair <long, long>
#define all(c) c.begin(), c.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define memset(a,x) memset(a,x,sizeof(a))
template <class T> inline void chmin(T &a, const T& val) { if (a > val) a = val; }
template <class T> inline void chmax(T &a, const T& val) { if (a < val) a = val; }
template <class T> long sqr(T a) { return 1ll * a * a; }
template <class T> void compress(T &a){
  sort(all(a)); a.resize(unique(all(a)) - a.begin());
}

const db pi = acos(-1.00);
const db eps = 1e-6;
const int INF = 2e9+1;
const int MOD = 1e9+7;
const int dx[4] = {0, 0, -1, 1};
const int dy[4] = {-1, 1, 0, 0};

bool cx[1001];

int main()
{
    fastio;
    int n, a, s=0;
    cin >> n;
    vector<int> v[10001];
    for (int i = 1; i <= n; i++)
    {
        cin >> a; s+= a;
        v[a].push_back(i);
    }
    if (s % n != 0) {cout << 0; return 0;}
    else
    {
        s /= n;
        cout << v[s].size() << '\n';
        if (v[s].size() == 0) return 0;
        for (int i : v[s]) cout << i << ' ';
    }
}


#include <bits/stdc++.h>
using namespace std;
long long n,a[212345],s;
vector<long long> ans;
int main(){
    cin>>n;
    for(int i=0;i<n;++i){
        cin>>a[i];
        s += a[i];
    }
    for(int i=0;i<n;++i){
        long long d = s - a[i];
        long long t = d / (n - 1);
        if((n-1)*t==d && t == a[i]){
            ans.push_back(i+1);
        }
    }
    cout<<ans.size()<<endl;
    for(auto i:ans){
        cout<<i<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
long long n,a[112345],s;
vector<long long> ans;
int main(){
    cin>>n;
    for(int i=0;i<n;++i){
        cin>>a[i];
        s += a[i];
    }
    for(int i=0;i<n;++i){
        long long d = s - a[i];
        long long t = d / (n - 1);
        if((n-1)*t==d){
            ans.push_back(i+1);
        }
    }
    cout<<ans.size()<<endl;
    for(auto i:ans){
        cout<<i<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
long long n,a[212345],s;
vector<long long> ans;
int main(){
    cin>>n;
    for(int i=0;i<n;++i){
        cin>>a[i];
        s += a[i];
    }
    for(int i=0;i<n;++i){
        long long d = s - a[i];
        long long t = d / (n - 1);
        if((n-1)*t==d){
            ans.push_back(i+1);
        }
    }
    cout<<ans.size()<<endl;
    for(auto i:ans){
        cout<<i<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main() {

    int n;
    cin>>n;
    int a[n];
    int i,j,mean=0;
    for(i=0;i<n;i++){
        cin>>a[i];
        mean+=a[i];
    }
    int b[n]={0};
    int flag=0;
    for(i=0;i<n;i++){
        if(n*a[i]==mean)
        {
            b[i]=i+1;
            flag++;
        }
    }
    if(flag==0){
        cout<<0<<endl;
        return 0;
    }
    cout<<flag<<endl;
    for(i=0;i<n;i++){
        if(b[i]>0)
        cout<<b[i]<<" ";
    }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {

    int n;
    cin>>n;
    int a[n];
    int i,j,mean=0;
    for(i=0;i<n;i++){
        cin>>a[i];
        mean+=a[i];
    }
    mean=mean/n;
    int b[n]={0};
    int flag=0;
    for(i=0;i<n;i++){
        if(a[i]==mean)
        {
            b[i]=i+1;
            flag++;
        }
    }
    if(flag==0){
        cout<<0<<endl;
        return 0;
    }
    cout<<flag<<endl;
    for(i=0;i<n;i++){
        if(b[i]>0)
        cout<<b[i]<<" ";
    }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MAX 1000002
using ll = long long;

int main(){
    int n;
    while( cin >> n ){
        ll sum = 0;
        ll arr[n];
        for( int i = 0; i < n; i++ ){
            cin >> arr[i];
            sum += arr[i];
        }
        vector<int>idx;
        for( int i = 0; i < n; i++ ){
            int a = arr[i];
            ll tempSum = sum-a;
            if( a == (tempSum/(n-1)) ){
                idx.push_back(i+1);
            }
        }
        cout << idx.size() << "\n";
        for( auto i : idx ){
            cout << i << ' ';
        }
        cout << "\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

#define MAX 1000002
using ll = long long;

int main(){
    int n;
    while( cin >> n ){
        ll sum = 0;
        ll arr[n];
        for( int i = 0; i < n; i++ ){
            cin >> arr[i];
            sum += arr[i];
        }
        vector<int>idx;
        for( int i = 0; i < n; i++ ){
            if( (arr[i]*(n-1)) == (sum - arr[i]) ){
                idx.push_back(i+1);
            }
        }
        cout << idx.size() << "\n";
        for( auto i : idx ){
            cout << i << ' ';
        }
        cout << "\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

#define MAX 1000002
using ll = long long;

int main(){
    int n;
    while( cin >> n ){
        ll sum = 0;
        ll arr[n];
        for( int i = 0; i < n; i++ ){
            cin >> arr[i];
            sum += arr[i];
        }
        vector<int>idx;
        for( int i = 0; i < n; i++ ){
            int a = arr[i];
            ll tempSum = sum-a;
            ll avrg = tempSum/(n-1);
            if( a == avrg ){
                idx.push_back(i+1);
            }
        }
        cout << idx.size() << "\n";
        for( auto i : idx ){
            cout << i << ' ';
        }
        cout << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
const int N = 100+5, M = 1e4+5, OO = 0x3f3f3f3f;
typedef long long ll;
#define PI 3.14159265358979323846
#define INF LONG_MAX
const int  MOD = 1e9+7;
vector<ll> v;
int main()
{
    int n; cin>>n;
    ll s = 0;
    int a[n]; for (int i=0; i<n; ++i) cin>>a[i], s+=a[i];
    vector<int> ans;
    for (int i=0; i<n; ++i) {
      if (((s - a[i]) % (n-1)) == 0 && ((s - a[i]) / (n-1)) == a[i]) ans.push_back(i);
    }
    cout<<ans.size()<<endl;
    for (auto i : ans) cout<<i+1<<endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 100+5, M = 1e4+5, OO = 0x3f3f3f3f;
typedef long long ll;
#define PI 3.14159265358979323846
#define INF LONG_MAX
const int  MOD = 1e9+7;
vector<ll> v;
int main()
{
    int n; cin>>n;
    ll s = 0;
    int a[n]; for (int i=0; i<n; ++i) cin>>a[i], s+=a[i];
    vector<int> ans;
    for (int i=0; i<n; ++i) {
      if (((s - a[i]) / (n-1)) == a[i]) ans.push_back(i);
    }
    cout<<ans.size()<<endl;
    for (auto i : ans) cout<<i+1<<endl;
  return 0;
}


/*

 ALLAH IS ALMIGHTY              ******BISMILLAHIR RAHMANIR RAHIM.******              ALLAH IS ALMIGHTY
                                    ```````````````````````````````
                                        AUTHOR: ANISUR RAHAMAN
                                            BSMRSTU(SHIICT)
                                                ID:017

                            ............LET's START OUR JOURNEY.............

*/

#include<bits/stdc++.h>

#define I_O ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define ll long long
#define ld long double
#define db double

//~~~~~~~~~~~~~~Pair~~~~~~~~~~~~~~~~~~//
#define pi pair<int,int>
#define pl pair<ll,ll>
#define pd pair<db,db>
#define psi pair<string,int>
#define vi vector<int>
#define vl vector<ll>
#define vd vector<db>
#define vb vector<bool>
#define vpi vector<pi>
#define vpl vector<pl>
#define vpd vector<pd>

//~~~~~~~~~~~~~~Vector~~~~~~~~~~~~~~~~~//
#define pb push_back
#define pf push_front
#define MP make_pair
#define in insert
#define ff first
#define ss second
#define al(v) v.begin(),v.end()
#define srt(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mxv *max_element
#define mnv *min_element

const int MOD = 1e9+7;
const ll INF = 1e18;

//~~~~~~~~~~~~~~~Input Stream and Loop~~~~~~~~~~~~~~~~//
#define sp(n) fixed << setprecision(n)
#define snll(a) scanf("%lld", &a)
#define snll2(a,b) scanf("%lld %lld", &a,&b)
#define snl(b) scanf("%d", &b)
#define snl2(a,b) scanf("%d %d", &a,&b)
#define sns(str) scanf("%s", &str)
#define ptl(a) printf("%d\n", a)
#define pts(str) printf("%s\n", str)
#define ptll(a) printf("%lld\n", a)
#define ptl2(a,b) printf("%d %d\n", a,b)
#define ptll2(a,b) printf("%lld %lld\n", a,b)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define PI acos(-1)
#define off return 0
#define C continue
#define B break
#define N '\n'
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,a,b) for(int i=a;i<b;i++)
#define test_case() int T; T = 1; while(T--)

using namespace std;

void SoLuTioN()
{
    int n;
    cin >> n;
    vector<int> v(n), ans;
    ll s = 0, mean;
    for(int i = 0; i < n; i++){
        cin >> v[i];
        s += v[i];
    }
    for(int i = 0; i < n; i++){
        s -= v[i];
        if(s % (n - 1) == 0 && s / (n - 1) == v[i]) ans.pb(i + 1);
        s += v[i];
    }
    sort(al(ans));
    if(ans.size()){
        cout << ans.size() << N;
        for(auto &a: ans) cout << a << " ";
    }
    else cout << "0" << N;
    cout << N;
}

int main()
{
    //system("COLOR F1");
    I_O
    test_case()
    {
        SoLuTioN();
    }

    off;
}

//system("COLOR F5");
/******************************************* THE END *************************************************/


/*

 ALLAH IS ALMIGHTY              ******BISMILLAHIR RAHMANIR RAHIM.******              ALLAH IS ALMIGHTY
                                    ```````````````````````````````
                                        AUTHOR: ANISUR RAHAMAN
                                            BSMRSTU(SHIICT)
                                                ID:017

                            ............LET's START OUR JOURNEY.............

*/

#include<bits/stdc++.h>

#define I_O ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define ll long long
#define ld long double
#define db double

//~~~~~~~~~~~~~~Pair~~~~~~~~~~~~~~~~~~//
#define pi pair<int,int>
#define pl pair<ll,ll>
#define pd pair<db,db>
#define psi pair<string,int>
#define vi vector<int>
#define vl vector<ll>
#define vd vector<db>
#define vb vector<bool>
#define vpi vector<pi>
#define vpl vector<pl>
#define vpd vector<pd>

//~~~~~~~~~~~~~~Vector~~~~~~~~~~~~~~~~~//
#define pb push_back
#define pf push_front
#define MP make_pair
#define in insert
#define ff first
#define ss second
#define al(v) v.begin(),v.end()
#define srt(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mxv *max_element
#define mnv *min_element

const int MOD = 1e9+7;
const ll INF = 1e18;

//~~~~~~~~~~~~~~~Input Stream and Loop~~~~~~~~~~~~~~~~//
#define sp(n) fixed << setprecision(n)
#define snll(a) scanf("%lld", &a)
#define snll2(a,b) scanf("%lld %lld", &a,&b)
#define snl(b) scanf("%d", &b)
#define snl2(a,b) scanf("%d %d", &a,&b)
#define sns(str) scanf("%s", &str)
#define ptl(a) printf("%d\n", a)
#define pts(str) printf("%s\n", str)
#define ptll(a) printf("%lld\n", a)
#define ptl2(a,b) printf("%d %d\n", a,b)
#define ptll2(a,b) printf("%lld %lld\n", a,b)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define PI acos(-1)
#define off return 0
#define C continue
#define B break
#define N '\n'
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,a,b) for(int i=a;i<b;i++)
#define test_case() int T; T = 1; while(T--)

using namespace std;

void SoLuTioN()
{
    int n;
    cin >> n;
    vector<int> v(n), ans;
    ll s = 0, mean;
    for(int i = 0; i < n; i++){
        cin >> v[i];
        s += v[i];
    }
    for(int i = 0; i < n; i++){
        s -= v[i];
        if(s % (n - 1) == 0 && s / (n - 1) == v[i]) ans.pb(i + 1);
        s += v[i];
    }
    sort(al(ans));
    if(ans.size()){
        cout << ans.size() << N;
        for(auto &a: ans) cout << a << " ";
    }
    cout << N;
}

int main()
{
    //system("COLOR F1");
    I_O
    test_case()
    {
        SoLuTioN();
    }

    off;
}

//system("COLOR F5");
/******************************************* THE END *************************************************/


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
#define ld long double
using namespace std;
const ll N = 1e6;
ll m, cnt, mO, n , x , h, sum , y,t, ans,z,res,mx, mnn = 1e9, q, r, l, o, n1, g,mn = 1e9, i,mxx, k;

pair<int, int>p[N];
string s,s1,s2, s3,s4;
vector<ll>v,v1,v2;
set<char>st;
set<char>::iterator it;
deque<int>d,d1,d2;
map<int, int>mp;
map<int , int>mpp;
int used[N];
char a , b;
int main()
{
      ios_base::sync_with_stdio(0);
      cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

      cin >> n ;
      ll a[n];
      for ( ll i = 0; i < n; i ++ )
      cin >> a[i], cnt += a[i];
      cnt /= n;
      for( int i = 0; i < n; i ++ )
      {
          if ( a[i] == cnt )
             v.pb ( i + 1 );
      }
      cout << v.size() << endl;
      for ( int i = 0; i < v.size(); i ++ )
        cout << v[i] << " ";

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
#define ld long double
using namespace std;
const ll N = 1e6;
ll m, cnt, mO, n , x , h, sum , y,t, ans,z,res,mx, mnn = 1e9, q, r, l, o, n1, g,mn = 1e9, i,mxx, k;

pair<int, int>p[N];
string s,s1,s2, s3,s4;
vector<ll>v,v1,v2;
set<char>st;
set<char>::iterator it;
deque<int>d,d1,d2;
map<int, int>mp;
map<int , int>mpp;
int used[N];
char a , b;
int main()
{
      ios_base::sync_with_stdio(0);
      cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

      cin >> n ;
      ll a[n];
      for ( ll i = 0; i < n; i ++ )
      cin >> a[i], cnt += a[i];
      cnt /= n;
      for( int i = 0; i < n; i ++ )
      {
          if ( a[i] % cnt == 0 )
             v.pb ( i + 1 );
      }
      cout << v.size() << endl;
      for ( int i = 0; i < v.size(); i ++ )
        cout << v[i] << " ";

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
#define ld long double
using namespace std;
const ll N = 1e6;
ll m, cnt, mO, n , x , h, sum , y,t, ans,z,res,mx, mnn = 1e9, q, r, l, o, n1, g,mn = 1e9, i,mxx, k;

pair<int, int>p[N];
string s,s1,s2, s3,s4;
vector<ll>v,v1,v2;
set<char>st;
set<char>::iterator it;
deque<int>d,d1,d2;
map<int, int>mp;
map<int , int>mpp;
int used[N];
char a , b;
int main()
{
      ios_base::sync_with_stdio(0);
      cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

      cin >> n ;
      ll a[n];
      for ( ll i = 0; i < n; i ++ )
      cin >> a[i], cnt += a[i];
         if ( cnt % n == 0 ){
      cnt /= n;
      for( int i = 0; i < n; i ++ )
      {
          if ( a[i] == cnt )
             v.pb ( i + 1 );
      }
         }
      cout << v.size() << endl;
      for ( int i = 0; i < v.size(); i ++ )
        cout << v[i] << " ";

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    float a[n];
    vector <int> v;
    float sum=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    for(int i=0;i<n;i++)
    {
        float avg = (sum-a[i])/(n-1);
        if(avg==a[i])
        {
            v.push_back(i+1);
        }
    }
    cout<<v.size()<<"\n";
    for(int i=0;i<v.size();i++)
    cout<<v[i]<<" ";
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    float a[n];
    vector <int> v;
    double sum=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    for(int i=0;i<n;i++)
    {
        float avg = (sum-a[i])/(n-1);
        if(avg==a[i])
        {
            v.push_back(i+1);
        }
    }
    cout<<v.size()<<"\n";
    for(int i=0;i<v.size();i++)
    cout<<v[i]<<" ";
    return 0;

}


#include<iostream>
#include<vector>
using namespace std;
int cnt, sum, n;

int main() {
	cin >> n;
	vector<int>a(n + 1, 0);

	for (int i = 1; i <= n; ++i) cin >> a[i], sum += a[i];
	if (sum % n != 0) {
		cout << 0 << endl; return 0;
	}
	sum /= n;
	for (int i = 1; i <= n; ++i) if (a[i] == sum) cnt++;
	cout << cnt << endl;
	for (int i = 1; i <= n; ++i) if (a[i] == sum) cout << i << " ";
	cout << endl;
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <deque>
#include <numeric>

using namespace std;

typedef long long int lo;
#define fast ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(0);
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define inf (lo)1e9
#define N (lo)1e5 * 5
#define all(x) (x).begin(), (x).end()
#define ii pair<lo,lo>
#define iii pair<lo, pair<lo,lo> >
#define si pair<string,lo>
#define vi vector <lo>
#define vii vector <ii>

int main() {
    fast
    // freopen("in1.txt", "r", stdin);
    lo n;
    cin >> n;
    vi a(n);
    lo sum = 0;
    for(lo i = 0 ; i < n ; i++){
        cin >> a[i];
        sum += a[i];
    }
    vi ans;
    for(lo i = 0 ; i < n ; i++){
        if((double)a[i] == (sum - a[i]) / (double)(n - 1)){
            ans.pb(i);
        }
    }
    cout << ans.size() << endl;
    for(lo x : ans){
        cout << x + 1 << " ";
    }
    cout << endl;
    return 0;
}


// #include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long int lo;
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define FOR for(lo i = 0 ; i < n ; i++)
lo a,b,d,e,x,y,n,p,m,t,a1[500000],a2[500000],c;
lo k;
string s1,s2,s3;
queue <pair<lo,lo> > q;
priority_queue <lo> pq;
map <lo,lo> mp1;
vector <lo> v;
lo vis[100000];
lo top;
int main(){
	// codeforces Average Numbers
	// freopen("gir.gir","r",stdin);
	// freopen("cik.cik","w",stdout);
    cin >> n;
	for(lo i = 0 ; i < n ; i++){
		cin >> a1[i];
		y += a1[i];
	}
	for(lo i = 0 ; i < n ; i ++){
		if((y - a1[i]) / (n - 1) == a1[i]){
			v.pb(i + 1);
		}
	}
	cout << v.size() << endl;
	for(lo i = 0 ; i < (lo)v.size(); i++){
		cout << v[i] << " ";
	}
	return 0;
}
//1 8
//2 4
//3 4
//4 4


//#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <deque>
#include <numeric>

using namespace std;

typedef long long int lo;
#define fast ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(0);
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define inf (lo)1e9
#define N (lo)1e5 * 5
#define all(x) (x).begin(), (x).end()
#define ii pair<lo,lo>
#define iii pair<lo, pair<lo,lo> >
#define si pair<string,lo>
#define vi vector <lo>
#define vii vector <ii>

int main() {
    fast
    // freopen("in1.txt", "r", stdin);
    lo n;
    cin >> n;
    vi a(n);
    lo sum = 0;
    for(lo i = 0 ; i < n ; i++){
        cin >> a[i];
        sum += a[i];
    }
    vi ans;
    for(lo i = 0 ; i < n ; i++){
        if(a[i] == (sum - a[i]) / (n - 1)){
            ans.pb(i);
        }
    }
    cout << ans.size() << endl;
    for(lo x : ans){
        cout << x + 1 << " ";
    }
    cout << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF  = 0x3f3f3f3f;
const ll  mod  = 1e9 + 7;
const ll  maxn = 1e6 + 5;
const int N = 2e5 + 5;

ll n,a[N];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n;
	ll sum=0,cnt=0;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		sum+=a[i];
		cnt++;
	}
	vector<int>V;
	for(int i=1;i<=n;i++){
		if(sum==a[i]*cnt){
			V.push_back(i);
		}
	}
	cout<<V.size()<<'\n';
	for(auto c:V){
		cout<<c<<" ";
	}
	cout<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF  = 0x3f3f3f3f;
const ll  mod  = 1e9 + 7;
const ll  maxn = 1e6 + 5;
const int N = 2e5 + 5;

ll n,a[N];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n;
	ll sum=0;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		sum+=a[i];
	}
	double ave=sum/n;
	vector<int>V;
	for(int i=1;i<=n;i++){
		if(ave==a[i]){
			V.push_back(i);
		}
	}
	cout<<V.size()<<'\n';
	for(auto c:V){
		cout<<c<<" ";
	}
	cout<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
typedef long long ll;
#define rep(i, n)    for(ll i = 0; i < (n); ++i)
#define repA(i, a, n)  for(ll i = a; i <= (n); ++i)
#define repD(i, a, n)  for(ll i = a; i >= (n); --i)
#define vec(i, a)  for( auto i=a.begin();i != a.end(); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (ll)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define mp make_pair
#define pb push_back
#define fast  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define in  freopen("input.txt","r",stdin);
#define out freopen("output.txt","w",stdout);
#define sixfive in out
typedef long double ld;
typedef std::pair<ll, ll> pii;
typedef std::vector<ll> vi;
const ll MOD = 1e9 + 7;
ll n_bits(ll n ) { ll x= __builtin_popcount(n) ;return x ;}
int main()
{
    #ifndef ONLINE_JUDGE
    sixfive
    #endif
    fast
    ll t=1;
    //cin>>t;
    while(t--)
    {
        int n,count=0;
        cin>>n;
        ll sum=0;
        int a[n];
        int b[n],j=0;
        for(ll i=0;i<n;i++)
        {
            cin>>a[i];
            sum+=a[i];
        }

        for(ll i=0;i<n;i++)
        {
            if((double)a[i]==(double)(sum-a[i])/(n-1))
            {
                count++;
                b[j]=a[i];
                j++;

            }
        }
        if(count==0)
            cout<<"0";
        else
        {
        cout<<count<<endl;
        for(ll i=0;i<j;i++)
        {
            cout<<b[i]<<" ";
        }
    }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
#define ff first
#define ss second
typedef pair< ll, ll > ii;
#define rep(i, a, b) for(ll i =a; i<b; i++)
#define pb push_back
typedef std::vector<ll> vi;
const ll mod = 1000000007;               //1e9+7

bool mycompare(pair<int, int> a, pair<int, int> b){
    return b.ss>a.ss;
}

int main(){
      string str;
      int k;
      cin>>str>>k;
      int res = 0;
      vector<pair<int, int>> freq(26, {0,0});
      rep(i, 0, 26){
            freq[i].ff = i;
      }
      rep(i, 0, str.size()){
            freq[str[i] - 'a'].ss++;
      }
      rep(i, 0, 26){
          if(freq[i].ss>0) res++;
      }
      sort(freq.begin(), freq.end(), mycompare);

      vi rem(26, 0);
      rep(i, 0, 26){
            if(freq[i].ss<=k && freq[i].ss>0){
                  rem[freq[i].ff] = 1;
                  k-= freq[i].ss;
                  res--;
            }
      }
      cout<<res<<endl;
      rep(i, 0, str.size()){
            if(rem[str[i] - 'a'] == 0){
                  cout<<str[i];
            }
      }
}


#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
typedef long long ll;
#define rep(i, n)    for(ll i = 0; i < (n); ++i)
#define repA(i, a, n)  for(ll i = a; i <= (n); ++i)
#define repD(i, a, n)  for(ll i = a; i >= (n); --i)
#define vec(i, a)  for( auto i=a.begin();i != a.end(); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (ll)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define mp make_pair
#define pb push_back
#define fast  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define in  freopen("input.txt","r",stdin);
#define out freopen("output.txt","w",stdout);
#define sixfive in out
typedef long double ld;
typedef std::pair<ll, ll> pii;
typedef std::vector<ll> vi;
const ll MOD = 1e9 + 7;
ll n_bits(ll n ) { ll x= __builtin_popcount(n) ;return x ;}
int main()
{
    #ifndef ONLINE_JUDGE
    sixfive
    #endif
    fast
    ll t=1;
    //cin>>t;
    while(t--)
    {
        int n,count=0;
        cin>>n;
        ll sum=0;
        int a[n];
        int b[n],j=0;
        for(ll i=0;i<n;i++)
        {
            cin>>a[i];
            sum+=a[i];
        }

        for(ll i=0;i<n;i++)
        {
            if((double)a[i]==(double)(sum-a[i])/(n-1))
            {
                count++;
                b[j]=i+1;
                j++;

            }
        }
        if(count==0)
            cout<<"0";
        else
        {
        cout<<count<<endl;
        for(ll i=0;i<j;i++)
        {
            cout<<b[i]<<" ";
        }
    }
    }
    return 0;
}


#include<stdio.h>
int M[200000];
int A[200000];
int main(){
	int n;
	while (scanf("%d", &n) == 1){

		int count = 0;
		int Sum = 0;
		for (int i = 0; i < n; i++){
			scanf("%d", &M[i]);
			Sum += M[i];
		}
		for (int i = 0; i < n; i++){
			if ((double)(Sum - M[i]) / (n - 1) == M[i])
				A[count++] = i + 1;
		}
		printf("%d\n", count);
		if (count>0)
			printf("%d", A[0]);
		for (int i = 1; i < count; i++)
			printf(" %d", A[i]);
		putchar('\n');
	}
	return 0;
}


#include<stdio.h>
int main()
{
    long long int n,s=0,l=0,m=0,i,d;
    scanf("%lld",&n);
    long long int a[n],b[n];
    for(i=0;i<n;i++)
    {
        scanf("%lld",&a[i]);
        s+=a[i];
    }
    d=s/n;
    for(i=0;i<n;i++)
    {
        if(a[i]==d)
        {
            l++;
            b[m]=i+1;
            m++;
        }
    }
    if(l!=0){
    printf("%lld\n",l);
    for(i=0;i<m;i++)
        printf("%lld ",b[i]);
    }
    else if(l==0)
        printf("%lld\n",l);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
    int n;
    cin >> n;
    int a[n], s = 0;
    for (int i = 0; i < n; i++){
        cin >> a[i];
        s = a[i];
    }
    if (s % n){
        cout << 0;
        return 0;
    }
    vector <int> b;
    for (int i = 0; i < n; i++){
        if (a[i] == s / n){
            b.push_back(i + 1);
        }
    }
    cout << b.size();
    if (b.size() == 0){
        return 0;
    }
    cout << endl;
    for (int i = 0; i < b.size(); i++){
        cout << b[i] << ' ';
    }
}


#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
    int n;
    cin >> n;
    int a[n], s = 0;
    for (int i = 0; i < n; i++){
        cin >> a[i];
        s += a[i];
    }
    if (s % n){
        cout << 0;
        return 0;
    }
    vector <int> b;
    for (int i = 0; i < n; i++){
        if (a[i] == s / n){
            b.push_back(i + 1);
        }
    }
    cout << b.size();
    if (b.size() == 0){
        return 0;
    }
    cout << endl;
    for (int i = 0; i < b.size(); i++){
        cout << b[i] << ' ';
    }
}


/*GOD     IS    GREAT
  AND     SO    AM    I*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define op(z) cout<<z
#define ops(z) cout<<z<<" "
int main()
{
    ll n,i,j;
    cin>>n;
    ll a[n],sum=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    ll h[n]={0};
    j=0;
    ll u=0;
    for(i=0;i<n;i++)
    {
        if((double)(sum-a[i])/(n-1)==a[i])
        {
        h[j]=i+1;
        j++;
        u++;
        }
    }
    op(u)<<endl;
    for(i=0;i<n;i++)
    {
        if(h[i]!=0)ops(h[i]);
    }
}


/*GOD     IS    GREAT
  AND     SO    AM    I*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define op(z) cout<<z
#define ops(z) cout<<z<<" "
int main()
{
    ll n,i,j;
    cin>>n;
    ll a[n],sum=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    ll h[n]={0};
    j=0;ll u=0;
    for(i=0;i<n;i++)
    {
        if((sum-a[i])/(n-1)==a[i])
        {
        h[j]=i+1;
        j++;
        u++;
        }
    }
    sort(h,h+n);
    op(u)<<endl;
    for(i=0;i<n;i++)
    {
        if(h[i]!=0)ops(h[i]);
    }
}


/*GOD     IS    GREAT
  AND     SO    AM    I*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define op(z) cout<<z
#define ops(z) cout<<z<<" "
int main()
{
    ll n,i,j;
    cin>>n;
    ll a[n],sum=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    ll h[n]={0};
    j=0;
    ll u=0;
    for(i=0;i<n;i++)
    {
        if((sum-a[i])/(n-1)==a[i])
        {
        h[j]=i+1;
        j++;
        u++;
        }
    }
    op(u)<<endl;
    for(i=0;i<n;i++)
    {
        if(h[i]!=0)ops(h[i]);
    }
}


#include <iostream>
#include <vector>

using namespace std;

typedef vector<int> vi;

int main()
{
    int n;
    cin >> n;

    int sum = 0;
    int a[n];
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        sum += a[i];
    }

    int am = sum / n;
    vi res;
    for (int i = 0; i < n; ++i)
    {
        if (a[i] == am)
            res.push_back(i + 1);
    }

    cout << res.size() << endl;
    for (int i = 0; i < res.size(); ++i)
        cout << res[i] << ' ';
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;

typedef vector<int> vi;

int main()
{
    int n;
    cin >> n;

    int sum = 0;
    int a[n];
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        sum += a[i];
    }

    int am = sum / n;
    vi res;
    for (int i = 0; i < n; ++i)
    {
        if (a[i] == am)
            res.push_back(i + 1);
    }

    cout << res.size() << endl;
    if (res.size())
        for (int i = 0; i < res.size(); ++i)
            cout << res[i] << ' ';
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;

typedef vector<int> vi;

int main()
{
    int n;
    cin >> n;

    int sum = 0;
    int a[n];
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        sum += a[i];
    }

    vi res;
    for (int i = 0; i < n; ++i)
    {
        bool ok = (sum - a[i]) % (n - 1) == 0;
        if (ok && a[i] == (sum - a[i]) / (n - 1))
            res.push_back(i + 1);
    }

    cout << res.size();
    if (res.size())
    {
        cout << endl;
        for (int i = 0; i < res.size(); ++i)
            cout << res[i] << ' ';
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;

typedef vector<int> vi;

int main()
{
    int n;
    cin >> n;

    int sum = 0;
    int a[n];
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        sum += a[i];
    }

    vi res;
    for (int i = 0; i < n; ++i)
    {
        if (a[i] == (sum - a[i]) / (n - 1))
            res.push_back(i + 1);
    }

    cout << res.size();
    if (res.size())
    {
        cout << endl;
        for (int i = 0; i < res.size(); ++i)
            cout << res[i] << ' ';
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;

typedef vector<int> vi;

int main()
{
    int n;
    cin >> n;

    int sum = 0;
    int a[n];
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        sum += a[i];
    }

    int am = sum / n;
    vi res;
    for (int i = 0; i < n; ++i)
    {
        if (a[i] == am)
            res.push_back(i + 1);
    }

    cout << res.size();
    if (res.size())
    {
        cout << endl;
        for (int i = 0; i < res.size(); ++i)
            cout << res[i] << ' ';
    }
    return 0;
}


#include<bits/stdc++.h>
#define N 1000
using namespace std;
int main()
{
    int n,i,j;
    int ar[N],pr[N];
    scanf("%d",&n);

    long long int sum=0;
    for(i=0;i<n;i++)
    {
         scanf("%d",&ar[i]);
        sum+=ar[i];

    }
    long long int x;
    for(i=0,j=0;i<n;i++){
        x=sum-ar[i];
        if((x/(n-1)==ar[i])){
            pr[j]=i+1;
            j++;
        }
    }
    printf("%d\n",j);
    for(i=0;i<j;i++)printf("%d ",pr[i]);
    return 0;
}


#include<bits/stdc++.h>
#define N 200005
using namespace std;
int main()
{
    int n,i,j;
    int ar[N],pr[N];
    scanf("%d",&n);

    long long int sum=0;
    for(i=0;i<n;i++)
    {
         scanf("%d",&ar[i]);
        sum+=ar[i];

    }
    long long int x;
    for(i=0,j=0;i<n;i++){
        x=sum-ar[i];
        if((x/(n-1)==ar[i])){
            pr[j]=i+1;
            j++;
        }
    }
    printf("%d\n",j);
    for(i=0;i<j;i++)printf("%d ",pr[i]);
    return 0;
}


#include<bits/stdc++.h>
#define N 100005
using namespace std;
int main()
{
    int n,i,j;
    int ar[N],pr[N];
    scanf("%d",&n);

    long long int sum=0;
    for(i=0;i<n;i++)
    {
         scanf("%d",&ar[i]);
        sum+=ar[i];

    }
    long long int x;
    for(i=0,j=0;i<n;i++){
        x=sum-ar[i];
        if((x/(n-1)==ar[i])){
            pr[j]=i+1;
            j++;
        }
    }
    printf("%d\n",j);
    for(i=0;i<j;i++)printf("%d ",pr[i]);
    return 0;
}


#include<bits/stdc++.h>
#define N 200005
using namespace std;
int main()
{
    int n,i,j;
    int ar[N],pr[N];
    scanf("%d",&n);

    long long int sum=0;
    for(i=0;i<n;i++)
    {
         scanf("%d",&ar[i]);
        sum+=ar[i];

    }
    long long int x;
    for(i=0,j=0;i<n;i++){
        x=sum-ar[i];
        if(x==(ar[i]*(n-1))){
            pr[j]=i+1;
            j++;
        }
    }
    printf("%d\n",j);
    for(i=0;i<j;i++)printf("%d ",pr[i]);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define vec vector <int>
#define pb push_back
#define endl "\n"

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
	   freopen("input.txt", "r", stdin);
	   clock_t time_start = clock();
	#endif

	int n, x, s = 0;
	cin >> n;
	vec v;
	for (int i = 0; i < n; ++i) {
		cin >> x;
		s += x;
		v.pb(x);
	}
	vec a;
	for (int i = 0; i < n; ++i) {
		if (v.at(i) == (s - v.at(i)) / (n - 1)) {
			a.pb(i + 1);
		}
	}
	cout << a.size() << endl;
	for (int i = 0; i < a.size(); ++i) {
		cout << a.at(i) << " ";
	}

	#ifndef ONLINE_JUDGE
		cout << "Runtime: " << fixed << setprecision(6) << (long double) (clock() - time_start) / CLOCKS_PER_SEC << " seconds" << endl;
	#endif
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define vec vector <int>
#define pb push_back
#define endl "\n"

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
	   freopen("input.txt", "r", stdin);
	   clock_t time_start = clock();
	#endif

	int n, x, s = 0;
	cin >> n;
	vec v;
	for (int i = 0; i < n; ++i) {
		cin >> x;
		s += x;
		v.pb(x);
	}
	vec a;
	for (int i = 0; i < n; ++i) {
		if (v.at(i) * (n - 1) == s - v.at(i)) {
			a.pb(i + 1);
		}
	}
	cout << a.size() << endl;
	for (int i = 0; i < a.size(); ++i) {
		cout << a.at(i) << " ";
	}

	#ifndef ONLINE_JUDGE
		cout << "Runtime: " << fixed << setprecision(6) << (long double) (clock() - time_start) / CLOCKS_PER_SEC << " seconds" << endl;
	#endif
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(int argc, char const *argv[])
{
	int n;
	cin>>n;
	int a[n],sum=0;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		sum+=a[i];
	}
	int cnt=0;
	std::vector<int> v;
	for (int i = 0; i < n; ++i)
	{
		if((sum-a[i])/(n-1)==a[i] and (sum-a[i])%(n-1)==0){
			cnt++;
			v.push_back(i+1);
		}
	}
	cout<<cnt<<'\n';
	sort(v.begin(), v.end());
	for(auto x:v){
		cout<<x<<" ";
	}
	cout<<'\n';

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){

    ll n;
    cin>>n;
    vector<int> a(n);
    for(ll i=0;i<n;++i){
        cin>>a[i];
    }

    ll cnt=0;
    ll sum=0;
    vector<int> ind;
    for (ll i = 0; i < n; i++)
    {
        sum+=a[i];

    }
    for(ll i=0;i<n;++i){

        if (((sum-a[i])/(n-1))==a[i])
        {
            cnt++;
            ind.push_back(i+1);
        }
    }
    if(cnt==0){
        cout<<cnt<<endl;}
    else{
        cout<<cnt<<endl;
        for(auto x:ind){
            cout<<x<<" ";
        }
        cout<<endl;
    }

    return 0;

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){

    int n;
    cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;++i){
        cin>>a[i];
    }

    int cnt=0;
    int sum=0;
    vector<int> ind;
    for (int i = 0; i < n; i++)
    {
        sum+=a[i];

    }
    for(int i=0;i<n;++i){

        if (((sum-a[i])/(n-1))==a[i])
        {
            cnt++;
            ind.push_back(i+1);
        }
    }
    cout<<cnt<<endl;
    for(auto x:ind){
        cout<<x<<" ";
    }
    cout<<endl;
    return 0;

}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(int argc, char const *argv[])
{
	int n;
	cin>>n;
	int a[n],sum=0;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		sum+=a[i];
	}
	int cnt=0;
	std::vector<int> v;
	for (int i = 0; i < n; ++i)
	{
		if((sum-a[i])/(n-1)==a[i]){
			cnt++;
			v.push_back(i+1);
		}
	}
	cout<<cnt<<'\n';
	sort(v.begin(), v.end());
	for(auto x:v){
		cout<<x<<" ";
	}
	cout<<'\n';

	return 0;
}


#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	long long n, i, j, k, s;
	cin >> n;
	vector<long long> a(n + 1), ans;
	s = 0;
	for (i = 1; i <= n; i++) {
		cin >> a[i];
		s += a[i];
	}
	for (i = 1; i <= n; i++) {
		if (a[i] * n == s) ans.push_back(i);
	}

	cout << ans.size() << "\n";
	for (auto p : ans) cout << p << " ";

	return 0;
}


#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	long long n, i, j, k, s;
	cin >> n;
	vector<long long> a(n + 1), ans;
	s = 0;
	for (i = 1; i <= n; i++) {
		cin >> a[i];
		s += a[i];
	}
	for (i = 1; i <= n; i++) {
		if (a[i] * n == s) ans.push_back(i);
	}
	for (auto p : ans) cout << p << " ";

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int arr[n];
    int sum=0;
    int f=0;
    vector<int> avg;
    for(int i=0; i<n; i++){
        int a;
        cin>>a;
        arr[i]=a;

        sum+=arr[i];

    }
    for(int i=0; i<n; i++){
        if(arr[i]>1000){
            f=1;
            break;
        }
    }
    if(f==1){
        cout<<0;
    }
    else{
        for(int i=0; i<n; i++){
            int s;
            s=sum-arr[i];
            if(s/(n-1)==arr[i]){
                avg.push_back(i+1);
            }
        }
        cout<<avg.size()<<endl;
        for(int i=0; i<avg.size();i++){
            cout<<avg[i]<<" ";
        }
    }
        return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int arr[n];
    int sum=0,f=0;
    vector<int> avg;
    for(int i=0; i<n; i++){
        cin>>arr[i];
        if(arr[i]>1000){
            f=1;
            break;
        }
        else{
            sum+=arr[i];
        }
    }
    if(f==1){
        cout<<0;
    }
    else{
        for(int i=0; i<n; i++){
            int s;
            s=sum-arr[i];
            if(s/(n-1)==arr[i]){
                avg.push_back(i+1);
            }
        }
        cout<<avg.size()<<endl;
        for(int i=0; i<avg.size();i++){
            cout<<avg[i]<<" ";
        }
    }
        return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n;
    cin>>n;
    long long int arr[n];
    long long int sum=0;
    int f=0;
    vector<int> avg;
    for(int i=0; i<n; i++){
        long long int a;
        cin>>a;
        arr[i]=a;

        sum+=arr[i];

    }
    for(int i=0; i<n; i++){
        if(arr[i]>1000){
            f=1;
            break;
        }
    }
    if(f==1){
        cout<<0;

    }
    else if(f==0){
        for(int i=0; i<n; i++){
            long long int s;
            s=sum-arr[i];
            if(s/(n-1)==arr[i]){
                avg.push_back(i+1);
            }
        }
        cout<<avg.size()<<endl;
        for(int i=0; i<avg.size();i++){
            cout<<avg[i]<<" ";
        }
    }
        return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int arr[n];
    int sum=0;
    vector<int> avg;
    for(int i=0; i<n; i++){
        cin>>arr[i];
        sum+=arr[i];
    }
    for(int i=0; i<n; i++){
        int s;
        s=sum-arr[i];
        if(s/(n-1)==arr[i]){
            avg.push_back(i+1);
        }
    }
    cout<<avg.size()<<endl;
    for(int i=0; i<avg.size();i++){
        cout<<avg[i]<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n;
    cin>>n;
    long double arr[n];
    long double sum=0;
    int f=0;
    vector<int> avg;
    for(int i=0; i<n; i++){
        long double a;
        cin>>a;
        arr[i]=a;

        sum+=arr[i];

    }
    for(int i=0; i<n; i++){
        if(arr[i]>1000){
            f=1;
            break;
        }
    }
    if(f==1){
        cout<<0;

    }
    else if(f==0){
        for(int i=0; i<n; i++){
            long double s;
            s=sum-arr[i];
            if(s/(n-1)==arr[i]){
                avg.push_back(i+1);
            }
        }
        cout<<avg.size()<<endl;
        for(int i=0; i<avg.size();i++){
            cout<<avg[i]<<" ";
        }
    }
        return 0;
}


#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef long long ll;
int main()
{
    int n;
    scanf("%I32d", &n);
    int a[n];
    ll cnt=0;
    for(int i=0; i<n; i++)
        scanf("%I32d", &a[i]),cnt+=a[i];
    deque<int> dq;
    for(int i=0; i<n; i++)
        if((cnt-a[i])/(n-1)==a[i])
            dq.push_back(i+1);
    if(!dq.size())
    {
        printf("0\n");
        return 0;
    }
    printf("%I32d\n%I32d", dq.size(), dq[0]);
    for(int i=1; i<dq.size(); i++)
        printf(" %I32d", dq[i]);
    printf("\n");
}


#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef long long ll;
int main()
{
    int n;
    scanf("%I32d", &n);
    int a[n];
    ll cnt=0;
    for(int i=0; i<n; i++)
        scanf("%I32d", &a[i]),cnt+=a[i];
    deque<int> dq;
    for(int i=0; i<n; i++)
        if((cnt-a[i])/(n-1)==a[i] && !((cnt-a[i])%(n-1)))
            dq.push_back(i+1);
    if(!dq.size())
    {
        printf("0\n");
        return 0;
    }
    printf("%I32d\n%I32d", dq.size(), dq[0]);
    for(int i=1; i<dq.size(); i++)
        printf(" %I32d", dq[i]);
    printf("\n");
}


#include <bits/stdc++.h>
using namespace std;
//#define m 1000000
#define ll long long
const ll inf=(1LL<<60)-1;
vector<ll>vo,ve;
//set<ll>s;
map<char,int>mp;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll x,y,n,m,l,t;
//string s,ans;
void solve()
{

    cin>>n;
    double a[n+5];
    double y=0;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
        y+=a[i];
    }
    //cout<<y<<endl;
    //cout<<y;
    for(int i=1; i<=n; i++)
    {
        double x=y-a[i];
        double l=x/(n-1);
        if(a[i]==l)
            {
                t++;
                ve.push_back(i);
            }
    }
    cout<<t<<endl;
    for(int i=0; i<t; i++)
        cout<<ve[i]<<" ";

}
int main()
{
    IOS;
    solve();
    return 0;
}
//33g5iazc


#include <bits/stdc++.h>
using namespace std;
//#define m 1000000
#define ll long long
const ll inf=(1LL<<60)-1;
vector<ll>vo,ve;
//set<ll>s;
map<char,int>mp;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll x,y,n,m,l,t;
//string s,ans;
void solve()
{
    cin>>n;
    ll a[n+5];
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
        y+=a[i];
    }
    //cout<<y<<endl;
    y/=n;
    //cout<<y;
    for(int i=1; i<=n; i++)
    {
        if(a[i]==y)
            {
                t++;
                ve.push_back(i);
            }
    }
    cout<<t<<endl;
    for(int i=0; i<t; i++)
        cout<<ve[i]<<" ";

}
int main()
{
    IOS;
    solve();
    return 0;
}
//33g5iazc


#include <iostream>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include<vector>
#include <iterator>
using namespace std;

int main ()
{
    double n;
    long double sum=0;
    int count=0;
    cin>>n;
    int arr[10000000], index[10000000];
    for (int i=0; i<n; i++)
        {
            cin>>arr[i];
            index[i]=0;
            sum=sum+arr[i];
    }

    for (int j=0;j<n; j++)
        {

            if(arr[j]==(sum-arr[j])/(n-1))
                {
                    count++;
                    index[j]=1;
                }
            }

   cout<<count<<endl;
   for (int k=0; k<n;k++)
    {
        if (index[k]==1)
        cout<<k+1<<" ";
    }

    return 0;
}


#include <iostream>
using namespace std;

int main(){

    int n;
    cin >> n;
    int *x = new int[n];
    int total = 0;
    for (int i = 0; i < n; i++){
        cin >> x[i];
        total += x[i];
    }
    float avg = (float) total / n;

    for (int i = 0; i < n; i++){
        if (x[i] == avg)cout << i + 1;
    }

    return 0;
}


#include <iostream>
using namespace std;

int main(){

    int n;
    cin >> n;
    int *x = new int[n];
    int total = 0;
    for (int i = 0; i < n; i++){
        cin >> x[i];
        total += x[i];
    }
    float avg = (float) total / n;
    int c = 0;
    int *y = new int[n];
    int j=0;
    for (int i = 0; i < n; i++){
        if (x[i] == avg){ c++; y[j] = i + 1; j++; }
    }
    cout << c<<endl;
    for (int i = 0; i<j; i++){
        cout << y[i] << " ";
    }

    return 0;
}


#include <iostream>
using namespace std;

int main(){

    int n;
    cin >> n;
    int *x = new int[n];
    int total = 0;
    for (int i = 0; i < n; i++){
        cin >> x[i];
        total += x[i];
    }
    float avg = (float) total / n;
    int c = 0;
    int *y = new int[n];
    for (int i = 0,j=0; i < n; i++){
        if (x[i] == avg){ c++; y[j] = i + 1; j++; }
    }
    cout << c<<endl;
    for (int i = 0; y[i]>0; i++){
        cout << y[i] << " ";
    }

    return 0;
}


#include <iostream>
using namespace std;

int main(){

    int n;
    cin >> n;
    int *x = new int[n];
    int total = 0;
    for (int i = 0; i < n; i++){
        cin >> x[i];
        total += x[i];
    }
    float avg = (float) total / n;
    int c = 0;
    int *y = new int[n];
    for (int i = 0,j=0; i < n; i++){
        if (x[i] == avg){ c++; y[j] = i + 1; j++; }
    }
    cout << c<<endl;
    for (int i = 0; y[i]>0 && i<n; i++){
        cout << y[i] << " ";
    }

    return 0;
}


#include "vector"
#include "string"
#include "set"
#include "map"
#include "sstream"
#include "algorithm"
#include "cmath"
#include "cassert"
#include "iostream"
#include "numeric"
#include "fstream"
#include "queue"
#include <functional>
#include  <climits>
#include   <cstring>
#include <list>
#include  <iomanip>

#ifdef __GNUC__
#include  <tr1/unordered_map>
#define unordered_map tr1::unordered_map
#else
#include <unordered_map>
#endif

using namespace std;

#define int64 long long
#define F(vec, index) for (int index = 0; index  < vec.size(); ++index)
#define F2(index, vec) for (int index = 0; index  < vec.size(); ++index)
#define F3(index, from, vec) for (int index = from + 1; index  < vec.size(); ++index)

int main(int argc, char* argv[])
{
	int n;
	cin >> n;
	vector<int64> data(n);
	F2(i, data) cin >> data[i];

	int64 s = accumulate(data.begin(), data.end(), 0);

	double avg = double(s) / n;

	int c = 0;
	F2(i, data)
	{
		if (abs(data[i] - avg) < 0.001) c++;
	}
	cout << c << endl;

	F2(i, data)
	{
		if (abs(data[i] - avg) < 0.001) cout << i + 1 << " ";
	}

	return 0;
}


#include<iostream>
using namespace std;
int a[210000];
int b[210000];
int main()
{
    double n; cin >> n; long double sum = 0; int ans = 0;
    for (int i = 0; i < n; i++){cin >> a[i]; sum += a[i];}
    for (int i = 0; i < n; i++)
    if ((sum - a[i]) / (n - 1) == a[i])
    {
        b[ans] =i+1;
        ans++;
    }
    cout << ans<<endl;
    for (int i = 0; i < ans; i++)cout << b[i] << " ";
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cmath>
#include <set>

using namespace std;

int main()
{
	vector <long > v,v1;
	long n,m,i,j,a,b=0;

	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a;
		v.push_back(a);
		b+=a;
	}

	for(i=0;i<n;i++)
	{
		if(v[i]==(b-v[i])/(n-1))
			v1.push_back(i+1);
	}

	cout<<v1.size()<<endl;
	for(i=0;i<v1.size();i++)
		cout<<v1[i]<<" ";
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cmath>
#include <set>

using namespace std;

int main()
{
	vector <double> v,v1;
	long n,m,i,j;
	double a,b=0;

	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a;
		v.push_back(a);
		b+=a;
	}

	for(i=0;i<n;i++)
	{
		if(v[i]==(b-v[i])/(n-1))
			v1.push_back(i+1);
	}

	cout<<v1.size()<<endl;
	for(i=0;i<v1.size();i++)
		cout<<v1[i]<<" ";
	return 0;
}