Erelong Leha was bored by calculating of the greatest common divisor of two factorials. Therefore he decided to solve some crosswords. It's well known that it is a very interesting occupation though it can be very difficult from time to time. In the course of solving one of the crosswords, Leha had to solve a simple task. You are able to do it too, aren't you?

Leha has two strings s and t. The hacker wants to change the string s at such way, that it can be found in t as a substring. All the changes should be the following: Leha chooses one position in the string s and replaces the symbol in this position with the question mark "?". The hacker is sure that the question mark in comparison can play the role of an arbitrary symbol. For example, if he gets string s="ab?b" as a result, it will appear in t="aabrbb" as a substring.

Guaranteed that the length of the string s doesn't exceed the length of the string t. Help the hacker to replace in s as few symbols as possible so that the result of the replacements can be found in t as a substring. The symbol "?" should be considered equal to any other symbol.


-----Input-----

The first line contains two integers n and m (1 ≤ n ≤ m ≤ 1000) — the length of the string s and the length of the string t correspondingly.

The second line contains n lowercase English letters — string s.

The third line contains m lowercase English letters — string t.


-----Output-----

In the first line print single integer k — the minimal number of symbols that need to be replaced.

In the second line print k distinct integers denoting the positions of symbols in the string s which need to be replaced. Print the positions in any order. If there are several solutions print any of them. The numbering of the positions begins from one.


-----Examples-----
Input
3 5
abc
xaybz

Output
2
2 3 

Input
4 10
abcd
ebceabazcd

Output
1
2

Difficulty: EASY
Tags: String algorithms

Implementation

Complete search
Skill types: Complete search

Starter code:

Solutions:
(n, m) = list(map(int, input().split()))
s = str(input())
t = str(input())
a = n
b = 0
for i in range(0, m - n + 1):
	d = 0
	for j in range(0, n):
		if t[i + j] != s[j]:
			d = d + 1
	if d < a:
		a = d
		b = i
print(a)
for j in range(0, n):
	if t[b + j] != s[j]:
		print(j + 1)


(a, b) = map(int, input().split())
s = str(input())
t = str(input())
main = []
for i in range(b - a + 1):
	c = 0
	p = []
	for j in range(a):
		if t[i] != s[j]:
			c += 1
			p.append(j)
		i += 1
	p.insert(0, c)
	main.append(p)
main.sort()
print(main[0][0])
for t in main[0][1:]:
	print(t + 1, end=' ')
print('\r')


from math import inf

def diff(s, t):
	ans = 0
	for i in range(len(s)):
		if s[i] != t[i]:
			ans += 1
	return ans
(n, m) = map(int, input().split())
s = input()
t = input()
ans = inf
index = 0
selected_string = t[0:n]
for i in range(m - n + 1):
	sub = t[i:i + n]
	calc_diff = diff(sub, s)
	if calc_diff < ans:
		ans = calc_diff
		index = i
		selected_string = sub
print(ans)
for i in range(n):
	if s[i] != selected_string[i]:
		print(i + 1, end=' ')
print()


[n, m] = [int(x) for x in input().split()]
s = input()
t = input()
(bst, idx) = (0, 0)
for i in range(m - n + 1):
	ac = 0
	for j in range(n):
		ac += int(s[j] == t[i + j])
	if ac > bst:
		bst = ac
		idx = i
ans = [str(k + 1) for (k, x) in enumerate(s) if s[k] != t[idx + k]]
print('\n'.join([str(len(ans)), ' '.join(ans)]))


(n, m) = list(map(int, input().split()))
s = input()
t = input()
equals = []
for i in range(m - n + 1):
	(j, equal) = (0, 0)
	while j < n:
		if t[i + j] == s[j]:
			equal += 1
		j += 1
	equals.append(equal)
index = equals.index(max(equals))
k = n - equals[index]
print(k)
if k > 0:
	j = 0
	answer = ''
	for i in range(index, index + n):
		if s[j] != t[i]:
			answer += str(j + 1) + ' '
		j += 1
	print(answer.strip())


(n, m) = map(int, input().split())
s = input()
t = input()
arr = []

def check(i):
	iter = 0
	arr.append([])
	arr[i].append(0)
	while iter < n:
		if t[i + iter] != s[iter]:
			arr[i][0] += 1
			arr[i].append(iter)
		iter += 1
for i in range(m - n + 1):
	check(i)
min = 20000000
for a in arr:
	if a[0] < min:
		min = a[0]
for a in arr:
	if a[0] == min:
		iter = 0
		while iter < len(a):
			if iter == 0:
				print(a[iter])
			if iter != 0:
				print(a[iter] + 1, end=' ')
			iter += 1
		break


(n, m) = list(map(int, input().split()))
s = input()
t = input()
res = 0
for i in range(m - n + 1):
	cnt = 0
	for j in range(n):
		if s[j] == t[i + j]:
			cnt += 1
	if cnt >= res:
		res = cnt
		idx = i
print(n - res)
for i in range(n):
	if s[i] != t[idx + i]:
		print(i + 1, end=' ')


def distance(a, b):
	return sum((1 for i in range(min(len(a), len(b))) if a[i] != b[i]))

def solve(inp, s, t):
	(n, m) = map(int, inp.split(' ', 1))
	best_shift = None
	best_distance = float('inf')
	for shift in range(m - n + 1):
		dist = distance(s, t[shift:shift + n])
		if dist < best_distance:
			best_shift = shift
			best_distance = dist
	positions = [i + 1 for i in range(n) if s[i] != t[best_shift + i]]
	return (best_distance, positions)
inp = input()
s = input()
t = input()
(k, positions) = solve(inp, s, t)
print(k)
print(' '.join(map(str, positions)))


I = lambda : list(map(int, input().split()))
(n, m) = I()
s = input()
t = input()

def diff(s, t, tpos):
	ans = []
	for (e, [i, j]) in enumerate(zip(s, t[tpos:][:len(s)])):
		if i != '?' and i != j:
			ans.append(e + 1)
	return ans
repl = [diff(s, t, i) for i in range(m - n + 1)]
repl.sort(key=lambda x: len(x))
print(len(repl[0]))
print(' '.join(map(str, repl[0])))


I = lambda : map(int, input().split())
(n, m) = I()
(s, t) = (input(), input())
res = 0
res_details = []
for i in range(m - n + 1):
	eq = 0
	detail = []
	for j in range(i, i + n):
		if not ord(s[j - i]) - ord(t[j]):
			eq += 1
		else:
			detail.append(j - i + 1)
	if eq >= res:
		res = eq
		res_details = list(detail)
print(n - res)
print(*res_details)


def Q3(entrada1, entrada2, entrada3):
	n = int(entrada1[0])
	m = int(entrada1[1])
	menorMudanca = n + 1
	numMudancas = 0
	indexMudancas = ''
	for i in range(0, m - n + 1):
		numMudancas = 0
		for j in range(n):
			if entrada2[j] != entrada3[i + j]:
				numMudancas += 1
		if menorMudanca > numMudancas:
			menorMudanca = numMudancas
			id = i
	if menorMudanca == n + 1:
		print('0')
	else:
		print(menorMudanca)
	for i in range(n):
		if entrada2[i] != entrada3[id + i]:
			indexMudancas += str(i + 1) + ' '
	print(indexMudancas.strip())
entrada1 = input().split(' ')
entrada2 = input()
entrada3 = input()
Q3(entrada1, entrada2, entrada3)


(n, me) = map(int, input().split())
a = input()
b = input()
m = 10000
c = 0
k = -1
d = []
final = d
for i in range(me - n + 1):
	k = i
	d = []
	c = 0
	for j in range(n):
		if a[j] != b[j + k]:
			d.append(j + 1)
			c += 1
	if m > c:
		final = d.copy()
		m = min(m, c)
print(m)
print(*final)


(n, m) = map(int, input().split())
s = input()
t = input()
ans = [i for i in range(1, n + 1)]
for i in range(m - n + 1):
	pos = []
	for j in range(n):
		if s[j] != t[i + j]:
			pos.append(j + 1)
	if len(pos) < len(ans):
		ans = pos
print(len(ans))
print(' '.join(map(str, ans)))


(n, m) = map(int, input().split())
s = input()
t = input()
i = 0
mi = []
ma = 1001
while i < m - n + 1:
	ki = []
	j = 0
	while j < n:
		p = i + j
		if s[j] != t[p]:
			ki.append(j + 1)
		j += 1
	if len(ki) < ma:
		ma = len(ki)
		mi = ki
	i += 1
print(len(mi))
print(' '.join([str(i) for i in mi]))


(n, m) = map(int, input().split())
s = input()
t = input()
i = 0
m = 0

def str_comp(s, t):
	i = 0
	count = 0
	while i < len(s):
		if s[i] == t[i]:
			count += 1
		i += 1
	return count
i = 0
while i <= len(t) - len(s):
	if str_comp(s, t[i:i + len(s)]) >= m:
		m = str_comp(s, t[i:i + len(s)])
		j = i
	i += 1
print(n - m)
h = t[j:j + len(s)]
i = 0
p = ''
if n - m != 0:
	i = 0
	while i < len(s):
		if s[i] != h[i]:
			p += str(i + 1) + ' '
		i += 1
	print(p)


from sys import *
num = float('inf')
pos = []
(n, m) = map(int, stdin.readline().split())
s = stdin.readline()
t = stdin.readline()
for i in range(m - n + 1):
	auxNum = 0
	auxPos = []
	for j in range(n):
		if s[j] != t[i + j]:
			auxNum += 1
			auxPos.append(j + 1)
	if auxNum < num:
		num = auxNum
		pos = auxPos
print(num)
print(' '.join(map(str, pos)))


(n, m) = map(int, input().split())
(s, t) = (input(), input())
r = [0] * (m + 1)
for i in range(m - n + 1):
	a = [j + 1 for (j, x) in enumerate(zip(s, t[i:i + n])) if x[0] != x[1]]
	if len(a) < len(r):
		r = a
print(len(r))
print(*r)


def subWord(lenWords, firstWord, secondWord):
	n = int(lenWords[0])
	m = int(lenWords[1])
	changes = 0
	changedPositions = ''
	minorChange = n + 1
	for i in range(0, m - n + 1):
		changes = 0
		for j in range(n):
			if firstWord[j] != secondWord[i + j]:
				changes += 1
		if minorChange > changes:
			minorChange = changes
			pos = i
	if minorChange == n + 1:
		print('0')
	else:
		print(minorChange)
	for i in range(n):
		if firstWord[i] != secondWord[pos + i]:
			changedPositions += str(i + 1) + ' '
	print(changedPositions.strip())
lenWords = input().split(' ')
firstWord = input()
secondWord = input()
subWord(lenWords, firstWord, secondWord)


(n, m) = map(int, input().split())
s = input()
c = input()
ar = [0] * (m + 1)
for i in range(m - n + 1):
	r = []
	for (x, y) in enumerate(zip(s, c[i:i + n])):
		if y[0] != y[1]:
			r.append(x + 1)
	if len(ar) > len(r):
		ar = r
print(len(ar))
print(*ar)


def cross_word(lens, lent, s, t):
	i = 0
	ans = []
	while i <= lent - lens:
		sub_ans = []
		change = 0
		sub = t[i:i + lens]
		for x in range(lens):
			if sub[x] != s[x]:
				sub_ans.append(x + 1)
				change += 1
		sub_ans.insert(0, change)
		ans.append(sub_ans)
		i += 1
	smallest = min([x[0] for x in ans])
	for k in ans:
		if k[0] == smallest:
			k = list(map(str, k))
			return str(k[0]) + '\n' + ' '.join(k[1:])
(lens, lent) = list(map(int, input().split()))
s = input()
t = input()
print(cross_word(lens, lent, s, t))


(n, m) = [int(x) for x in input().split()]
s = input()
t = input()
diff = []
positions = {}
for i in range(len(t) - len(s) + 1):
	diff.append(0)
	positions[i] = []
	for j in range(len(s)):
		if t[i + j] != s[j]:
			diff[i] += 1
			positions[i].append(j + 1)
print(min(diff))
ind = diff.index(min(diff))
positions_str = ''
for k in positions[ind]:
	positions_str += str(k) + ' '
print(positions_str)


def CalcDif(input: str):
	global answer, l1
	counter = 0
	l2 = []
	for i in range(0, input.__len__()):
		if input[i] != s[i]:
			counter += 1
			l2.append(int(i + 1))
	if counter <= answer:
		l1 = l2
		answer = counter
input()
s = input()
t = input()
answer = t.__len__()
l1 = []
for i in range(0, t.__len__() - s.__len__() + 1):
	CalcDif(t[i:i + s.__len__()])
print(answer)
for i in l1:
	print(i, end=' ')


(n, m) = map(int, input().split())
s = input()
t = input()
ans = float('+inf')
l = list()
for i in range(m - n + 1):
	j = 0
	temp = 0
	t_l = []
	while j < n:
		if s[j] == t[j + i]:
			temp += 1
		else:
			t_l.append(j + 1)
		j += 1
	if ans > n - temp:
		ans = n - temp
		l = t_l
print(ans)
print(*l)


line = input().split()
n = int(line[0])
m = int(line[1])
s = input()
t = input()
min = n + 1
A = []
for i in range(m - n + 1):
	ii = i
	L = []
	k = 0
	for j in range(len(s)):
		if t[ii] != s[j]:
			L.append(j + 1)
			k = k + 1
		ii = ii + 1
	if k < min:
		min = k
		A = L
print(min)
for i in range(len(A)):
	print(A[i], end=' ')
print()


(n, m) = map(int, input().split())
s = input()
t = input()
num = float('inf')
rec = []
for i in range(len(t) - len(s) + 1):
	tmp = 0
	tmp2 = []
	for j in range(len(s)):
		if s[j] != t[i + j]:
			tmp += 1
			tmp2.append(j + 1)
	if num > tmp:
		num = tmp
		rec = tmp2
print(num)
print(' '.join(map(str, rec)))


(n, m) = list(map(int, input().split()))
s = input()
t = input()
a = [i for i in range(len(s) + 1)]

def f(x, y):
	dif = []
	for i in range(len(x)):
		if x[i] != y[i]:
			dif.append(str(i + 1))
	return dif
for i in range(len(t) - len(s) + 1):
	u = f(s, t[i:i + len(s)])
	if len(u) < len(a):
		a = u
print(len(a))
print(' '.join(a))


(n, m) = map(int, input().split())
s = input()
t = input()
tot = 1000000000
pos = []
for k in range(m - n + 1):
	ctot = 0
	cpos = []
	for e in range(n):
		if s[e] != t[e + k]:
			cpos.append(e + 1)
			ctot += 1
	if ctot < tot:
		pos = cpos
		tot = ctot
print(tot)
print(*pos)


(n, m) = map(int, input().split())
s = input()
t = input()
l = []
mini = 10000
for i in range(0, len(t) - len(s) + 1):
	x = t[i:i + len(s)]
	ll = []
	for k in range(len(s)):
		if x[k] != s[k]:
			ll.append(k + 1)
	if len(ll) < mini:
		mini = len(ll)
		l = ll
