import time
import math

def get_mtc(unix_timestamp, tai_utc_diff):
    """
    Calculate Coordinated Mars Time (MTC) given a Unix timestamp and TAI-UTC difference.

    @param unix_timestamp: Unix timestamp in seconds
    @param tai_utc_diff: TAI-UTC difference in seconds
    @return: MTC in HH:MM:SS format
    """
    # Calculate MSD
    msd = (unix_timestamp + tai_utc_diff) / 88775.244147 + 34127.2954262
    print(msd)
    # Calculate MTC
    mtc = (msd % 1) * 24
    print(msd % 1)
    # Convert MTC to HH:MM:SS
    hours = int(mtc)
    minutes = int((mtc - hours) * 60)
    seconds = int((mtc - hours - minutes / 60) * 3600)
    
    return f"{hours:02d}:{minutes:02d}:{seconds:02d}"

current_time = int(time.time())
print(current_time)
tai_utc_diff = 37  # As of 2020, this value is 37 seconds. You'll need to update it if it changes.

mtc = get_mtc(current_time, tai_utc_diff)
print(f"MTC: {mtc}")