def last_fib(num: int) -> int:
    """Return last Fibonacci number sequnce before number num"""
    if num == 0:
        return 0
    fib = [0, 1]
    i = 2
    # appends fib numbers until fib[-1] == num or > num
    # if fib[-1] > num it means that first number of original sequnce
    # data isn't belong to fib nums
    while fib[-1] < num:
        fib.append(fib[i - 1] + fib[i - 2])
        i += 1

    return fib[-1]