print(mini)
for i in l:
	print(i, end=' ')
print()


(slen, tlen) = map(int, input().split())
s = input()
t = input()
mres = []
(c, mini) = (0, 10000)
for i in range(0, len(t) - len(s) + 1):
	c = 0
	res = []
	m = i
	for j in range(len(s)):
		if s[j] != t[m]:
			c += 1
			res.append(j + 1)
		m += 1
	if c < mini:
		mini = c
		mres = res
print(mini)
print(*mres)


lens = input().split()
s1 = input()
s2 = input()
min_count = int(lens[0])
min_answer = list()
for start in range(int(lens[1]) - int(lens[0]) + 1):
	diff = 0
	answer = list()
	for i in range(int(lens[0])):
		if s1[i] != s2[start + i]:
			diff += 1
			answer.append(str(i + 1))
	if diff <= min_count:
		min_count = diff
		min_answer = answer
print(min_count)
if min_count > 0:
	print(' '.join(min_answer))


(n, m) = map(int, input().split())
s = input()
t = input()
dist = float('inf')
index = 0
for i in range(m - n + 1):
	temp_dist = 0
	for j in range(n):
		if s[j] != t[j + i]:
			temp_dist += 1
	if temp_dist < dist:
		dist = min(temp_dist, dist)
		index = i
print(dist)
positions = []
for k in range(n):
	if s[k] != t[k + index]:
		positions.append(str(k + 1))
print(' '.join(positions))


(n, m) = map(int, input().split())
(s, t, k) = (str(input()), str(input()), ['2'] * 99999)
for i in range(m - n + 1):
	k1 = [str(j + 1) for j in range(n) if s[j] != t[i:i + n][j]]
	if len(k1) < len(k):
		k = k1
print(len(k), '\n' + ' '.join(k))


(n, m) = [int(n) for n in input().split()]
S = input()
T = input()
minD = n + 1
minMI = []
diff = 0
missedIndexes = []
for i in range(m - n + 1):
	for (j, s) in enumerate(S):
		if T[i + j] != s:
			diff += 1
			missedIndexes.append(j)
	if diff < minD:
		minD = diff
		minMI = missedIndexes
	diff = 0
	missedIndexes = []
print(minD)
print(' '.join([str(i + 1) for i in minMI]))


input()
s = input()
t = input()
count = len(s)
result = [i + 1 for i in range(0, len(s))]
for i in range(0, len(t) - len(s) + 1):
	replaces = []
	for j in range(0, len(s)):
		if s[j] != t[i + j]:
			replaces.append(j + 1)
	if len(replaces) < count:
		count = len(replaces)
		result = replaces
print(count)
for c in result:
	print(str(c) + ' ', end='')
print()


def menorNumeroSimbolos(s, t):
	posicoesMudadas = set()
	menorNumeroMudancas = len(s) + 1
	j = 0
	while j + len(s) - 1 < len(t):
		cont = 0
		posicoesTemporarias = set()
		for i in range(0, len(s)):
			if s[i] != t[i + j]:
				cont += 1
				posicoesTemporarias.add(i + 1)
		if cont < menorNumeroMudancas:
			menorNumeroMudancas = cont
			posicoesMudadas = posicoesTemporarias
		j += 1
	return posicoesMudadas
input()
s = list(input())
t = list(input())
posicoesMudadas = menorNumeroSimbolos(s, t)
print(len(posicoesMudadas))
print(*posicoesMudadas)


inputs = list(map(int, input().split()))
n = inputs[0]
m = inputs[1]
s = str(input())
t = str(input())
low = 1000000000.0
v = []
curr = []
ans = ''
for i in range(0, m - n + 1):
	for j in range(0, n):
		if s[j] != t[i + j]:
			curr.append(j + 1)
	if low > len(curr):
		low = len(curr)
		v = curr
	curr = []
for i in range(0, len(v)):
	ans += str(v[i]) + ' '
print(len(v))
print(ans)


(n, m) = map(int, input().split())
a = list(map(str, input()))
b = list(map(str, input()))
nl = []
maxi = 10 ** 9
for i in range(m - n + 1):
	c = 0
	l = []
	p = b[i:i + n]
	for j in range(n):
		if a[j] != p[j]:
			c += 1
			l.append(j + 1)
	if c < maxi:
		maxi = c
		nl = l
print(maxi)
print(*nl)


(x, y) = map(int, input().split())
s = input()
t = input()
l_b_r = list()
b_c = None
for i in range(y):
	if i + x <= y:
		l_r = list()
		c_c = 0
		for j in range(x):
			if s[j] != t[j + i]:
				c_c += 1
				l_r.append(j + 1)
		if b_c == None or c_c < b_c:
			b_c = c_c
			l_b_r = l_r
print(b_c)
print(' '.join((str(x) for x in l_b_r)))


(n, m) = map(int, input().split())
s = input()
t = input()
min_distinct = n
min_distinct_pos = [i for i in range(1, n + 1)]
start_pos = 0
for i in range(m - n + 1):
	distinct = 0
	distinct_pos = []
	for j in range(n):
		if s[j] != t[i + j]:
			distinct += 1
			distinct_pos.append(j + 1)
	if distinct < min_distinct:
		min_distinct = distinct
		min_distinct_pos = distinct_pos
		start_pos = i
print(min_distinct)
print(*min_distinct_pos)


(n, m) = map(int, input().split())
s = list(input())
t = list(input())
m = []
min = 10000
for i in range(len(t) - len(s) + 1):
	c = 0
	l = [0] * n
	for j in range(len(s)):
		if s[j] != t[i + j]:
			c += 1
			l[j] = 1
	if min > c:
		min = c
		m = l[:]
print(min)
for i in range(n):
	if m[i] == 1:
		print(i + 1, end=' ')


(n, m) = [int(x) for x in input().split()]
s = input()
t = input()
min_replace = -1
replace = []
for i in range(m - n + 1):
	for j in range(n):
		if s[j] != t[i + j]:
			replace.append(j)
	if min_replace == -1 or len(min_replace) > len(replace):
		min_replace = replace
	replace = []
print(len(min_replace))
print(' '.join([str(x + 1) for x in min_replace]))


import collections
d = collections.defaultdict(list)
(a, b) = map(int, input().split())
s = str(input())
t = str(input())
for i in range(b - a + 1):
	c = 0
	p = []
	for j in range(a):
		if t[i] != s[j]:
			c += 1
			p.append(j)
		i += 1
	d[c] = p
for t in sorted(d.items()):
	print(t[0])
	for k in t[1]:
		print(k + 1, end=' ')
	break


(len_padrao, len_texto) = map(int, input().split())
padrao = input()
texto = input()
positions = []
for i in range(len_texto - len_padrao + 1):
	tmp = []
	for j in range(len_padrao):
		if padrao[j] != texto[i + j]:
			tmp.append(j + 1)
	if len(tmp) < len(positions) or i == 0:
		positions = tmp
print(len(positions))
for i in positions:
	print(i, end=' ')
print()


def solve():
	(n, m) = map(int, input().split())
	s = input()
	t = input()
	result = [x for x in range(1, n + 1)]
	for i in range(m - n + 1):
		new_result = []
		for j in range(n):
			if s[j] != t[i + j]:
				new_result.append(j + 1)
		if len(new_result) < len(result):
			result = new_result
	print(len(result))
	print(*result)
solve()


(n, m) = map(int, input().split())
sn = str(input())
sm = str(input())
mn = n
l = []
for i in range(m - n + 1):
	e = 0
	k = []
	for j in range(n):
		if sm[i + j] != sn[j]:
			e += 1
			if e <= mn:
				k.append(str(j + 1))
			else:
				break
	if e <= mn:
		mn = len(k)
		l = k
print(mn)
print(' '.join(l))


import math
beg = input()
s = input()
t = input()
ans = ''
ansg = ''
tf = 0
tfg = 1000000
(a, b) = (int(x) for x in beg.split())
for i in range(0, b - a + 1):
	st = t[i:i + a]
	for j in range(a):
		if st[j] != s[j]:
			tf += 1
			ans += str(j + 1) + ' '
	if tf < tfg:
		tfg = tf
		ansg = ans
	ans = ''
	tf = 0
print(tfg)
print(ansg)


from sys import stdin, stdout

def rint():
	return map(int, stdin.readline().split())
(n, m) = rint()
s = input()
t = input()
minp = [0] * 1001
for i in range(m - n + 1):
	pos = []
	for j in range(len(s)):
		if s[j] != t[j + i]:
			pos.append(j + 1)
	if len(minp) > len(pos):
		minp = pos[:]
print(len(minp))
print(*minp)


line = input().split(' ')
s = input()
t = input()
lens = int(line[0])
lent = int(line[1])
start = 0
matchings = 0
for i in range(lent - lens + 1):
	tmatch = 0
	for j in range(lens):
		if s[j] == t[i + j]:
			tmatch += 1
	if matchings < tmatch:
		matchings = tmatch
		start = i
print(lens - matchings)
for i in range(lens):
	if s[i] != t[i + start]:
		print(i + 1, end=' ')


x = input()
t = input()
s = input()
t_tam = len(t)
s_tam = len(s)
cont = 2000
l = []
for i in range(s_tam - t_tam + 1):
	contAux = 0
	laux = []
	for j in range(t_tam):
		if t[j] != s[i + j]:
			contAux += 1
			laux.append(j + 1)
	if contAux < cont:
		cont = contAux
		l = laux
print(cont)
for i in l:
	print(i, end=' ')
print('')


[n, m] = map(int, input().split())
s = input()
t = input()
mi = n + m
ml = []
for i in range(m - n + 1):
	l = []
	for j in range(n):
		if s[j] != t[i + j]:
			l.append(j + 1)
	if len(l) < mi:
		mi = len(l)
		ml = l
print(mi)
for i in ml:
	print(i, end=' ')


(n, m) = map(int, input().split())
s = input()
t = input()
ansC = 10 ** 9
ans = []
i = 0
while i < m - n + 1:
	nowc = 0
	now = []
	for j in range(n):
		if s[j] == t[i + j]:
			continue
		nowc += 1
		now.append(j + 1)
	if nowc < ansC:
		ansC = nowc
		ans = now[:]
	i += 1
print(ansC)
print(*ans)


(n, x) = map(int, input().split(' '))
str1 = input()
str2 = input()
minimums = []

def similarWords(s):
	sim = 0
	changePos = []
	for el in range(n):
		if str1[el] == s[el]:
			sim += 1
		else:
			changePos.append(el + 1)
	return (n - sim, changePos)
for el in range(x - n + 1):
	minimums.append(similarWords(str2[el:el + n]))
minX = min(minimums)
print(str(minX[0]))
for el in minX[1]:
	print(str(el) + '', end=' ')


(n, m) = map(int, input().split())
(s, t, d) = (input(), input(), [0] * (n + 1))
for i in range(m - n + 1):
	C = [j + 1 for j in range(n) if s[j] != t[i + j]]
	if len(C) < len(d):
		d = C
print(len(d))
print(*d)


def distance(seq, aux):
	diff = []
	for i in range(len(seq)):
		if seq[i] != aux[i] and seq[i] != '?':
			diff.append(str(i + 1))
	return diff
(Ln, Lm) = input().split()
n = int(Ln)
m = int(Lm)
s = input()
t = input()
result = []
for i in range(m - n + 1):
	next = i + n
	aux = t[i:next]
	diff = []
	for i in range(len(s)):
		if s[i] != aux[i] and s[i] != '?':
			diff.append(str(i + 1))
	if len(diff) == 0:
		result = diff
		break
	if len(diff) < len(result) or result == []:
		result = diff
	diff = []
print(len(result))
print(' '.join(result))


def match(a, b, startingpos):
	assert len(a) == len(b)
	c = [None] * len(a)
	for i in range(len(a)):
		if a[i] == b[i]:
			c[i] = a[i]
		else:
			c[i] = '?'
	return [startingpos, c.count('?'), c]
(n, m) = [int(x) for x in input().split(' ')]
s = [x for x in input()]
t = [x for x in input()]
poss = []
for i in range(m - n + 1):
	poss.append(match(s, t[i:i + n], i))
poss.sort(key=lambda a: a[1])
print(poss[0][1])
for i in range(len(s)):
	if poss[0][2][i] == '?':
		print(i + 1, end=' ')
print()


(n, m) = map(int, input().split())
(s, t) = (input(), input())
ans = [i + 1 for i in range(n)]
for i in range(m - n + 1):
	tt = t[i:i + n]
	cur = []
	for j in range(n):
		if s[j] != tt[j]:
			cur.append(j + 1)
	if len(cur) < len(ans):
		ans = cur
print(len(ans))
print(*ans)


(n, m) = [int(val) for val in input().split()]
s = input()
t = input()
ans = 100000000
ansL = []
for i in range(m - n + 1):
	val = 0
	valL = []
	for j in range(n):
		if s[j] != t[j + i]:
			val += 1
			valL.append(j + 1)
	if val < ans:
		ans = val
		ansL = valL
print(ans)
for ind in ansL:
	print(ind, end=' ')


input()
a = input()
b = input()
m = 0
ans = [x for x in range(1, len(a) + 1)]
for i in range(len(b) - len(a) + 1):
	z = []
	for j in range(len(a)):
		if a[j] != b[i + j]:
			z.append(j + 1)
	if len(z) < len(ans):
		ans = z.copy()
print(len(ans))
print(*ans)


import sys
import time
import heapq
import collections
from io import StringIO
test_cases = [('\n3 5\nabc\nxaybz\n', '\n2\n2 3 \n'), ('\n4 10\nabcd\nebceabazcd\n', '\n1\n2 \n')]

def solve():
	return 'TEST'

def debug(*args, **kwargs):
	print(*args, **kwargs, file=sys.stderr)

def main():
	(n, m) = map(int, input().split())
	s = input()
	t = input()
	min_diff = None
	for i in range(m - n + 1):
		diff = [k + 1 for (k, c) in enumerate(s) if c != t[k + i]]
		if min_diff is None or len(diff) < len(min_diff):
			min_diff = diff
	print(len(min_diff))
	print(' '.join((str(i) for i in min_diff)))

def test(s, check):
	s = s.strip()
	check = check.strip()
	sys.stdin = StringIO(s)
	sys.stdout = out = StringIO()
	start_time = time.time()
	try:
		main()
	finally:
		exec_time = time.time() - start_time
		sys.stdin = sys.__stdin__
		sys.stdout = sys.__stdout__
	out.seek(0)
	result = out.read().strip()
	status = 'SUCCESS' if result == check else 'FAILURE'
	message = 'status: {}, exec_time: {:.3f}'.format(status, exec_time)
	debug(message)

def test_all():
	for (s, check) in test_cases:
		test(s, check)
if len(sys.argv) > 1 and sys.argv[1] == '-t':
	test_all()
else:
	main()


def symbols_replaced(s, t):
	letters = []
	for i in range(len(s)):
		if s[i] != t[i] and s[i] != '?':
			letters.append(str(i + 1))
	return letters

