```Python
def graphTOF(data):
    """ graph the data from the time of flight sensors 

    T is in milliseconds
    TOFA is in mm
    data: [T:12345, TOFA:1234, T:12345, TOFB:1234, T:12345, TOFB:1234, ...]
    A and B not guaranteed to be sequential
    """

    # format to n/2, 2 array
    data = np.array(data).reshape((len(data)//2, 2))

    # set up arrays to store value and time for each sensor reading
    alphaTOF = []
    alphaTime = []

    betaTOF = []
    betaTime = []

    for pair in data:

        # get the time
        convertedTime = int(pair[0][3:])

        # put the time and value into the correct array
        if pair[1][3] == 'A':
            alphaTOF.append(int(pair[1][5:]))
            alphaTime.append(convertedTime)
        else:
            betaTOF.append(int(pair[1][5:]))
            betaTime.append(convertedTime)

    fig, ax = plt.subplots()

    # add axis labels
    ax.set_xlabel("Time (ms)")
    ax.set_ylabel("Distance (mm)")

    # plot
    ax.plot(alphaTime, alphaTOF, label = "Alpha")
    ax.plot(betaTime, betaTOF, label = "Beta")

    # add the title
    plt.title('TOF Data for both sensors vs time')

    # show the legend then show the graph
    plt.legend()
    plt.show()
```