Buggy python submission (verdict: Runtime Error):
from itertools import permutations

while True:
	n = input()
	if n == 0: break
	k = input()
	nums = [raw_input() for i in xrange(n)]
	result = set("".join(p) for p in permutations(nums, k))
	print len(result)

Fixed submission:
import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Buggy python submission (verdict: Runtime Error):
from itertools import permutations

while True:
	n = input()
	k = input()
	if n == k == 0: break
	nums = [raw_input() for i in xrange(n)]
	result = set("".join(p) for p in permutations(nums, k))
	print len(result)

Fixed submission:
import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Buggy python submission (verdict: Runtime Error):
from itertools import permutations

while True:
	n = int(raw_input().strip())
	k = int(raw_input().strip())
	if n == k == 0: break
	nums = [raw_input().strip() for i in xrange(n)]
	result = set("".join(p) for p in permutations(nums, k))
	print len(result)

Fixed submission:
import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Buggy python submission (verdict: Runtime Error):
from itertools import permutations

while True:
	n = int(raw_input().strip())
	k = int(raw_input().strip())
	if n == k == 0:
		break
	nums = [raw_input().strip() for i in xrange(n)]
	result = set(["".join(p) for p in permutations(nums, k)])
	print len(result)

Fixed submission:
import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Buggy python submission (verdict: Runtime Error):
while True:
	n = int(raw_input().strip())
	k = int(raw_input().strip())
	if n == k == 0:
		break
	nums = [raw_input().strip() for i in xrange(n)]
	print 0

Fixed submission:
import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Buggy python submission (verdict: Runtime Error):
from itertools import permutations

while True:
	n = input()
	k = input()
	if n == k == 0:
		break
	nums = [raw_input().strip() for i in xrange(n)]
	result = set(["".join(p) for p in permutations(nums, k)])
	print(len(result))

Fixed submission:
import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Buggy python submission (verdict: Runtime Error):
import sys
from itertools import permutations

while True:
	n = input()
	k = input()
	if n == k == 0:
		sys.exit(0)
	nums = [raw_input().strip() for i in xrange(n)]
	result = set(["".join(p) for p in permutations(nums, k)])
	print(len(result))

Fixed submission:
import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Buggy python submission (verdict: Runtime Error):
import sys
from itertools import permutations

def main():
	while True:
		n = input()
		k = input()
		if n == k == 0:
			return 0
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Fixed submission:
import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Buggy python submission (verdict: Runtime Error):
import sys
from itertools import permutations

def main():
	while True:
		n, k = map(int, raw_input().split())
		if n == k == 0:
			sys.exit(0)
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Fixed submission:
import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Buggy python submission (verdict: Runtime Error):
import sys
from itertools import permutations

def main():
	while True:
		n = input()
		k = input()
		if n == k == 0:
			sys.exit(0)
		for i in xrange(n):
			input()
#		nums = [raw_input().strip() for i in xrange(n)]
#		result = set(["".join(p) for p in permutations(nums, k)])
#		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

Fixed submission:
import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())