def polybius_flatten(pair, column_first):
    """Convert a pair of characters into a single string."""
    if column_first:
        return str(pair[1]) + str(pair[0])
    else:
        return str(pair[0]) + str(pair[1])