def positions_substring(s, t):
	positions = []
	n = len(t) - len(s) + 1
	for i in range(n):
		index_of_symbols = symbols_replaced(s, t[i:i + len(s)])
		if len(index_of_symbols) == 0:
			positions = index_of_symbols
			break
		if len(index_of_symbols) < len(positions) or positions == []:
			positions = index_of_symbols
	return positions

def string_positions(positions):
	out = ''
	for i in positions:
		out += i + ' '
	return out
input()
s = input()
t = input()
positions = positions_substring(s, t)
n_must_be_replaced = len(positions)
print(n_must_be_replaced)
print(string_positions(positions))


a = list(map(int, input().split()))
s = input()
t = input()
list1 = []
list2 = []
minAux = 10000000000000000000000
for i in range(a[1] - a[0] + 1):
	for j in range(a[0]):
		if s[j] != t[i + j]:
			list2.append(j + 1)
	if minAux > len(list2):
		minAux = len(list2)
		list1 = list2
	list2 = []
print(len(list1))
for i in list1:
	print(i, end=' ')


(size_s, size_t) = map(int, input().split())
(s, t) = (input(), input())
n_changes = 100000
changes_indexes = []
for i in range(size_t - size_s + 1):
	changes = []
	for j in range(size_s):
		if s[j] != t[i + j]:
			changes.append(j)
	if len(changes) < n_changes:
		changes_indexes = changes
		n_changes = len(changes)
print(n_changes)
print(' '.join([str(c + 1) for c in changes_indexes]))


(n, m) = map(int, input().split())
s = input()
t = input()
max = -1
matches = 0
list1 = []
list2 = []
for i in range(m - n + 1):
	list1.clear()
	matches = 0
	for j in range(0, n, 1):
		if s[j] == t[i + j]:
			matches += 1
		else:
			list1.append(j + 1)
	if matches > max:
		list2.clear()
		max = matches
		list2 = list1.copy()
print(len(list2))
print(' '.join((str(x) for x in list2)))


(n, m) = input().split()
n = int(n)
m = int(m)
s = input()
t = input()
if s in t:
	print(0)
else:
	result = s
	for i in range(m - n + 1):
		position = []
		for j in range(n):
			if t[i + j] != s[j]:
				position.append(j + 1)
		if len(position) <= len(result):
			result = position
	print(len(result))
	print(' '.join(map(str, result)))


input()
s = input()
t = input()
(mmth, mpos) = (len(s), 0)
for i in range(len(t) - len(s) + 1):
	cnt = 0
	for j in range(len(s)):
		if t[i + j] != s[j]:
			cnt += 1
	if cnt < mmth:
		mmth = cnt
		mpos = i
miss = [j + 1 for j in range(len(s)) if t[mpos + j] != s[j]]
print(mmth)
print(' '.join(map(str, miss)))


(n, m) = map(int, input().split())
(s, t, v, l) = (input(), input(), n, list(range(1, n + 1)))
for i in range(m - n + 1):
	(k, c) = (0, [])
	for j in range(n):
		if s[j] != t[i + j]:
			k += 1
			c.append(j + 1)
	if k < v:
		(v, l) = (k, c)
print(v, ' '.join(map(str, l)), sep='\n')


def f(s, t):
	a = [0, []]
	for i in range(len(s)):
		if s[i] != t[i]:
			a[0] += 1
			a[1].append(i + 1)
	return a
(n, m) = list(map(int, input().split()))
s = input()
t = input()
ans = 2000
a = []
for i in range(m - n + 1):
	if f(s, t[i:i + n])[0] < ans:
		(ans, a) = f(s, t[i:i + n])
print(ans)
for i in a:
	print(i, end=' ')


(a, b) = map(int, input().split())
s = input()
t = input()
d = {}
n = 0
for i in range(0, b - a + 1):
	for j in range(i, i + a):
		if t[j] != s[j - i]:
			n = n + 1
	d[i] = n
	n = 0
d = sorted(d.items(), key=lambda a: a[1], reverse=False)
begin = d[0][0]
print(d[0][1])
for i in range(begin, begin + a):
	if t[i] != s[i - begin]:
		print(i - begin + 1, end=' ')


n = list(map(int, input().split(' ')))
a = input()
b = input()
(t, k) = (len(a) + 1, -1)
for i in range(len(b) - len(a) + 1):
	s = 0
	for j in range(len(a)):
		if a[j] != b[i + j]:
			s += 1
	if s < t:
		t = s
		k = i
p = []
for l in range(len(a)):
	if a[l] != b[k + l]:
		p.append(l + 1)
p = ' '.join(map(str, p))
print(t)
print(p)


(x, y) = list(map(int, input().split()))
s = input()
t = input()
l = [i for i in range(1, x + 1)]
ans = x
for i in range(1 + y - x):
	temp = 0
	k = []
	for j in range(x):
		if s[j:j + 1] != t[i + j:i + j + 1]:
			temp += 1
			k.append(j + 1)
	if temp < ans:
		ans = temp
		l = k
print(ans)
print(*l)


(n, m) = map(int, input().split())
a = input()
b = input()
L = len(a)
res1 = []
res2 = 9999999999
for i in range(0, m - n + 1):
	ia = iter(a)
	ib = iter(b[i:i + L])
	ans1 = []
	ans2 = 0
	try:
		j = 1
		while True:
			if next(ia) != next(ib):
				ans1.append(j)
				ans2 += 1
			j += 1
	except StopIteration:
		if ans2 < res2:
			res1 = ans1
			res2 = ans2
print(res2)
print(' '.join((str(i) for i in res1)))


def compare(s1, s2):
	missed = []
	for i in range(len(s1)):
		if s1[i] != s2[i]:
			missed.append(str(i + 1))
	return missed
(n, m) = map(int, input().strip().split(' '))
s = input().strip()
t = input().strip()
solution = False
for i in range(m - n + 1):
	current = compare(s, t[i:m])
	if solution is False:
		solution = current
	if len(solution) > len(current):
		solution = current
print(str(len(solution)))
print(' '.join(solution))


import math
(n, m) = map(int, input().split())
s = input()
t = input()
min_changes = math.inf
min_pos = 0
for i in range(len(t) - len(s) + 1):
	curr_changes = 0
	for j in range(n):
		if s[j] != t[i + j]:
			curr_changes += 1
	if curr_changes < min_changes:
		min_changes = curr_changes
		min_pos = i
print(min_changes)
arr = []
for i in range(len(s)):
	if s[i] != t[i + min_pos]:
		arr.append(i + 1)
print(' '.join(map(str, arr)))


(n, m) = map(int, input().split())
s = input()
t = input()
z = -1
g = n + 1
for i in range(m - n + 1):
	c = 0
	for j in range(n):
		if s[j] != t[i + j]:
			c += 1
	if c < g:
		g = c
		z = i
print(g)
print(' '.join([str(i + 1) for i in range(n) if s[i] != t[i + z]]))


(n, m) = list(map(int, input().split()))
s = input()
t = input()
idx = [0] * (len(s) + 1)
for i in range(len(t) - len(s) + 1):
	temp = []
	for j in range(len(s)):
		if s[j] != t[i + j]:
			temp.append(j + 1)
	if len(temp) < len(idx):
		idx = temp
print(len(idx))
print(' '.join(map(str, idx)))


(n, m) = [int(x) for x in input().split()]
s = list(input())
t = list(input())
cur_max = -1
best_start = None
for st in range(m - n + 1):
	matches = 0
	for (i, c) in enumerate(s):
		if c == t[st + i]:
			matches += 1
	if matches > cur_max:
		cur_max = matches
		best_start = st
print(len(s) - cur_max)
out = []
for i in range(len(s)):
	if s[i] != t[best_start + i]:
		out.append(str(i + 1))
print(' '.join(out))


(n, m) = [int(x) for x in input().split()]
s = list(input())
t = list(input())
final = list()
temp = list()
mi = 100000000
for i in range(0, len(t) - len(s) + 1):
	for j in range(0, len(s)):
		if s[j] != t[i + j]:
			temp.append(j + 1)
	if len(temp) < mi:
		mi = len(temp)
		final.clear()
		final += temp
	temp.clear()
print(mi)
for index in final:
	print(index, end=' ')


(a, b) = map(int, input().split())
s = str(input())
t = str(input())
m = 0
ind = 0
for i in range(b - a + 1):
	a1 = list(t[i:i + a])
	a2 = list(s)
	c = 0
	for j in range(a):
		if a1[j] == a2[j]:
			c += 1
	if c > m:
		m = c
		ind = i
l1 = list(t[ind:ind + a])
a3 = list(s)
print(a - m)
for i in range(a):
	if a2[i] != l1[i]:
		print(1 + i, end=' ')


inp = input().split()
n = int(inp[0])
m = int(inp[1])
s = input()
t = input()
ans = 10000
aux = -1
for i in range(m - n + 1):
	tmp = 0
	for j in range(n):
		if s[j] != t[j + i]:
			tmp += 1
	if tmp < ans:
		ans = tmp
		aux = i
print(ans)
out = ''
for i in range(n):
	if s[i] != t[aux + i]:
		out += str(i + 1) + ' '
print(out)


def crossword_solver(n, m, s, t):
	c_max = -1
	start = None
	for st in range(m - n + 1):
		matches = 0
		for (i, c) in enumerate(s):
			if c == t[st + i]:
				matches += 1
		if matches > c_max:
			c_max = matches
			start = st
	output = []
	for i in range(len(s)):
		if s[i] != t[start + i]:
			output.append(str(i + 1))
	return (len(s) - c_max, ' '.join(output))
first_line = input().split(' ')
n = int(first_line[0])
m = int(first_line[1])
s = input()
t = input()
solve = crossword_solver(n, m, s, t)
print(solve[0])
print(solve[1])


(n, m) = map(int, input().split())
(s, t, k) = (str(input()), str(input()), [''] * 1001)
for i in range(m - n + 1):
	g = [j + 1 for j in range(n) if s[j] != t[i:i + n][j]]
	if len(g) < len(k):
		k = g
print(len(k))
print(*k)


def main():
	read = lambda : tuple(map(int, input().split()))
	(l1, l2) = read()
	s1 = input()
	s2 = input()

	def ki(s, s1, s2):
		if s + l1 > l2:
			return (1e+19, [])
		d = []
		for i in range(l1):
			if s1[i] != s2[s + i]:
				d += [i + 1]
		return (len(d), d)
	mn = 1e+19
	for i in range(l2):
		(k, l) = ki(i, s1, s2)
		if k < mn:
			mn = k
			ans = l
	print(mn)
	print(*ans)
main()


def solve():
	(n, m) = get([int])
	s = get(str)
	t = get(str)

	def getDist(s1, s2):
		return sum((1 for (c1, c2) in zip(s1, s2) if c1 != c2))
	bestStart = 0
	bestDist = float('inf')
	for start in range(m - n + 1):
		s2 = t[start:start + n]
		dist = getDist(s, s2)
		if dist < bestDist:
			bestDist = dist
			bestStart = start
	print(bestDist)
	s2 = t[bestStart:bestStart + n]
	for (i, (c1, c2)) in enumerate(zip(s, s2)):
		if c1 != c2:
			print('{} '.format(i + 1), end='')
	print()
	return None
import sys
import math
import heapq
import bisect
import itertools
import collections
inf = float('inf')
sys.setrecursionlimit(10000)

def tree():
	return collections.defaultdict(tree)

def cache(func):
	cache_dict = {}

	def _cached_func(*args, _get_cache=False):
		if _get_cache:
			return cache_dict
		if args in cache_dict:
			return cache_dict[args]
		cache_dict[args] = func(*args)
		return cache_dict[args]
	return _cached_func

def equal(x, y, epsilon=1e-06):
	if -epsilon <= x - y <= epsilon:
		return True
	if -epsilon <= x <= epsilon or -epsilon <= y <= epsilon:
		return False
	return -epsilon <= (x - y) / x <= epsilon or -epsilon <= (x - y) / y <= epsilon

def get(_type):
	if type(_type) == list:
		if len(_type) == 1:
			_type = _type[0]
			return list(map(_type, input().strip().split()))
		else:
			return [_type[i](inp) for (i, inp) in enumerate(input().strip().split())]
	else:
		return _type(input().strip())
solve()


(n, m) = map(int, input().split())
s = input()
t = input()
res = 1001
res_ind = []
b = 0
e = len(s)
while b <= len(t) - len(s):
	sr = t[b:e]
	k = 0
	ind = []
	for i in range(len(s)):
		if s[i] != sr[i]:
			k += 1
		else:
			ind.append(i + 1)
	if k < res:
		res = k
		res_ind = ind
	b += 1
	e += 1
print(res)
res_ind = [x for x in range(1, len(s) + 1) if x not in res_ind]
print(*res_ind)


(n, m) = map(int, input().split())
(s, t) = (input(), input())
(mn, opt) = (1010, 0)
for pos in range(m - n + 1):
	cnt = sum((s[i] != t[i + pos] for i in range(n)))
	if cnt < mn:
		(mn, opt) = (cnt, pos)
ans = [i + 1 for i in range(n) if s[i] != t[i + opt]]
print(mn)
print(*ans)


(n, m) = map(int, input().split())
s = input()
t = input()
min_diff = n + 1
pos = 0
for i in range(m - n + 1):
	sub = t[i:i + n]
	diff = sum((s[j] != sub[j] for j in range(n)))
	if diff < min_diff:
		min_diff = diff
		pos = i
sub_t = t[pos:pos + n]
ans = [i + 1 for i in range(n) if s[i] != sub_t[i]]
print(min_diff)
for num in ans:
	print(num, end=' ')
print('')


(m, n) = input().split()
m = int(m)
n = int(n)
s = input()
t = input()
scores = []
for i in range(len(t) - len(s) + 1):
	score = 0
	for j in range(len(s)):
		if s[j] != t[i + j]:
			score += 1
	scores.append(score)
min_value = min(scores)
index = scores.index(min_value)
change_list = []
for i in range(len(s)):
	if s[i] != t[i + index]:
		change_list.append(i + 1)
print(min_value)
for each in change_list:
	print(each, end=' ')


(n, m) = [int(f) for f in input().split()]
s = input()
t = input()
k = []

def inter(a, b):
	return [y + 1 for y in range(n) if a[y] != b[y]]
for x in range(m - n + 1):
	k += [inter(s, t[x:x + n])]
v = min(k, key=lambda x: len(x))
print(len(v))
print(*v)


(n, m) = input().split(' ')
n = int(n)
m = int(m)
s = input()
t = input()
max_matches = -1
start_index = -1
for i in range(m - n + 1):
	matches = 0
	for j in range(n):
		if s[j] == t[j + i]:
			matches += 1
	if matches > max_matches:
		max_matches = matches
		start_index = i
print(n - max_matches)
res = ''
for i in range(n):
	if s[i] != t[start_index + i]:
		res += str(i + 1) + ' '
print(res.strip())


