Hash
시간 제한2초메모리 제한256 MB
해시 매개변수 a와 b가 주어질 때, 길이 50 이하의 서로 다른 소문자 문자열 100개를 만들어 모두 같은 해시 값을 갖도록 한다.
문제
A HAIKU is a string that consists of at most 50 lowercase English letters. For a HAIKU , you can compute the hash as follows:
h = 0
for i=0,...|s|-1
h = (h * a + (s[i] - 'a' + 1)) % b
You are given two integers and . Construct 100 distinct HAIKUs that have the same hash.
입력
You are given two space-separated integers and (, ).
출력
Print 100 HAIKUs with the same hash, one per line.
힌트
Several HAIKUs are omitted in the printed version of statements; the full version is published in the contest system.