import random

s_len_limit = 200000
t_sum_limit = 200000

max_t_len = 20

alphabet = ''.join([chr(ord('a') + i) for i in range(26)])

# Random seed chosen by arknave's fair dice roll. Guaranteed to be random.
seed = 97

seeded_random = random.Random(seed)

t_strs = []
t_sum = 0
while t_sum < t_sum_limit:
  # Use a random length, biased towards shorter strings.
  
  t_len = int(max_t_len * seeded_random.random() ** 5) + 1
  if t_len + t_sum > t_sum_limit:
    continue
  t_strs.append(''.join(seeded_random.choices(alphabet, k=t_len)))
  t_sum += t_len

print(''.join(random.choices(alphabet, k=s_len_limit)))
print(len(t_strs))
for t in t_strs:
  order_upper_bound = int(2 * s_len_limit / 26 ** t_len)
  print('%s %d' % (t, seeded_random.randint(1, order_upper_bound)))

  