input()
s = input()
t = input()
l = []
for i in range(26):
	l.append([])
for i in range(len(s)):
	l[ord(s[i]) - ord('a')].append(i)
l2 = []
for i in range(len(t)):
	l2.append([])
l3 = [0] * len(t)
for i in range(len(t)):
	c = t[i]
	pos = l[ord(c) - ord('a')]
	for p in pos:
		start = i - p
		if len(t) - len(s) >= start >= 0:
			l3[start] += 1
			l2[start].append(p)
best = max(l3)
posb = l3.index(best)
print(len(s) - best)
things = l2[posb]
k = []
for i in range(len(s)):
	if not i in things:
		k.append(str(i + 1))
print(' '.join(k))


def print_check(check):
	out = ''
	for i in range(len(check)):
		if not check[i]:
			out += str(i + 1) + ' '
	print(out)

def check_subs(s, subs):
	check = [False] * len(s)
	c = 0
	for i in range(len(s)):
		if s[i] == subs[i]:
			check[i] = True
		else:
			c += 1
	return (check, c)
args = list(map(int, input().split(' ')))
lenS = args[0]
lenT = args[1]
s = input()
t = input()
i = 0
j = lenS
minCount = 10000
minCheck = []
while j <= lenT:
	subs = t[i:j]
	if s == subs:
		print(0)
		print('')
		exit()
	(check, count) = check_subs(s, subs)
	if count < minCount:
		minCount = count
		minCheck = check
	i += 1
	j += 1
print(minCount)
print_check(minCheck)


a = input()
a = input()
b = input()
ans = 100000
ppos = -1

def inf(pos):
	global ans
	global ppos
	ret = 0
	for i in range(len(a)):
		if a[i] != b[i + pos]:
			ret += 1
	if ret < ans:
		ans = ret
		ppos = pos
for i in range(len(b) - len(a) + 1):
	inf(i)
print(ans)
for i in range(len(a)):
	if a[i] != b[i + ppos]:
		print(i + 1, end=' ')


def do(n, m, ss, tt):
	max_hit_num = -1
	hit_indices = [True] * n
	for i in range(m - n + 1):
		matched = tt[i:i + n]
		hit = [sc == mc for (sc, mc) in zip(ss, matched)]
		hit_num = len([f for f in hit if f])
		if hit_num > max_hit_num:
			max_hit_num = hit_num
			hit_indices = [True] * n
			for hi in range(n):
				hit_indices[hi] = hit_indices[hi] & hit[hi]
	return (n - max_hit_num, ' '.join((str(e) for (e, x) in enumerate(hit_indices, start=1) if not x)))

def test():
	(a, b) = do(3, 5, 'abc', 'xaybz')
	assert a == 2
	assert b == '2 3'
	(a, b) = do(4, 10, 'abcd', 'ebceabazcd')
	assert a == 1
	assert b == '2'
	(a, b) = do(1, 1, 'a', 'a')
	assert a == 0
	assert b == ''
	(a, b) = do(1, 1, 'a', 'z')
	assert a == 1
	assert b == '1'

def main():
	(n, m) = list(map(int, input().split()))
	s = input().rstrip()
	t = input().rstrip()
	(a, b) = do(n, m, s, t)
	print(a)
	print(b)
main()


(n, m) = map(int, input().split())
s = input()
t = input()
M = float('inf')

def com(a, b, n):
	c = 0
	pos = list()
	for i in range(n):
		if a[i] != b[i]:
			c += 1
			pos.append(i + 1)
	return [c, pos]
for i in range(m - n + 1):
	yy = com(t[i:n + i], s, n)
	if yy[0] < M:
		M = yy[0]
		res = yy[1]
print(M)
print(*res)


tml = input().split()
sl = int(tml[0])
tl = int(tml[1])
s = input()
t = input()
li = list()
count = sl
for tn in range(tl - sl + 1):
	tmpC = 0
	tmpA = list()
	tmp = t[tn:tn + sl]
	for i in range(sl):
		if s[i] != tmp[i]:
			tmpC += 1
			tmpA.append(str(i + 1))
	if tmpC <= count:
		count = tmpC
		li = tmpA
		if count == 0:
			break
print(count)
print(' '.join(li))


(n, m) = (int(x) for x in input().split())
s = input()
t = input()
answer = n
answerlist = [i for i in range(0, n)]
for startindex in range(0, m - n + 1):
	changenum = 0
	changelist = []
	for wordindex in range(0, n):
		if s[wordindex] != t[startindex + wordindex]:
			changenum += 1
			changelist.append(wordindex)
	if changenum < answer:
		answer = changenum
		answerlist = changelist
print(answer)
for x in answerlist:
	print(str(x + 1) + ' ', end='')


(n, m) = map(int, input().strip().split())
q = input()
p = len(q)
w = input()
q = list(q)
w = list(w)
s = []
t = []
for i in range(len(w) - len(q) + 1):
	c = 0
	e = w[i:p + i]
	f = []
	for j in range(len(q)):
		if e[j] != q[j]:
			c += 1
			f.append(j + 1)
	s.append(c)
	t.append(f)
print(min(s))
y = s.index(min(s))
print(*t[y])


from sys import stdin, stdout
(n, m) = map(int, stdin.readline().split())
(s, t) = (stdin.readline().strip(), stdin.readline().strip())
ans = float('inf')
position = []
ind = 0
for i in range(m - n + 1):
	cnt = 0
	for j in range(i, i + n):
		if s[j - i] != t[j]:
			cnt += 1
	if cnt < ans:
		ind = i
		ans = cnt
stdout.write(str(ans) + '\n')
for j in range(ind, ind + n):
	if s[j - ind] != t[j]:
		stdout.write(str(j - ind + 1) + ' ')


(X, S, T, Min, Answer) = (list(map(int, input().split())), input(), input(), float('inf'), [])
for i in range(X[1] - X[0] + 1):
	Temp = []
	for index in range(X[0]):
		if S[index] != T[index + i]:
			Temp.append(index + 1)
	if len(Temp) < Min:
		Min = len(Temp)
		Answer = Temp[:]
print(Min)
print(*Answer)


(n, m) = map(int, input().split())
s = input()
t = input()
res = 10 ** 9
ans = []
for i in range(len(t) - len(s) + 1):
	curr = []
	for j in range(i, i + len(s)):
		if s[j - i] != t[j]:
			curr.append(j - i + 1)
	if len(curr) < res:
		res = len(curr)
		ans = curr[:]
print(res)
print(' '.join(map(str, ans)))


(n, m) = map(int, input().strip().split())
s = list(input())
t = list(input())
diff = 999999999
diff_list = []
for i in range(0, len(t) - len(s) + 1):
	res = 0
	rl = []
	for j in range(0, len(s)):
		if s[j] != t[i:i + len(s)][j]:
			res += 1
			rl.append(j + 1)
	if res < diff:
		diff = res
		diff_list = [a for a in rl]
print(diff)
if diff != 0:
	print(*diff_list)


(n, m) = map(int, input().split())
(s, r) = (input(), input())
ar = [0] * (m + 1)
for i in range(m - n + 1):
	r1 = []
	for j in range(n):
		if s[j] != r[i + j]:
			r1.append(j + 1)
	if len(r1) < len(ar):
		ar = r1
print(len(ar))
print(*ar)


def list_input():
	return list(map(int, input().split()))
[n, m] = list_input()
s = input()
t = input()
cmin = 1 << 30
imin = -1
for i in range(m - n + 1):
	cnt = 0
	for j in range(n):
		if t[i + j] != s[j]:
			cnt += 1
	if cnt < cmin:
		cmin = cnt
		imin = i
res = list()
for j in range(n):
	if t[imin + j] != s[j]:
		res.append(j + 1)
print(cmin)
print(' '.join(map(str, res)))


import math
len_input = input()
len_input = len_input.split(' ')
s_len = int(len_input[0])
t_len = int(len_input[1])
s_string = input()
t_string = input()
t_substring = []
for i in range(0, len(t_string)):
	temp = t_string[i:i + s_len]
	if len(temp) == s_len:
		t_substring.append(temp)
min = math.inf
min_index = []
for i in range(0, len(t_substring)):
	index_arr = []
	for j in range(0, len(s_string)):
		if s_string[j] != t_substring[i][j]:
			index_arr.append(j)
	if len(index_arr) < min:
		min = len(index_arr)
		min_index = index_arr
if min == math.inf:
	res = []
	for i in range(0, s_len):
		res.append(str(i + 1))
	print(len(res))
	res = ' '.join(res)
	print(res)
else:
	print(min)
	for i in range(0, len(min_index)):
		min_index[i] = str(min_index[i] + 1)
	min_index = ' '.join(min_index)
	print(min_index)


__author__ = 'Daniel Mitre'
import sys
(n, m) = map(int, input().split())
s = input()
t = input()
different = 1010
bmask = [0 for _ in range(n)]
for i in range(m - n + 1):
	diff = 0
	for j in range(n):
		if s[j] != t[i + j]:
			diff += 1
	if diff < different:
		different = diff
		bmask = [s[j] != t[i + j] for j in range(n)]
print(different)
positions = []
for p in range(n):
	if bmask[p]:
		positions.append(p + 1)
print(' '.join(map(str, positions)))


par = [int(i) for i in str(input()).split()]
(n, m) = (par[0], par[1])
sub = str(input())
main = str(input())

def count(string1, string2, start):
	changes = 0
	changes_list = []
	for i in range(len(string1)):
		if string1[i] != string2[i]:
			changes += 1
			changes_list.append(i)
	return (changes, changes_list)
min_change = [10 ** 5 + 1, [-1]]
for i in range(0, len(main) - len(sub) + 1):
	sub_string = main[i:i + len(sub)]
	min_change = min([[min_change[0], min_change[1]], [count(sub_string, sub, i)[0], count(sub_string, sub, i)[1]]], key=lambda x: x[0])
print(min_change[0])
for i in min_change[1]:
	print(i + 1, end=' ')


(x, y) = list(map(int, input().split()))
s = list(input())
t = list(input())
m = 0
p = []
for i in range(y - x + 1):
	ts = t[i:i + x]
	tr = [x1 == t1 for (x1, t1) in zip(s, ts)]
	if sum(tr) > m or m == 0:
		m = sum(tr)
		p = [k for (k, v) in enumerate(tr, 1) if not v]
su = x - m
print(su)
if su > 0:
	print(*p, sep=' ')


(n, m) = map(int, input().split())
a = input()
b = input()
ans = [None] * 1111
for i in range(0, m - n + 1):
	ia = iter(a)
	ib = iter(b[i:i + n])
	tmp = []
	try:
		j = 1
		while True:
			if next(ia) != next(ib):
				tmp.append(j)
			j += 1
	except StopIteration:
		if len(tmp) < len(ans):
			ans = tmp
print(len(ans))
print(' '.join((str(i) for i in ans)))


(n, m) = map(int, input().split())
s = input()
t = input()
mn = len(s)
mnid = 0
for i in range(len(t) - len(s) + 1):
	diff = 0
	for (c, d) in zip(s, t[i:i + len(s)]):
		if c != d:
			diff += 1
	if diff < mn:
		mn = diff
		mnid = i
print(mn)
diffs = []
for i in range(len(s)):
	if s[i] != t[mnid + i]:
		diffs.append(i + 1)
print(' '.join(map(str, diffs)))


import sys
input = sys.stdin.readline
(n, m) = map(int, input().split())
a = input().strip('\n')
b = input().strip('\n')
maxMatch = 9999999999
ans = []

def compare(a, b):
	change = []
	for i in range(len(b)):
		if a[i] != b[i]:
			change.append(i + 1)
	return change
i = n
for j in range(m - i + 1):
	startindex = j
	curr = compare(a, b[j:j + i])
	if len(curr) < maxMatch:
		maxMatch = len(curr)
		ans = curr
print(maxMatch)
if ans:
	print(' '.join(map(str, ans)))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def main():
	(n, m) = LI()
	s = S()
	t = S()
	r = inf
	rr = []
	for i in range(m - n + 1):
		k = 0
		kr = []
		for j in range(n):
			if s[j] != t[i + j]:
				k += 1
				kr.append(j + 1)
		if r > k:
			r = k
			rr = kr
	return '{}\n{}'.format(r, JA(rr, ' '))
print(main())


def add_one(x):
	return x + 1
(n, m) = map(int, input().split())
s = input()
t = input()
res = list(range(n))
for j in range(m - n + 1):
	new_res = []
	for i in range(n):
		if s[i] != t[i + j]:
			new_res.append(i)
	if len(new_res) < len(res):
		res = new_res
print(len(res))
print(*list(map(add_one, res)))


input()
sub = input()
real = input()
ans = [2 * i for i in range(1005)]
for i in range(len(real) - len(sub) + 1):
	cnt = []
	for j in range(len(sub)):
		if sub[j] != real[j + i]:
			cnt.append(j)
	if len(cnt) < len(ans):
		ans = list(cnt)
print(len(ans))
for i in ans:
	print(i + 1, end=' ')


(n, m) = map(int, input().split())
s1 = input()
s2 = input()
h = n + 1
a = []
for q in range(m - n + 1):
	j = 0
	b = []
	r = q
	for w in range(n):
		if s1[w] != s2[r]:
			b.append(w + 1)
			j += 1
		r += 1
	if h > j:
		h = j
		a = b[:]
print(h)
print(*a)


from collections import deque as de
import math
from collections import Counter as cnt
from functools import reduce
from typing import MutableMapping
from itertools import groupby as gb
from fractions import Fraction as fr

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def ceildiv(x, y):
	return (x + y - 1) // y

def di():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))
(n, m) = di()
s = input()
t = input()
mn = n
index = 0
for i in range(m - n + 1):
	temp = 0
	for j in range(i, i + n):
		if t[j] != s[j - i]:
			temp += 1
	if temp < mn:
		mn = temp
		index = i
ans = []
for k in range(index, index + n):
	if t[k] != s[k - index]:
		ans.append(k - index + 1)
print(mn)
print(*ans)


(n, m) = map(int, input().split())
S = input()
S1 = input()
t = []
for i in range(m - n + 1):
	k = 0
	t1 = []
	V = ''
	for j in range(i, i + n):
		if S1[j] != S[j - i]:
			t1.append(j - i + 1)
	t1 = [len(t1)] + t1
	t.append(t1)
t = sorted(t)
print(t[0][0])
print(*t[0][1:])


(n, m) = map(int, input().split())
s = input()
t = input()
a = []
for i in range(m - n + 1):
	c = 0
	k = 0
	for j in range(i, n + i):
		if s[k] != t[j]:
			c += 1
		k += 1
	a.append(c)
x = a.index(min(a))
j = 0
r = []
for i in range(x, x + n):
	if s[j] != t[i]:
		r.append(str(j + 1))
	j += 1
print(len(r))
print(' '.join(r))


