def location_to_row_col(location, block, plate):
    """Converts a block location to (row, col) on the plate.

    Args:
        location: Text location in the block, e.g. "1:A".
        block: Integer block number.
        plate: Integer plate number.

    Returns:
        Tuple of (row, col) integers; the location on the plate.
    """
    if plate == 3:
        row_letter, col = location.split(':')
    else:
        col, row_letter = location.split(':')
    col = int(col)
    row = ord(row_letter) - 64
    if block == 2:
        col += 24
    elif block == 3:
        row += 16
    elif block == 4:
        row += 16
        col += 24
    return row, col