#!/usr/bin/env python

"""Reads sequences separated by one empty line and randomizes their order before
printing them out again."""

# FIXME produces one empty sequence

import random
import sys

sequences = []
sequence = []

for line in sys.stdin:
    line = line.rstrip()
    if line:
        sequence.append(line)
    else:
        sequences.append(sequence)
        sequence = []

sequences.append(sequence)

random.shuffle(sequences)

for sequence in sequences:
    for line in sequence:
        print line
    print