input()
(n, m) = (input(), input())
minDiff = float('inf')
res = []
for i in range(len(m)):
	localDiff = 0
	changes = []
	for j in range(len(n)):
		if i + j >= len(m):
			(localDiff, changes) = (len(n), range(1, len(n) + 1))
			break
		if m[i + j] != n[j]:
			localDiff += 1
			changes.append(j + 1)
	if localDiff < minDiff:
		minDiff = localDiff
		res = changes
print(minDiff)
print(' '.join(map(str, res)))


(n, m) = map(int, input().split())
s = list(input())
t = list(input())
ans = 11 ** 11
l = []
for i in range(m - n + 1):
	ansi = 0
	li = []
	for j in range(n):
		if s[j] != t[i + j]:
			ansi += 1
			li += [j + 1]
	if ansi < ans:
		ans = ansi
		l = li
print(ans)
print(*l)


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')

def do(a, b):
	m = 0
	for i in range(len(a)):
		if a[i] == b[i]:
			m += 1
	return m
(n, m) = map(int, input().split())
s = input()
t = input()
array = []
for i in range(m - n + 1):
	array.append([t[i:i + n], do(t[i:i + n], s)])
array.sort(key=lambda i: i[1], reverse=1)
ans = []
for i in range(n):
	if array[0][0][i] != s[i]:
		ans.append(i + 1)
print(len(ans))
print(*ans)


def algo():
	input()
	s = input()
	t = input()
	if s in t:
		return []
	else:
		result = list(s)
		for i in range(len(t) - len(s) + 1):
			indexes = []
			for j in range(len(s)):
				if t[i + j] != s[j]:
					indexes.append(j + 1)
			if len(indexes) <= len(result):
				result = indexes
		return result
result = algo()
print(len(result))
print(' '.join(map(str, result)))


(n, m) = map(int, input().split())
(entry1, entry2) = (input(), input())
resp = []
respAux = []
maxNum = 999999
i = 0
j = 0
x = 0
for i in range(m - n + 1):
	respAux = []
	for j in range(n):
		if entry1[j] != entry2[i + j]:
			respAux.append(j)
	if len(respAux) < maxNum:
		resp = respAux
		maxNum = len(respAux)
print(maxNum)
for x in resp:
	print(x + 1, end=' ')


def solve(n, m, s, t):
	ans = [i + 1 for i in range(n)]
	for j in range(m - n + 1):
		new = []
		for i in range(n):
			if s[i] != t[i + j]:
				new.append(i + 1)
		if len(new) < len(ans):
			ans = new
	return ans

def main():
	(n, m) = map(int, input().split())
	s = input()
	t = input()
	s = solve(n, m, s, t)
	print(len(s))
	print(*s)
main()


(n, m) = map(int, input().split())
a = list(input())
b = list(input())
ans = []
ans1 = []
ans2 = 0
for i in range(m - n + 1):
	c = b[i:i + n]
	d = []
	for j in range(n):
		if a[j] != c[j]:
			ans2 += 1
			d.append(j + 1)
	d.insert(0, len(d))
	ans.append(d)
ans.sort()
print(ans[0][0])
del ans[0][0]
print(*ans[0])


def fit(s1, s2, i):
	count = 0
	for j in range(len(s1)):
		if s2[j + i] != s1[j]:
			if s1[j] == '?' or s2[j + i] == '?':
				continue
			count += 1
	return count

def calc(s1, s2, mmin):
	l = []
	for i in range(len(s1)):
		if s1[i] != s2[i + mmin]:
			if s1[i] == '?' or s2[i + mmin] == '?':
				continue
			l.append(i + 1)
	return l
inp = input().split()
s1 = input()
s2 = input()
m = 9999999
mmin = 0
for i in range(len(s2) - len(s1) + 1):
	val = fit(s1, s2, i)
	if val < m:
		m = val
		mmin = i
print(m)
l = calc(s1, s2, mmin)
for val in l:
	print(val, end=' ')
print()


(n, m) = map(int, input().split())
t = input()
s = input()
a = []
o = 0
for j in range(n):
	if s[j] != t[j]:
		o += 1
		a += [j + 1]
for i in range(1, m - n + 1):
	oo = 0
	b = []
	for j in range(n):
		if s[i + j] != t[j]:
			oo += 1
			b += [j + 1]
	if oo < o:
		o = oo
		a = b[:]
print(o)
print(*a)


(n, m) = map(int, input().split())
s = input()
t = input()
menorMudanca = list(s)
for i in range(0, len(t) - len(s) + 1):
	mudanca = []
	for j in range(i, i + len(s)):
		if len(mudanca) > len(menorMudanca):
			break
		if t[j] != s[j - i]:
			mudanca.append(j - i + 1)
	if len(mudanca) <= len(menorMudanca):
		menorMudanca = mudanca
print(len(menorMudanca))
print(*menorMudanca)


def Lcs(a, b):
	i = []
	for x in range(len(a)):
		if a[x] != b[x]:
			i.append(x + 1)
	return i
(n, m) = map(int, input().split())
(s, t) = (input(), input())
(Amn, minAns) = (n + 1, list(s))
for i in range(m - n + 1):
	min = 0
	mins = []
	lcs = Lcs(s, t[i:i + n])
	if len(lcs) < Amn:
		Amn = len(lcs)
		minAns = lcs
print(Amn)
if len(minAns) > 0:
	print(*minAns)


import math

def main_function():
	input()
	s = input()
	t = input()
	start_point_of_min = 0
	characters_tochange = 100000000000000
	final_index_list = []
	for i in range(0, len(t) - len(s) + 1):
		internal_counter = 0
		index_list = []
		for j in range(i, i + len(s)):
			if s[j - i] != t[j]:
				internal_counter += 1
				index_list.append(j - i + 1)
		if internal_counter < characters_tochange:
			characters_tochange = internal_counter
			final_index_list = index_list.copy()
	print(characters_tochange)
	print(' '.join([str(i) for i in final_index_list]))
main_function()


(n, k) = map(int, input().split())
s = input()
t = input()
no = 0
pos = 0
for i in range(k - n + 1):
	no1 = 0
	for a in range(n):
		if t[i + a] == s[a]:
			no1 = no1 + 1
	if no1 > no:
		no = no1
		pos = i
print(n - no)
for z in range(n):
	if t[pos + z] != s[z]:
		print(z + 1, end=' ')


import sys

def main():
	(n, m) = map(int, sys.stdin.readline().split())
	s = sys.stdin.readline().rstrip()
	t = sys.stdin.readline().rstrip()
	r = 10000
	res = []
	for i in range(m - n + 1):
		p = []
		c = 0
		for j in range(n):
			if s[j] != t[i + j]:
				c += 1
				p.append(j + 1)
		if c < r:
			r = c
			res = p
	print(r)
	if r != 0:
		print(' '.join(map(str, res)))
main()


input()
s1 = input()
s2 = input()
min_ = 10000000
pos = 0
for i in range(len(s2) - len(s1) + 1):
	tek = 0
	for j in range(len(s1)):
		if s2[i + j] != s1[j]:
			tek += 1
	if tek < min_:
		min_ = tek
		pos = i
print(min_)
nextprint = ''
for j in range(len(s1)):
	if s2[pos + j] != s1[j]:
		nextprint += str(j + 1) + ' '
print(nextprint)


(n, m) = map(int, input().split())
a = input()
b = input()
mini = 10000
pos = []
for i in range(m - n + 1):
	temp = []
	c = 0
	for j in range(n):
		if a[j] != b[i + j]:
			temp.append(j + 1)
			c += 1
	if c < mini:
		mini = c
		pos = temp
print(mini)
print(*pos)


def Posiciones(n, m, s, t):
	i = MasEficiente(n, m, s, t)
	B = []
	for k in range(n):
		if s[k] != t[i + k]:
			B.append(k + 1)
	return B

def MasEficiente(n, m, s, t):
	A = CompararTodo(n, m, s, t)
	m = max(A)
	r = 0
	for k in range(len(A)):
		if Comparador(n, m, s, t, k) == m:
			r = k
	return r

def CompararTodo(n, m, s, t):
	A = []
	for i in range(m - n + 1):
		A.append(Comparador(n, m, s, t, i))
	return A

def Comparador(n, m, s, t, i):
	c = 0
	for k in range(n):
		if s[k] == t[i + k]:
			c += 1
	return c
L = input()
L = L.split()
n = int(L[0])
m = int(L[1])
s = str(input())
t = str(input())
P = Posiciones(n, m, s, t)
print(len(P))
if len(P) != 0:
	c = str(P[0])
	for k in range(1, len(P)):
		c += ' ' + str(P[k])
	print(c)


(a, b) = map(int, input().split())
s = input()
k = input()
minn = 1001
t = None
for i in range(b - a + 1):
	c = 0
	x = []
	for j in range(a):
		if k[i:i + a][j] != s[j]:
			c += 1
			x.append(j + 1)
	if c < minn:
		minn = c
		t = x
print(minn)
print(*t)


(n, m) = [int(i) for i in input().split()]
s = input()
t = input()
mnK = 1001
mnPos = []
for i in range(m - n + 1):
	k = 0
	pos = []
	for j in range(n):
		if s[j] is not t[i + j]:
			k += 1
			pos.append(j)
	if k < mnK:
		mnK = k
		mnPos = pos
print(mnK)
for pos in mnPos:
	print(pos + 1, end=' ')


(n, m) = map(int, input().split())
s = input()
t = input()
ans = [0] * (n + 1)
for i in range(m - n + 1):
	c = []
	for j in range(n):
		if s[j] != t[i + j]:
			c.append(j + 1)
	if len(c) < len(ans):
		ans = c
print(len(ans))
print(*ans)


(n, m) = map(int, input().split())
s = input().strip()
t = input().strip() + '3'
p = []
for i in range(0, m - n + 1):
	p.append(t[i:i + n])
l = 0
k = ['1']
for i in p:
	b = []
	v = 0
	for j in range(0, n):
		if i[j] == s[j]:
			v += 1
		else:
			b.append(str(j + 1))
	if v >= l:
		l = v
		k = b
print(n - l)
print(' '.join(k))


(n, m) = input().split()
(n, m) = (int(n), int(m))
s = input()
t = input()
min_c = 10 ** 4
min_pos = []
for i in range(m - n + 1):
	c = 0
	pos = []
	for j in range(n):
		if s[j] != t[i + j]:
			c += 1
			pos.append(j + 1)
	if c < min_c:
		min_c = c
		min_pos = pos[:]
print(min_c)
for i in range(len(min_pos) - 1):
	print(min_pos[i], end=' ')
if len(min_pos) > 0:
	print(min_pos[-1])


(n, m) = map(int, input().split())
s = input()
t = input()
ans = n * m
st = -1
for i in range(m - n + 1):
	x = sum((1 for z in range(n) if s[z] != t[i + z]))
	if x < ans:
		ans = x
		st = i
print(ans)
for i in range(n):
	if s[i] != t[st + i]:
		print(i + 1, end=' ')


(n, m) = map(int, input().split(' '))
s = input()
t = input()
g = int(1000000000.0)
p = -1
for i in range(len(t) - len(s) + 1):
	x = 0
	for j in range(len(s)):
		if s[j] != t[i + j]:
			x += 1
	if g > x:
		p = i
		g = x
print(g)
for i in range(len(s)):
	if s[i] != t[p + i]:
		print(i + 1, end=' ')


inputs = list(map(int, input().split()))
n = inputs[0]
m = inputs[1]
s = str(input())
t = str(input())
min = float('inf')
v = []
temp = []
for i in range(0, m - n + 1):
	for j in range(0, n):
		if s[j] != t[i + j]:
			temp.append(j + 1)
	if min > len(temp):
		min = len(temp)
		v = temp.copy()
	temp.clear()
print(len(v))
output = ''
for i in range(0, len(v)):
	output += str(v[i]) + ' '
print(output)


(n, m) = map(int, input().split())
(s, t) = (input(), input())
r = 10 ** 9
for i in range(m - n + 1):
	c = 0
	q = []
	z = t[i:i + n]
	for j in range(n):
		if s[j] != z[j]:
			q.append(j + 1)
			c += 1
	if c < r:
		r = c
		f = q
print(len(f))
print(*f)


output = []
input()
inputA = input()
inputB = input()

def getDistance(a, b):
	res = []
	for index in range(len(a)):
		if a[index] != b[index] and a[index] != '?':
			res.append(str(index + 1))
	return res
for index in range(len(inputB) - len(inputA) + 1):
	res = getDistance(inputA, inputB[index:index + len(inputA)])
	if len(res) == 0:
		output = res
		break
	if len(res) < len(output) or output == []:
		output = res
print(len(output))
print(' '.join(output))


(n, m) = input().split()
s = input()
t = input()
n = int(n)
m = int(m)
k = n + 1
pos = []
aux = []
for i in range(m - n + 1):
	x = n
	aux = []
	for j in range(len(s)):
		if t[i + j] == s[j]:
			x -= 1
		else:
			aux.append(str(j + 1))
		j += 1
	if x < k:
		k = x
		pos = aux
print(k)
print(' '.join(pos))


from sys import maxsize, stdout, stdin, stderr
mod = int(1000000000.0 + 7)
import re
tup = lambda : map(int, stdin.readline().split())
I = lambda : int(stdin.readline())
lint = lambda : [int(x) for x in stdin.readline().split()]
S = lambda : stdin.readline().replace('\n', '').strip()

def grid(r, c):
	return [lint() for i in range(r)]

def debug(*args, c=6):
	print('\x1b[3{}m'.format(c), *args, '\x1b[0m', file=stderr)
from math import log2, sqrt
from collections import defaultdict
(n, m) = tup()
s = S()
t = S()
cnt = 0
mi = maxsize
arr = []
ans = []
for i in range(m):
	x = t[i:i + n]
	if len(x) == n:
		arr = []
		for j in range(n):
			if x[j] != s[j]:
				cnt += 1
				arr.append(j + 1)
		if cnt < mi:
			mi = cnt
			ans.append(arr)
		cnt = 0
print(mi)
print(*ans[len(ans) - 1])


import string
(ls, lt) = [int(x) for x in input().split()]
s = input()
t = input()
min_indices = ls
indices = [i for i in range(1, ls + 1)]

def check_match(i):
	wildcard_count = 0
	t_indices = []
	j = 0
	for si in range(i, i + ls):
		if s[j] != t[si]:
			wildcard_count += 1
			t_indices.append(j + 1)
		j += 1
	return (wildcard_count, t_indices)
begin_index = 0
last_index = lt - ls + 1
for i in range(begin_index, last_index):
	(mi, ind) = check_match(i)
	if mi < min_indices:
		(min_indices, indices) = (mi, ind)
print(min_indices)
for i in indices[:-1]:
	print('%d ' % i, end='')
if len(indices) > 0:
	print(indices[-1])


def f(par0, par1, n):
	count = 0
	pos = []
	for i in range(n):
		if par0[i] != par1[i]:
			pos.append(i)
			count += 1
	return (count, pos)
(n, m) = map(int, input().split())
(a, b) = (input(), input())
arr = []
for i in range(m - n + 1):
	arr.append(b[i:i + n])
