import ftplib
import os

HOST = 'so.deployin.site'
USER = 'itsk@so.deployin.site'
PASS = 'ITSk@2026'

print(f'FTP host: {HOST}')
print(f'Current directory: {os.getcwd()}')

try:
    ftp = ftplib.FTP(HOST, timeout=30)
    print('Connected to FTP host')
    try:
        resp = ftp.login(USER, PASS)
        print('Login response:', resp)
    except Exception as e:
        print('Login failed:', e)
        raise
    print('PWD:', ftp.pwd())
    print('Listing root directory:')
    ftp.retrlines('LIST')
    ftp.quit()
except Exception as exc:
    print('ERROR:', type(exc).__name__, exc)
    raise