(minm, index) = (10000, [])
for i in range(m - n + 1):
	(c, d) = f(a, arr[i], n)
	if minm > c:
		minm = c
		index = d
print(minm)
ans = ''
for i in index:
	ans += str(i + 1) + ' '
print(ans)


(n, m) = list(map(int, input().split()))
s = input()
t = input()

def needs(i):
	x = 0
	for u in range(n):
		if t[i + u] != s[u]:
			x += 1
	return x
need = n
ind = 0
for i in range(m - n + 1):
	x = needs(i)
	if x < need:
		need = x
		ind = i
out = str(need) + '\n'
for i in range(n):
	if t[ind + i] != s[i]:
		out += str(i + 1) + ' '
print(out[:-1])


(n, m) = list(map(int, input().split()))
s = input()
t = input()
ans = [i + 1 for i in range(n)]
for i in range(m - n + 1):
	l = []
	for j in range(n):
		if s[j] != t[i + j]:
			l.append(j + 1)
	if len(l) < len(ans):
		ans = l
print(len(ans))
print(*ans)


(n, m) = map(int, input().split())
s = input()
t = input()
l = []
max1 = float('-inf')
for i in range(m - n + 1):
	l1 = []
	count = 0
	for j in range(i, i + n):
		if s[j - i] == t[j]:
			count = count + 1
		else:
			l1.append(j - i + 1)
	max1 = max(max1, count)
	if max1 == count:
		l = list(l1)
print(len(l))
print(*l)


(n, m) = input().split()
n = int(n)
m = int(m)
p = input()
q = input()
ans = list(range(n))
for i in range(0, m - n + 1):
	counter = []
	for j in range(n):
		if p[j] != q[j + i]:
			counter.append(j)
	if len(counter) < len(ans):
		ans = counter
print('%d' % len(ans))
for i in range(len(ans)):
	print('%d' % (ans[i] + 1), end=' ')


(n, m) = list(map(int, input().split()))
a = input()
b = input()
i = 0
x = float('inf')
while i + n <= m:
	j = i
	k = 0
	p = 0
	while k < n:
		if a[k] != b[j]:
			p = p + 1
		k += 1
		j += 1
	if p < x:
		y = i
		x = p
	i += 1
k = 0
j = y
w = []
while k < n:
	if a[k] != b[j]:
		w.append(k + 1)
	k += 1
	j += 1
print(len(w))
print(*w)


(n, m) = map(int, input().split())
s = input()
t = input()
count = 0
maxx = 0
st = 0
end = 0
for i in range(m - n + 1):
	k = i
	for j in range(n):
		if t[k] == s[j]:
			count += 1
		k = k + 1
	if count > maxx:
		st = i
		end = k
		maxx = count
	count = 0
i = 0
end = n + st - 1
kk = n - maxx
ans = []
for g in range(n):
	if t[st] != s[g]:
		ans.append(g + 1)
	st += 1
print(kk)
print(*ans)


(n, m) = map(int, input().split())
s = input()
t = input()
res = [0] * 10000
for i in range(m - n + 1):
	asd = []
	for j in range(n):
		if t[i + j] != s[j]:
			asd.append(j + 1)
	if len(asd) < len(res):
		res = asd
print(len(res))
print(*res)


import copy
c = 0
mem = []
(m, n) = map(int, input().split())
minc = n
a = input()
b = input()
for i in range(n - m + 1):
	for j in range(m):
		if a[j] == b[j + i]:
			pass
		else:
			c += 1
			mem.append(str(j + 1))
	if c <= minc:
		minc = c
		memc = copy.deepcopy(mem)
	c = 0
	mem = []
print(minc)
print(' '.join(memc))


(n, m) = map(int, input().split())
s = input()
t = input()
ans = [0] * (len(t) - len(s) + 1)
for i in range(len(t) - len(s) + 1):
	for j in range(len(s)):
		if t[i + j] == s[j]:
			ans[i] += 1
pt = max(ans)
ind = ans.index(pt)
j = 0
lol = ''
ctr = 0
for i in range(ind, ind + len(s)):
	if t[i] != s[j]:
		lol += str(j + 1) + ' '
		ctr += 1
	j += 1
print(ctr)
print(lol[:-1])


(n, m) = map(int, input().split())
a = input()
b = input()
listans = []
for i in range(n):
	listans.append(i + 1)
for i in range(len(b) - len(a) + 1):
	templist = []
	for j in range(len(a)):
		if a[j] != b[i + j]:
			templist.append(j + 1)
	if len(templist) < len(listans):
		listans = templist
print(len(listans))
for i in listans:
	print(i, end=' ')


import sys
inp = sys.stdin.read().split()
n = int(inp[0])
m = int(inp[1])
s = inp[2]
t = inp[3]
case1 = []
case2 = []
for i in range(m - n + 1):
	subt = t[i:i + n]
	check = []
	counter = 0
	for j in range(n):
		if s[j] == subt[j]:
			check.append(1)
		else:
			counter += 1
			check.append(0)
	case1.append(counter)
	case2.append(check)
k = min(case1)
print(k)
for l in range(n):
	if case2[case1.index(k)][l] == 0:
		print(l + 1, end=' ')


(n, m) = [int(x) for x in input().split()]
s = input()
t = input()
nums = []
for i in range(m - n + 1):
	num = []
	for j in range(n):
		if t[i:i + n][j] != s[j]:
			num.append(str(j + 1))
	nums.append(num)
nums.sort(key=lambda x: len(x))
print(len(nums[0]))
print(' '.join(nums[0]))


(n, m) = map(int, input().split())
(s, t, ans, k) = (str(input()), str(input()), n + 1, [])

def f(y):
	return sum([s[i] != y[i] for i in range(n)])
for i in range(m - n + 1):
	if ans > f(t[i:i + n]):
		ans = f(t[i:i + n])
		k = [str(j + 1) for j in range(n) if s[j] != t[i:i + n][j]]
print(ans, '\n' + ' '.join(k))


import math
(n, m) = list(map(int, input().split()))
s = input()
t = input()
positions_temp = []
positions = []
min = math.inf
for i in range(m - n + 1):
	for j in range(n):
		if s[j] != t[i + j]:
			positions_temp.append(j + 1)
	if min > len(positions_temp):
		min = len(positions_temp)
		positions = positions_temp
	positions_temp = []
print(len(positions))
print(' '.join(map(str, positions)))


def questions(a, b, ind):
	cnt = 0
	for i in range(len(a)):
		if a[i] != b[i + ind]:
			cnt += 1
	return cnt

def get_indexes(a, b, ind):
	indexes = []
	for i in range(len(a)):
		if a[i] != b[i + ind]:
			indexes.append(i + 1)
	return indexes
(n, m) = list(map(int, input().split()))
t = str(input())
s = str(input())
min_position = 0
min_cnt = questions(t, s, 0)
for i in range(1, len(s) - len(t) + 1):
	ncnt = questions(t, s, i)
	if ncnt < min_cnt:
		min_cnt = ncnt
		min_position = i
print(min_cnt)
print(' '.join(map(str, get_indexes(t, s, min_position))))


__metaclass__ = type
import math

def input_array(convert_type):
	return [convert_type(x) for x in input().split()]
(n, m) = input_array(int)
s = input()
t = input()
mn = 100000000000
mnSeq = []
for i in range(m - n + 1):
	miss = 0
	seq = []
	for j in range(n):
		if t[i + j] != s[j]:
			seq.append(j)
			miss += 1
	if mn > miss:
		mn = miss
		mnSeq = seq
print(mn)
for x in mnSeq:
	print(x + 1)


(n, m) = map(int, input().strip().split(' '))
s = input().strip()
t = input().strip()
ans = n
ls = []
for i in range(m - n + 1):
	k = 0
	c = 0
	lm = [0] * n
	for j in range(n):
		if s[j] != t[i + j]:
			lm[k] = j + 1
			c += 1
			k += 1
	if c <= ans:
		ans = c
		ls = lm
print(ans)
st = ''
for i in ls:
	if i != 0:
		st += str(i) + ' '
	else:
		break
print(st)


(n, m) = map(int, input().split())
s = input()
t = input()
p = ''
mi = 10 ** 9
for i in range(m - n + 1):
	temp = t[i:n + i]
	tp = ''
	c = 0
	for j in range(n):
		if s[j] != temp[j]:
			c += 1
			tp += str(j + 1) + ' '
	if c < mi:
		mi = c
		p = tp
print(mi)
print(p)


string = input()
numbers = string.split(' ')
a = int(numbers[0])
b = int(numbers[1])
s = input()
t = input()
values = []
lists = []
for x in range(b - a + 1):
	substring = t[x:x + a]
	n = 0
	positions = []
	for y in range(a):
		p = substring[y]
		q = s[y]
		if p != q:
			positions.append(str(y + 1))
			n += 1
	values.append(n)
	lists.append(positions)
minimum = min(values)
print(minimum)
print(' '.join(lists[values.index(minimum)]))


(n, m) = [int(x) for x in input().split()]
s = input()
t = input()
ans = 10000
ansInd = []
for i in range(len(t) - len(s) + 1):
	tmp = 0
	indices = []
	for j in range(len(s)):
		if s[j] != t[j + i]:
			tmp += 1
			indices.append(j + 1)
	if tmp < ans:
		ans = tmp
		ansInd = indices
print(ans)
if len(ansInd) > 0:
	strAns = str(ansInd[0])
	for i in range(1, len(ansInd)):
		strAns = strAns + ' ' + str(ansInd[i])
	print(strAns)


(n, m) = map(int, input().split())
s = input()
t = input()
ans = (n, m)
for ii in range(m - n + 1):
	dt = 0
	for jj in range(n):
		if s[jj] != t[ii + jj]:
			dt += 1
	ans = min(ans, (dt, ii))
print(ans[0])
tmp = [ii + 1 for ii in range(n) if s[ii] != t[ii + ans[1]]]
print(*tmp)


from textwrap import wrap
input()
s = input()
t = input()
r = int(1000000000.0)
p = list()
for i in range(len(t) - len(s) + 1):
	f = [x != y for (x, y) in zip(t[i:i + len(s)], s)]
	g = f.count(True)
	if g < r:
		r = g
		p = [str(i + 1) for (i, e) in enumerate(f) if e]
print(r)
print(' '.join(p))


def no_diff(ls, s):
	c = 0
	for i in range(n):
		if ls[i] != s[i]:
			c += 1
	return c
s = input()
(n, m) = s.split(sep=' ')
n = int(n)
m = int(m)
s = input()
t = input()
v = []
for i in range(m):
	if i + n <= m:
		v.append(t[i:i + n])
v.sort(key=lambda ls: no_diff(ls, s))
p = []
for i in range(n):
	if v[0][i] != s[i]:
		p.append(i + 1)
print(len(p))
print(*p)


(n, m) = map(int, input().split())
s = input()
t = input()
l = []
for i in range(len(t) - len(s) + 1):
	l.append([])
	for j in range(len(s)):
		if s[j] != t[i + j]:
			l[-1].append(j + 1)
print(len(min(l, key=lambda x: len(x))))
print(*min(l, key=lambda x: len(x)))


(n, m) = map(int, input().split())
s = input()
t = input()
ans = 10001
ind = -1
for i in range(len(t) - len(s) + 1):
	curr = 0
	for j in range(len(s)):
		if t[i + j] != s[j]:
			curr += 1
	if curr < ans:
		ind = i
		ans = curr
print(ans)
j = 0
for i in range(ind, ind + len(s)):
	if t[i] != s[j]:
		print(j + 1, end=' ')
	j += 1


(n, m) = map(int, input().split())
s = input()
t = input()
k = [-1] * 1000
for i in range(m - n + 1):
	x = t[i:i + n]
	temp = []
	for j in range(n):
		if x[j] != s[j]:
			temp.append(j)
	if len(temp) <= len(k):
		k = temp
print(len(k))
for i in k:
	print(i + 1, end=' ')


(m, n) = list(map(int, input().strip().split(' ')))
s = input()
t = input()
MIN = len(s) + 1
index = -1
for i in range(0, len(t) - len(s) + 1):
	count = 0
	for j in range(i, i + len(s)):
		if s[j - i] != t[j]:
			count += 1
	if count < MIN:
		MIN = count
		index = i
ANS = []
for j in range(index, index + len(s)):
	if s[j - index] != t[j]:
		ANS += [j - index + 1]
print(MIN)
print(*ANS)


(n, m) = map(int, input().split())
mi = 100000000000000
ts = ''

def num_d(a, b):
	t = 0
	for x in range(len(a)):
		if a[x] != b[x]:
			t += 1
	return t
(s, t) = (input(), input())
for x in range(m - n + 1):
	d = num_d(s, t[x:x + n])
	if d < mi:
		mi = d
		ts = t[x:x + n]
print(mi)
for x in range(n):
	if s[x] != ts[x]:
		print(x + 1, end=' ')


(n, m) = [int(i) for i in input().split()]
s = input()
t = input()
mini = m + 1
list2 = []
for x in range(m - n + 1):
	word = t[x:x + n]
	list1 = []
	count = 0
	for y in range(len(word)):
		if word[y] != s[y]:
			count += 1
			list1.append(y + 1)
	if count < mini:
		mini = count
		list2[:] = list1[:]
print(mini)
for item in list2:
	print(item, end=' ')


(n, m) = map(int, input().split())
s = input().strip()
t = input().strip()
(best_i, best_len) = (0, 0)
for i in range(m - n + 1):
	l = 0
	for j in range(n):
		if t[i + j] == s[j]:
			l += 1
	if l > best_len:
		best_len = l
		best_i = i
print(n - best_len)
for i in range(n):
	if s[i] != t[i + best_i]:
		print(i + 1, end=' ')
print()


(n, m) = map(int, input().split())
s = input()
t = input()
(num, d) = (100000, 0)
for i in range(m - n + 1):
	v = 0
	for j in range(i, i + n):
		if s[j - i] != t[j]:
			v += 1
	if v < num:
		(num, d) = (v, i)
print(num)
for i in range(d, d + n):
	if s[i - d] != t[i]:
		print(i - d + 1, end=' ')


(n, m) = map(int, input().split())
p = input()
t = input()
max_match = -1
changed = []
for x in range(m - n + 1):
	match = 0
	c = []
	for (y, char) in enumerate(p):
		if char != t[x + y] and char != '?':
			c.append(str(y + 1))
		else:
			match += 1
	if match > max_match:
		max_match = match
		changed = c
print(n - max_match)
print(' '.join(changed))


(n, m) = map(int, input().split())
s = input()
t = input()
min = n
index_start = 0
for i in range(m - n + 1):
	count = 0
	for j in range(n):
		if t[i + j] != s[j]:
			count += 1
	if count == 0:
		min = 0
		index_start = i
		break
	if count < min:
		min = count
		index_start = i
print(min)
for i in range(n):
	if t[index_start + i] != s[i]:
		print(i + 1, end=' ')


(firstLength, secondLength) = map(int, input().split())
(firstEntry, secondEntry) = (input(), input())
result = []
limit = 999999
x = 0
y = 0
aux = []
for x in range(secondLength - firstLength + 1):
	aux = []
	for y in range(firstLength):
		if firstEntry[y] != secondEntry[x + y]:
			aux.append(y)
	if len(aux) < limit:
		result = aux
		limit = len(aux)
print(limit)
r = 0
for r in result:
	print(r + 1, end=' ')


(n, m) = map(int, input().split())
s = input()
t = input()
mn = n + 1
mni = -1
for i in range(m - n + 1):
	c = 0
	for j in range(n):
		if t[i + j] != s[j]:
			c += 1
	if c < mn:
		mn = c
		mni = i
print(mn)
for j in range(n):
	if t[mni + j] != s[j]:
		print(j + 1, end=' ')
print()


(n, m) = map(int, input().split())
s = input()
t = input()
k = len(s)
positions = set()
for i in range(len(t) - len(s) + 1):
	new_k = 0
	new_positions = set()
	for j in range(len(s)):
		if t[i + j] != s[j]:
			new_k += 1
			new_positions.add(j + 1)
		if new_k > k:
			break
	else:
		k = new_k
		positions = new_positions
print(k)
print(*positions)


_ = input()
s = input()
t = input()

def f(s, t):
	n = []
	for i in range(len(s)):
		if s[i] != t[i]:
			n.append(i + 1)
	return n
a = [f(s, t[i:len(s) + i]) for i in range(len(t) - len(s) + 1)]
b = a[0]
for i in a:
	if len(b) > len(i):
		b = i
print(len(b))
print(' '.join([str(i) for i in b]))


(n, m) = map(int, input().split())
s = input()
t = input()
minrep = float('inf')
replist = []
for i in range(m - n + 1):
	ls = []
	reps = 0
	for j in range(n):
		if s[j] != t[i + j]:
			reps += 1
			ls.append(j + 1)
	if reps < minrep:
		minrep = reps
		replist = ls
print(minrep)
for x in replist:
	print(x, end=' ')


(n, m) = map(int, input().split())
c = input()
s = input()
y = 1000000000
for i in range(m - n + 1):
	t = s[i:i + n]
	x = 0
	for i in range(n):
		if t[i] != c[i]:
			x += 1
	if x < y:
		y = x
		q = t + ''
print(y)
for i in range(n):
	if q[i] != c[i]:
		print(i + 1, end=' ')


(a, b) = map(int, input().split())
p = list(input())
h = list(input())
l = []
m = []
for i in range(0, b - a + 1):
	s = h[i:i + a]
	j = 0
	for (x, y) in zip(s, p):
		if x != y:
			j = j + 1
	l.append(j)
	m.append(s)
print(min(l))
n = l.index(min(l))
t = m[n]
z = []
index = 0
for (x, y) in zip(t, p):
	index = index + 1
	if x != y:
		z.append(index)
z = [str(u) for u in z]
print(' '.join(z))


import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
(n, m) = rm()
a = input()
b = input()
res = math.inf
ans = []
for i in range(m - n + 1):
	cal = 0
	temp = []
	for j in range(n):
		if a[j] != b[i + j]:
			cal += 1
			temp.append(j + 1)
	if cal < res:
		res = cal
		ans = temp
print(res)
print(*ans)


from math import inf
inp = input().split()
s = input().rstrip()
t = input().rstrip()
res = inf
change = []
for (i, a) in enumerate(t):
	val = 0
	tmp_change = []
	for (j, b) in enumerate(s):
		if i + j >= len(t):
			break
		if b != t[i + j]:
			val += 1
			tmp_change.append(str(j + 1))
	else:
		if res > val:
			res = val
			change = tmp_change
print(res)
print(' '.join(change))


(n, m) = map(int, input().split())
s = input()
t = input()
best = list(range(n))
for i in range(m):
	if i + n > m:
		break
	k = t[i:i + n]
	cur = []
	for j in range(n):
		if s[j] != k[j]:
			cur.append(j)
	if len(cur) < len(best):
		best = cur
print(len(best))
for i in best:
	print(i + 1, end=' ')


(size_s, size_t) = input().split(' ')
s_string = input()
t_string = input()
best_num_replaced = float('inf')
best_change_letters = ''
for t in range(int(size_t) - int(size_s) + 1):
	num_replaced = 0
	change_letters = ''
	for s in range(int(size_s)):
		if s_string[s] != t_string[s + t]:
			num_replaced += 1
			change_letters += str(s + 1) + ' '
	if num_replaced < best_num_replaced:
		best_num_replaced = num_replaced
		best_change_letters = change_letters
print(best_num_replaced)
print(best_change_letters.strip())


def stringMatch(s, t):
	n = len(s)
	m = len(t)
	diff = m - n
	numCharMatch = mostCharMatchIndex = 0
	for i in range(diff + 1):
		curNumCharMatch = 0
		for j in range(n):
			if s[j] == t[i + j]:
				curNumCharMatch += 1
		if curNumCharMatch > numCharMatch:
			mostCharMatchIndex = i
			numCharMatch = curNumCharMatch
	mismatchList = []
	for i in range(n):
		if s[i] != t[i + mostCharMatchIndex]:
			mismatchList.append(i + 1)
	return (n - numCharMatch, mismatchList)
input()
(numMismatch, mismatchPos) = stringMatch(input(), input())
print(numMismatch)
print(*mismatchPos)


(Ln, Lm) = input().split()
n = int(Ln)
m = int(Lm)
s = input()
t = input()
out = []
for i in range(m - n + 1):
	next = i + n
	diff = []
	aux = t[i:next]
	for j in range(n):
		if s[j] != '?' and s[j] != aux[j]:
			diff.append(str(j + 1))
	if len(diff) == 0:
		out = diff
		break
	elif len(diff) < len(out) or out == []:
		out = diff
	diff = []
print(len(out))
print(' '.join(out))


import sys
read = lambda : sys.stdin.readline().rstrip()
readi = lambda : int(sys.stdin.readline())
writeln = lambda x: sys.stdout.write(str(x) + '\n')
write = lambda x: sys.stdout.write(x)
(n, m) = map(int, read().split())
(s, t) = (read(), read())
(mcnt, midx) = (-1, -1)
for i in range(m - n + 1):
	cnt = 0
	for j in range(n):
		if s[j] == t[j + i]:
			cnt += 1
	if cnt > mcnt:
		mcnt = cnt
		midx = i
k = 0
pos = []
for i in range(n):
	if s[i] != t[midx + i]:
		k += 1
		pos.append(str(i + 1))
writeln(k)
if k:
	writeln(' '.join(pos))


x = input()
a = input()
b = input()

def dif(a, b):
	ans = 0
	for i in range(len(a)):
		if a[i] != b[i]:
			ans += 1
	return ans
fans = len(a) + 1
fans2 = []
for i in range(len(b) - len(a) + 1):
	if dif(b[i:i + len(a)], a) < fans:
		fans = dif(b[i:i + len(a)], a)
		fans2 = []
		d = b[i:i + len(a)]
		for i in range(len(a)):
			if a[i] != d[i]:
				fans2.append(i + 1)
print(fans)
for i in fans2:
	print(i, end=' ')


(n, m) = map(int, input().split())
s = input()
t = input()
ans = 1000000
pos = -1
for i in range(m - n + 1):
	tmp = 0
	for j in range(n):
		if s[j] != t[j + i]:
			tmp += 1
	if tmp < ans:
		ans = min(ans, tmp)
		pos = i
print(ans)
for i in range(n):
	if s[i] != t[pos + i]:
		print(i + 1, end=' ')
print()


from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction
mod = 100000009

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')

def binsearch(a, l, r, x):
	while l <= r:
		mid = l + (r - 1) // 2
		print(mid)
		if a[mid]:
			return mid
		elif a[mid] > x:
			l = mid - 1
		else:
			r = mid + 1
	return -1
(a, b) = mi()
s = si()
t = si()
l = []
for i in range(b - a + 1):
	count = 0
	for j in range(a):
		if s[j] == t[j + i]:
			count += 1
	l.append(count)
x = l.index(max(l))
out = []
j = 0
for i in range(x, x + a):
	if s[j] != t[i]:
		out.append(j + 1)
	j += 1
print(len(out))
print(*out)


(n, m) = map(int, input().split())
A = input()
B = input()

def GetValue(p):
	cnt = 0
	for i in range(n):
		if A[i] != B[p + i]:
			cnt += 1
	return cnt
opt = 0
Min = 1001
for i in range(m - n + 1):
	p = GetValue(i)
	if Min > p:
		Min = p
		opt = i
print(Min)
for i in range(n):
	if A[i] != B[opt + i]:
		print(i + 1, end=' ')
print()


(length_1, length_2) = map(int, input().split())
string_1 = input()
string_2 = input()
final_len = 10 ** 4
final_pos = []
temp_str1 = list(string_1)
for i in range(0, length_2 - length_1 + 1):
	temp_str2 = list(string_2[i:i + length_1])
	temp_pos = []
	temp_len = 0
	for j in range(0, length_1):
		if temp_str1[j] == temp_str2[j]:
			pass
		else:
			temp_len += 1
			temp_pos.append(j + 1)
	if temp_len < final_len:
		final_len = temp_len
		final_pos = temp_pos
print(final_len)
for each in final_pos:
	print(each, end=' ')


(a, b) = map(int, input().split())
z = input()
z1 = input()
q = ['0'] * a
for i in range(b - a + 1):
	k = []
	for j in range(a):
		if z1[i + j] != z[j]:
			k += [j + 1]
	if len(k) <= len(q):
		q = k
print(len(q), '\n', *q)


def Crossword():
	CList = []
	SStr = []
	TStr = []
	IPT = input()
	iPT = IPT.split()
	s = int(iPT[0])
	t = int(iPT[1])
	minChange = s
	sStr = input()
	tStr = input()
	for x in sStr:
		SStr.append(x)
	for y in tStr:
		TStr.append(y)
	for i in range(t - s + 1):
		tempChange = s
		clist = []
		for j in range(i, i + s):
			if TStr[j] == SStr[j - i]:
				tempChange -= 1
			else:
				clist.append(j - i)
		if tempChange <= minChange:
			minChange = tempChange
			CList = []
			for k in clist:
				CList.append(k)
	print(minChange)
	for x in CList:
		print(x + 1, end=' ')
Crossword()


(n, m) = map(int, input().split())
daf = input()
daf2 = input()
min_cha = m
min_ind = set()
for i in range(m - n + 1):
	daf3 = daf2[i:i + n]
	ind = set()
	dif = 0
	for j in range(n):
		if daf3[j] != daf[j]:
			ind.add(j)
			dif += 1
	if dif <= min_cha:
		min_ind = ind
		min_cha = dif
print(min_cha)
for x in min_ind:
	print(x + 1, end=' ')
print()


def get_min_replacement(a: str, b: str):
	minRep = len(a)
	minRepArr = []
	for i in range(len(b) - len(a) + 1):
		repArr = []
		for j in range(len(a)):
			if a[j] != b[i + j]:
				repArr.append(j + 1)
		if len(repArr) <= minRep:
			minRep = len(repArr)
			minRepArr = repArr
	return minRepArr
(n, m) = map(int, input().split())
s = str(input())
t = str(input())
minRepArr = get_min_replacement(s, t)
print(len(minRepArr))
for i in range(len(minRepArr)):
	print(minRepArr[i], end=' ')


(n, m) = map(int, input().split())
s = input()
t = input()
arr_s = []
arr_t = []
ans = []
ans_pos = []
ans_pos_final = []
counter = 0
word = []
if s in t:
	print(0)
else:
	for i in s:
		arr_s.append(i)
	for i in t:
		arr_t.append(i)
	for (index, i) in enumerate(arr_t):
		if index + len(s) <= len(t):
			for k in range(len(arr_s)):
				if arr_t[index + k] != arr_s[k]:
					counter += 1
					ans_pos.append(k + 1)
			ans_pos_final.append(ans_pos)
			ans.append(counter)
			counter = 0
			ans_pos = []
	print(min(ans))
	for i in ans_pos_final:
		if len(i) == min(ans):
			result = i
			break
	for i in result:
		word.append(str(i))
	print(' '.join(word))


(len1, len2) = input().split()
len1 = int(len1)
len2 = int(len2)
s = input()
t = input()
list_ = []
list_x = []
answer = []
count = 1000
index = 0
for i in range(0, len2):
	list_.append(t[i:i + len1])
for i in list_:
	if len(i) == len1:
		list_x.append(i)
for i in list_x:
	counter = 0
	for x in range(0, len(i)):
		if i[x] != s[x]:
			counter += 1
	if count > counter:
		count = counter
		index = list_x.index(i)
print(count)
for i in range(0, len(list_x[index])):
	if list_x[index][i] != s[i]:
		answer.append(i + 1)
print(*answer, sep=' ')


(n, m) = [int(x) for x in input().split()]
s = input()
t = input()
ans = None
for i in range(m - n + 1):
	cur = []
	for j in range(n):
		if s[j] != t[i + j]:
			cur.append(j + 1)
	if ans is None or len(cur) < len(ans):
		ans = cur
print(len(ans))
for x in ans:
	print(x, end=' ')


(a, b) = map(int, input().split())
(s1, s2) = (input(), input())

def r(s1, s2):
	cnt = 0
	for i in range(len(s2)):
		if s1[i] == s2[i]:
			cnt += 1
	return cnt
m = max((r(s1, s2[i:i + len(s1)]) for i in range(len(s2) - len(s1) + 1)))
for i in range(len(s2) - len(s1) + 1):
	if m == r(s1, s2[i:i + len(s1)]):
		print(len(s1) - m)
		for (i, j, k) in zip(s1, s2[i:i + len(s1)], list(range(len(s1)))):
			if i != j:
				print(k + 1, end=' ')
		break


ll = input().split(' ')
l1 = int(ll[0])
l2 = int(ll[1])
str1 = input()
str2 = input()
py = l2 - l1
minc = l1
listc = range(len(str1) + 1)[1:]
for p in range(py + 1):
	c = l1
	list = []
	for k in range(l1):
		if str1[k] == str2[p + k]:
			c -= 1
		else:
			list.append(k + 1)
	if c < minc:
		minc = c
		listc = list
		if c == 0:
			break
re = ''
for p in listc:
	if re == '':
		re += str(p)
	else:
		re += ' ' + str(p)
print(minc)
if len(re) > 0:
	print(re)


(a, b) = map(int, input().split())
c = input()
d = input()
maxi = a
ko = []
for i in range(b - a + 1):
	premax = 0
	po = []
	for j in range(a):
		if c[j] != d[j + i]:
			premax += 1
			po.append('%s' % (j + 1))
	if premax <= maxi:
		maxi = premax
		ko = po
print(maxi)
print(' '.join(ko))


inp = list(map(int, input().rstrip().split(' ')))
s = input()
t = input()

def change_positions_and_count(str_s, str_t, index_t):
	positions = []
	count = 0
	for i in range(inp[0]):
		if index_t >= inp[1]:
			return ([], 2000)
		if str_s[i] != str_t[index_t]:
			positions.append(i + 1)
			count += 1
		index_t += 1
	return (positions, count)
change_pos = [k + 1 for k in range(inp[0])]
cnt = inp[0]
for j in range(inp[1]):
	(new_change_pos, new_cnt) = change_positions_and_count(str_s=s, str_t=t, index_t=j)
	if new_cnt < cnt:
		change_pos = new_change_pos
		cnt = new_cnt
print(cnt)
for x in change_pos:
	print(str(x) + ' ', end='')


def main():
	(n, m) = map(int, input().split())
	(s, t) = (input(), input())
	x = min(range(m - n + 1), key=lambda j: sum((c != t[i] for (i, c) in enumerate(s, j)))) - 1
	res = [i for (i, c) in enumerate(s, 1) if c != t[i + x]]
	print(len(res))
	print(*res)
main()


(n, m) = map(int, input().split())
s = input().strip()
t = input().strip()
d = {}
for i in range(len(t)):
	x = ''
	for j in range(i, min(i + len(s), len(t))):
		x += t[j]
	c = 0
	if len(x) == len(s):
		v = []
		for k in range(len(x)):
			if x[k] != s[k]:
				c += 1
				v.append(k)
		d[c] = v
m = 9999999
res = []
for (k, v) in d.items():
	if k < m:
		m = k
		res = v
print(m)
for i in res:
	print(i + 1, end=' ')


tempArr = list(map(int, input().split()))
lenS = tempArr[0]
lenT = tempArr[1]
s = str(input())
t = str(input())
minQues = len(s)
minQuesList = []
for j in range(len(s)):
	minQuesList.append(j + 1)
for i in range(len(t) - len(s) + 1):
	numQues = 0
	quesList = []
	for j in range(i, i + len(s)):
		if t[j] != s[j - i]:
			numQues += 1
			quesList.append(j - i + 1)
	if numQues < minQues:
		minQues = numQues
		minQuesList = quesList
print(minQues)
for num in minQuesList:
	print(num)


from math import gcd, ceil
from collections import defaultdict as dd

def lcm(a, b):
	return a * b // gcd(a, b)

def inin():
	return int(input())

def inar():
	return list(map(int, input().split()))

def ar(element, size):
	return [element for i in range(size)]

def digitsum(num):
	su = 0
	while num:
		su += num % 10
		num //= 10
	return su
(n, m) = inar()
sn = input()
sm = input()
ans = float('inf')
ansarr = []
(l, r) = (0, n)
while r <= m:
	temp = sm[l:r]
	arr = []
	cnt = 0
	for i in range(n):
		if sn[i] == '?':
			cnt += 0
		elif sn[i] != temp[i]:
			cnt += 1
			arr.append(i + 1)
		else:
			cnt += 0
	if cnt < ans:
		ans = cnt
		ansarr = arr[:]
	l += 1
	r += 1
print(ans)
print(*ansarr)


def int_map():
	return map(int, input().split(' '))
(n, m) = int_map()
s = input()
t = input()
res = [-1]
i = 0
for i in range(m - n + 1):
	buf = [-1]
	for j in range(n):
		if s[j] != t[i + j]:
			if buf[0] == -1:
				buf = [j + 1]
			else:
				buf.append(j + 1)
	if buf[0] == -1:
		buf = []
	if res == [-1]:
		res = buf
	elif len(res) > len(buf):
		res = buf
if res == [-1]:
	res = []
print(len(res))
print(*res)


import sys

def find_min_replacement(n, s, m, t):
	min_match = None
	min_match_positions = None
	for i in range(m - n + 1):
		mismatch = 0
		positions = []
		for j in range(i, i + n):
			if s[j - i] != t[j]:
				mismatch += 1
				positions.append(str(j - i + 1))
		if min_match is None or mismatch < min_match:
			min_match = mismatch
			min_match_positions = positions
	return (min_match, min_match_positions)
line = sys.stdin.readline()
(n, m) = [int(k) for k in line.split(' ')]
s = sys.stdin.readline()
t = sys.stdin.readline()
(min_mismatch, min_match_positions) = find_min_replacement(n, s, m, t)
print(min_mismatch)
print(' '.join(min_match_positions))


marks = []
resp = []

def diferenca(s, t):
	dif = 0
	for i in range(len(s)):
		if s[i] != t[i]:
			marks.append(i + 1)
			dif += 1
	return dif

def main():
	(N, M) = input().split()
	N = int(N)
	M = int(M)
	s = input()
	t = input()
	minimo = N + 1
	for i in range(M - N + 1):
		marks.clear()
		k = diferenca(s, t[i:i + N])
		if k < minimo:
			minimo = k
			resp = list(marks)
	print(minimo)
	n_out = len(resp)
	out = ''
	for i in resp:
		n_out -= 1
		out = out + str(i)
		if n_out != 0:
			out = out + ' '
	print(out)
main()


import math
import sys
from collections import *
import itertools

def cint():
	return list(map(int, sys.stdin.readline().strip().split()))

def cstr():
	return list(map(str, input().split(' ')))

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def solve(t):
	(n, m) = cint()
	s1 = input()
	s2 = input()
	n1 = len(s1)
	n2 = len(s2)
	min_count = math.inf
	min_lst = []
	for i in range(n2 - n1 + 1):
		count = 0
		lst = []
		for j in range(n1):
			if s1[j] != s2[i + j]:
				count += 1
				lst.append(j)
		if count < min_count:
			min_count = count
			min_lst = lst.copy()
	print(min_count)
	for item in min_lst:
		print(item + 1, end=' ')
	print('')
t = 1
for i in range(1, t + 1):
	solve(i)


nmStr = input()
nm = nmStr.split()
n = int(nm[0])
m = int(nm[1])
s = input()
t = input()
bestMiss = [0] * (m + 1)
for i in range(0, m - n + 1):
	miss = []
	for j in range(0, n):
		if s[j] != t[j + i] and s[j] != '?' and (t[j + i] != '?'):
			miss.append(j + 1)
			if len(miss) >= len(bestMiss):
				break
	if len(miss) < len(bestMiss):
		bestMiss = miss
print(len(bestMiss))
for pos in bestMiss:
	print(pos, '', end='')


nandm = [int(i) for i in input().split()]
nsize = nandm[0]
msize = nandm[1]
n = list(input())
m = list(input())
high = 0
missingbest = []
for i in range(msize - nsize + 1):
	counter = 0
	string = m[i:i + nsize]
	missing = [i + 1 for i in range(0, nsize)]
	for j in range(len(string)):
		if string[j] == n[j]:
			counter += 1
			missing.remove(j + 1)
	if counter > high:
		missingbest.clear()
		high = counter
		for x in missing:
			missingbest.append(x)
print(nsize - high)
if nsize != high:
	if len(missingbest) == 0 and n != m:
		print(*[i for i in range(1, nsize + 1)])
	else:
		print(*missingbest)


(n, m) = map(int, input().split())
s = input()
t = input()
fuckall = 10000000000
ind = -1
for i in range(0, m - n + 1):
	j = 0
	anss = 0
	for k in range(i, i + n):
		if t[k] != s[j]:
			anss += 1
		j += 1
	if anss < fuckall:
		fuckall = anss
		ind = i
print(fuckall)
fuckcross = ''
k = 0
for j in range(ind, ind + n):
	if t[j] != s[k]:
		fuckcross += str(k + 1) + ' '
	k += 1
print(fuckcross)


(n, m) = map(int, input().strip().split())
(s, t) = (input(), input())
rst = [0] * (m + 1)
for i in range(m - n + 1):
	lst = [j + 1 for (j, x) in enumerate(zip(s, t[i:i + n])) if x[0] != x[1]]
	if len(rst) > len(lst):
		rst = lst
print(len(rst))
print(*rst)


(a, b) = map(int, input().split())
s = input()
t = input()
sl = len(s)
tl = len(t)
mask = []
best = 0
besti = 0
for i in range(tl - sl + 1):
	eq = 0
	for j in range(sl):
		if t[i + j] == s[j]:
			eq += 1
	if eq > best:
		best = eq
		besti = i
for j in range(sl):
	if t[besti + j] != s[j]:
		mask.append(j + 1)
print(sl - best)
for i in mask:
	print(i, end=' ')


(a, b) = list(map(int, input().split()))
s = input()
t = input()
r = []
w = []
for k in range(b - a + 1):
	e = t[k:k + a]
	u = 0
	h = []
	for i in range(a):
		if e[i] == s[i]:
			pass
		elif s[i] == '?':
			pass
		else:
			u += 1
			h.append(i + 1)
	r.append(u)
	w.append(h)
print(min(r))
print(*w[r.index(min(r))])


def crossword(s, t, n, m):
	ls = list(s)
	lt = list(t)
	mini = n + 1
	minil = set()
	for i in range(m - n + 1):
		tot = 0
		auxs = set()
		for j in range(n):
			if ls[j] is not lt[i + j]:
				tot += 1
				if tot > mini:
					break
				auxs.add(j)
		if mini > tot:
			mini = tot
			minil = auxs.copy()
	return (mini, minil)
i = input().split()
n = int(i[0])
m = int(i[1])
s = input()
t = input()
(total, seet) = crossword(s, t, n, m)
print(total)
for v in seet:
	print(v + 1, end=' ')
print()


from math import *
from collections import *
import sys
sys.setrecursionlimit(10 ** 9)
(n, m) = map(int, input().split())
s = input()
t = input()
l = [0 for i in range(10000)]
for i in range(m - n + 1):
	r = []
	for j in range(n):
		if t[i + j] != s[j]:
			r.append(j + 1)
	if len(r) < len(l):
		l = r[:]
print(len(l))
for i in l:
	print(i, end=' ')


(n, m) = map(int, input().split())
s = input()
t = input()
ans = 1001
ansp = 0
for i in range(m - n + 1):
	matches = 0
	for j in range(n):
		if s[j] == t[i + j]:
			matches += 1
	if n - matches < ans:
		ans = min(n - matches, ans)
		ansp = i
print(ans)
ans1 = []
for j in range(n):
	if s[j] != t[ansp + j]:
		ans1.append(j + 1)
print(' '.join([str(i) for i in ans1]))


from sys import stdin
(n, m) = [int(i) for i in stdin.readline().split(' ')]
trim = lambda s: s[:-1] if s[-1] == '\n' else s
s = trim(stdin.readline())
t = trim(stdin.readline())
minNumber = n
minPlaces = [str(i) for i in range(1, n + 1)]
for i in range(0, m - n + 1):
	curNumber = 0
	curPlaces = []
	for j in range(0, n):
		if s[j] != t[i + j]:
			curNumber += 1
			curPlaces.append(str(j + 1))
	if curNumber <= minNumber:
		minNumber = curNumber
		minPlaces = curPlaces
print(minNumber)
print(' '.join(minPlaces))


(n, m) = map(int, input().split())
s = input()
t = input()
maxi = 0
maxin = []
for i in range(m - n + 1):
	count = 0
	temp = []
	for j in range(n):
		if s[j] == t[i + j]:
			count += 1
		else:
			temp.append(j + 1)
	if count >= maxi:
		maxi = count
		maxin = temp
print(n - maxi)
s = ''
for i in maxin:
	s += str(i) + ' '
print(s[:-1])


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l

def sq(a, target, arr=[]):
	s = sum(arr)
	if s == target:
		return arr
	if s >= target:
		return
	for i in range(len(a)):
		n = a[i]
		remaining = a[i + 1:]
		ans = sq(remaining, target, arr + [n])
		if ans:
			return ans

def SieveOfEratosthenes(n):
	cnt = 0
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			cnt += 1
	return cnt

def nCr(n, r):
	f = math.factorial
	return f(n) // f(r) // f(n - r)
mod = int(1000000000.0) + 7

def ssinp():
	return input()

def iinp():
	return int(input())

def nninp():
	return map(int, input().split())

def llinp():
	return list(map(int, input().split()))

def p(xyz):
	print(xyz)

def p2(a, b):
	print(a, b)
import math
(n, m) = nninp()
s = stl(ssinp())
t = stl(ssinp())
ans = 9420892034
al = []
for i in range(m - n + 1):
	ans1 = 0
	l = []
	for j in range(n):
		if t[i + j] != s[j]:
			ans1 += 1
			l.append(j + 1)
	if ans1 < ans:
		ans = ans1
		al = l
print(ans)
print(*al)


def check(r, o, p):
	change = 0
	for j in range(0, a):
		if o[j] != p[j + r] and o[j] != '?':
			change += 1
	return change
(a, b) = input().split()
(a, b) = [int(a), int(b)]
s = input()
t = input()
_min = b
ans = 0
for i in range(0, b - a + 1):
	if check(i, s, t) < _min:
		_min = check(i, s, t)
		ans = i
print(_min)
for k in range(0, a):
	if s[k] != t[k + ans]:
		print(k + 1, ' ', end='')


def distance(s, t):
	letters = []
	for i in range(len(s)):
		if s[i] != t[i] and s[i] != '?':
			letters.append(str(i + 1))
	return letters
input()
s = input()
t = input()
result = []
for i in range(len(t) - len(s) + 1):
	new = distance(s, t[i:i + len(s)])
	if len(new) == 0:
		result = new
		break
	if len(new) < len(result) or result == []:
		result = new
print(len(result))
print(' '.join(result))


def get_result(a, b):
	indexies = []
	result = 0
	for i in range(len(a)):
		if a[i] != b[i]:
			indexies.append(i + 1)
			result += 1
	return (indexies, result)
inputs = input()
first_l = int(inputs.split(' ')[0])
second_l = int(inputs.split(' ')[1])
first = input()
second = input()
best_result = first_l + 1
best_indexies = []
for i in range(first_l):
	best_indexies.append(i + 1)
for symbol_index in range(second_l - first_l + 1):
	substr = second[symbol_index:symbol_index + first_l]
	(new_indexies, new_result) = get_result(first, substr)
	if new_result < best_result:
		best_result = new_result + 1 - 1
		best_indexies = new_indexies[:]
print(best_result)
for i in best_indexies:
	print(i, end=' ')
print()


(n, m) = map(int, input().split())
a = input()
b = input()
maks = [0, 0]
for i in range(m - n + 1):
	ile = 0
	for j in range(n):
		if a[j] == b[j + i]:
			ile += 1
	if ile > maks[0]:
		maks[0] = ile
		maks[1] = i
maks[0] = n - maks[0]
spradz = b[maks[1]:maks[1] + n]
tab = list()
for i in range(n):
	if a[i] != spradz[i]:
		tab.append(i + 1)
print(maks[0])
print(*tab)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
(n, m) = mi()
s = input()
t = input()
ans = [[] for i in range(m - n + 1)]
for i in range(m - n + 1):
	for j in range(n):
		if s[j] != t[i + j]:
			ans[i].append(j + 1)
min_ = n
pos = 0
for i in range(m - n + 1):
	if min_ > len(ans[i]):
		min_ = len(ans[i])
		pos = i
print(min_)
print(*ans[pos])