from datetime import datetime
import pymysql
import requests
from bs4 import BeautifulSoup
from w3lib.html import remove_tags
while True:
    # import datetime
    # now_time = datetime.datetime.now()
    # next_time = now_time + datetime.timedelta(days=+1)
    # next_year = next_time.date().year
    # next_month = next_time.date().month
    # next_day = next_time.date().day
    # next_time = datetime.datetime.strptime(str(next_year) + "-" + str(next_month) + "-" + str(next_day) + " 20:30:01","%Y-%m-%d %H:%M:%S")
    # timer_start_time = (next_time - now_time).total_seconds()
    db = pymysql.connect(host="127.0.0.1",user="root",password="2GS@bPYcgiMyL14A",database="Macroeconomics",port=4423)
    cursor = db.cursor()
    sql = "select quarterly from SAALOCBITUSS_ASSET order by id desc limit 1"
    cursor.execute(sql)
    db.commit()
    old_time = cursor.fetchall()
    old_time=old_time[0][0]
    list=[]
    page = requests.get("https://www.federalreserve.gov/releases/h8/current/default.htm")
    page=page.text
    page = BeautifulSoup(page, 'html.parser')
    page = page.find_all('table')
    table1=page[0]
    table1=table1.select('tr')
    timestamp=table1[0]
    timestamp = remove_tags(str(timestamp))
    timestamp=timestamp.split()
    timestamp= timestamp[-2] + timestamp[-1]
    timestamp = timestamp.replace("Jan", "/1/1")
    timestamp = timestamp.replace("Feb", "/2/1")
    timestamp = timestamp.replace("Mar", "/3/1")
    timestamp = timestamp.replace("Apr", "/4/1")
    timestamp = timestamp.replace("May", "/5/1")
    timestamp = timestamp.replace("Jun", "/6/1")
    timestamp = timestamp.replace("Jul", "/7/1")
    timestamp = timestamp.replace("Aug", "/8/1")
    timestamp = timestamp.replace("Sep", "/9/1")
    timestamp = timestamp.replace("Oct", "/10/1")
    timestamp = timestamp.replace("Nov", "/11/1")
    timestamp = timestamp.replace("Dec", "/12/1")
    format = '%Y/%m/%d'
    timestamp = datetime.strptime(timestamp, format)
    if timestamp != old_time:
        for i in range(1,31):
            table_value=table1[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list+=[table_value[-1].replace(',', '')]

        table2=page[1]
        table2=table2.select('tr')
        for i in range(2,46):
            table_value=table2[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list+=[table_value[-5].replace(',', '')]

        table3=page[2]
        table3=table3.select('tr')
        for i in range(2,46):
            table_value=table3[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list+=[table_value[-5].replace(',', '')]

        table4=page[3]
        table4=table4.select('tr')
        for i in range(2,46):
            table_value=table4[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list+=[table_value[-5].replace(',', '')]

        table5=page[4]
        table5=table5.select('tr')
        for i in range(2,46):
            table_value=table5[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list+=[table_value[-5].replace(',', '')]

        table6=page[5]
        table6=table6.select('tr')
        for i in range(2,46):
            table_value=table6[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list+=[table_value[-5].replace(',', '')]

        table7=page[6]
        table7=table7.select('tr')
        for i in range(2,46):
            table_value=table7[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list+=[table_value[-5].replace(',', '')]

        table8=page[7]
        table8=table8.select('tr')
        for i in range(2,46):
            table_value=table8[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list+=[table_value[-5].replace(',', '')]

        table9=page[8]
        table9=table9.select('tr')
        for i in range(2,46):
            table_value=table9[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list+=[table_value[-5].replace(',', '')]

        table10=page[9]
        table10=table10.select('tr')
        for i in range(2,46):
            table_value=table10[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list+=[table_value[-5].replace(',', '')]

        table11 = page[10]
        table11 = table11.select('tr')
        for i in range(2, 46):
            table_value = table11[i]
            table_value = remove_tags(str(table_value))
            table_value = table_value.split()
            if table_value == []:
                continue
            if table_value == ['Assets']:
                continue
            if table_value == ['Liabilities']:
                continue
            list += [table_value[-5].replace(',', '')]
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[0])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[1])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[2])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[3])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[4])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[5])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[6])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[7])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[8])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[9])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[10])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[11])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[12])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[13])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[14])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[15])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[16])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[17])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[18])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[19])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[20])
        cursor.execute(sql)

        sql = "insert into SAALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[21])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[22])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[23])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[24])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[25])
        cursor.execute(sql)
        sql = "insert into SAALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[26])
        cursor.execute(sql)

        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[27])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[28])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[29])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[30])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[31])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[32])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[33])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[34])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[35])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[36])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[37])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[38])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[39])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[40])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[41])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Construction and land development loans', list[42])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by farmland', list[43])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by multifamily properties', list[44])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by nonfarm nonresidential properties', list[45])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[46])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[47])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[48])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Automobile loans', list[49])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other consumer loans', list[50])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[51])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to nondepository financial institutions', list[52])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All loans not elsewhere classified', list[53])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[54])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[55])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[56])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[57])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[58])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[59])
        cursor.execute(sql)

        sql = "insert into AALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[60])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[61])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[62])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[63])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Net due to related foreign offices', list[64])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[65])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[66])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residual (Assets LESS Liabilities)', list[67])
        cursor.execute(sql)

        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[68])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[69])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[70])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[71])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[72])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[73])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[74])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[75])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[76])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[77])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[78])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[79])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[80])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[81])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[82])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Construction and land development loans', list[83])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by farmland', list[84])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by multifamily properties', list[85])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by nonfarm nonresidential properties', list[86])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[87])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[88])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[89])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Automobile loans', list[90])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other consumer loans', list[91])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[92])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to nondepository financial institutions', list[93])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All loans not elsewhere classified', list[94])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[95])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[96])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[97])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[98])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[99])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[100])
        cursor.execute(sql)

        sql = "insert into AALOCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[101])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[102])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[103])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[104])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Net due to related foreign offices', list[105])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[106])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[107])
        cursor.execute(sql)
        sql = "insert into AALOCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residual (Assets LESS Liabilities)', list[108])
        cursor.execute(sql)

        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[109])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[110])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[111])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[112])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[113])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[114])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[115])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[116])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[117])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[118])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[119])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[120])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[121])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[122])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[123])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Construction and land development loans', list[124])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by farmland', list[125])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by multifamily properties', list[126])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by nonfarm nonresidential properties', list[127])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[128])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[129])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[130])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Automobile loans', list[131])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other consumer loans', list[132])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[133])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to nondepository financial institutions', list[134])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All loans not elsewhere classified', list[135])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[136])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[137])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[138])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[139])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[140])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[141])
        cursor.execute(sql)

        sql = "insert into AALODCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[142])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[143])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[144])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[145])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Net due to related foreign offices', list[146])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[147])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[148])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residual (Assets LESS Liabilities)', list[149])
        cursor.execute(sql)

        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[150])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[151])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[152])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[153])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[154])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[155])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[156])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[157])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[158])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[159])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[160])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[161])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[162])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[163])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[164])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Construction and land development loans', list[165])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by farmland', list[166])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by multifamily properties', list[167])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by nonfarm nonresidential properties', list[168])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[169])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[170])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[171])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Automobile loans', list[172])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other consumer loans', list[173])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[174])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to nondepository financial institutions', list[175])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All loans not elsewhere classified', list[176])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[177])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[178])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[179])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[180])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[181])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[182])
        cursor.execute(sql)

        sql = "insert into AALODCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[183])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[184])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[185])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[186])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Net due to related foreign offices', list[187])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[188])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[189])
        cursor.execute(sql)
        sql = "insert into AALODCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residual (Assets LESS Liabilities)', list[190])
        cursor.execute(sql)

        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[191])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[192])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[193])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[194])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[195])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[196])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[197])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[198])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[199])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[200])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[201])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[202])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[203])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[204])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[205])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Construction and land development loans', list[206])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by farmland', list[207])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by multifamily properties', list[208])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by nonfarm nonresidential properties', list[209])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[210])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[211])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[212])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Automobile loans', list[213])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other consumer loans', list[214])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[215])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to nondepository financial institutions', list[216])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All loans not elsewhere classified', list[217])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[218])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[219])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[220])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[221])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[222])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[223])
        cursor.execute(sql)

        sql = "insert into AALOLDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[224])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[225])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[226])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[227])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Net due to related foreign offices', list[228])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[229])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[230])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residual (Assets LESS Liabilities)', list[231])
        cursor.execute(sql)

        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[232])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[233])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[234])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[235])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[236])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[237])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[238])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[239])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[240])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[241])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[242])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[243])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[244])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[245])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[246])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Construction and land development loans', list[247])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by farmland', list[248])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by multifamily properties', list[249])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by nonfarm nonresidential properties', list[250])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[251])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[252])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[253])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Automobile loans', list[254])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other consumer loans', list[255])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[256])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to nondepository financial institutions', list[257])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All loans not elsewhere classified', list[258])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[259])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[260])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[261])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[262])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[263])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[264])
        cursor.execute(sql)

        sql = "insert into AALOLDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[265])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[266])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[267])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[268])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Net due to related foreign offices', list[269])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[270])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[271])
        cursor.execute(sql)
        sql = "insert into AALOLDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residual (Assets LESS Liabilities)', list[272])
        cursor.execute(sql)

        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[273])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[274])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[275])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[276])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[277])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[278])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[279])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[280])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[281])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[282])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[283])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[284])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[285])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[286])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[287])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Construction and land development loans', list[288])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by farmland', list[289])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by multifamily properties', list[290])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by nonfarm nonresidential properties', list[291])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[292])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[293])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[294])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Automobile loans', list[295])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other consumer loans', list[296])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[297])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to nondepository financial institutions', list[298])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All loans not elsewhere classified', list[299])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[300])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[301])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[302])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[303])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[304])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[305])
        cursor.execute(sql)

        sql = "insert into AALOSDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[306])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[307])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[308])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[309])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Net due to related foreign offices', list[310])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[311])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[312])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residual (Assets LESS Liabilities)', list[313])
        cursor.execute(sql)

        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[314])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[315])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[316])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[317])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[318])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[319])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[320])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[321])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[322])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[323])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[324])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[325])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[326])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[327])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[328])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Construction and land development loans', list[329])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by farmland', list[330])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by multifamily properties', list[331])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by nonfarm nonresidential properties', list[332])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[333])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[334])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[335])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Automobile loans', list[336])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other consumer loans', list[337])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[338])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to nondepository financial institutions', list[339])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All loans not elsewhere classified', list[340])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[341])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[342])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[343])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[344])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[345])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[346])
        cursor.execute(sql)

        sql = "insert into AALOSDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[347])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[348])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[349])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[350])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Net due to related foreign offices', list[351])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[352])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[353])
        cursor.execute(sql)
        sql = "insert into AALOSDCCBITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residual (Assets LESS Liabilities)', list[354])
        cursor.execute(sql)

        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[355])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[356])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[357])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[358])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[359])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[360])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[361])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[362])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[363])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[364])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[365])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[366])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[367])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[368])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[369])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Construction and land development loans', list[370])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by farmland', list[371])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by multifamily properties', list[372])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by nonfarm nonresidential properties', list[373])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[374])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[375])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[376])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Automobile loans', list[377])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other consumer loans', list[378])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[379])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to nondepository financial institutions', list[380])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All loans not elsewhere classified', list[381])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[382])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[383])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[384])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[385])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[386])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[387])
        cursor.execute(sql)

        sql = "insert into AALOFRIITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[388])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[389])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[390])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[391])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Net due to related foreign offices', list[392])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[393])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[394])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residual (Assets LESS Liabilities)', list[395])
        cursor.execute(sql)

        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Bank credit', list[396])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Securities in bank credit', list[397])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Treasury and agency securities', list[398])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[399])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[400])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other securities', list[401])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Mortgage-backed securities (MBS)', list[402])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Non-MBS', list[403])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans and leases in bank credit', list[404])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial and industrial loans', list[405])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Real estate loans', list[406])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residential real estate loans', list[407])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Revolving home equity loans', list[408])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Closed-end residential loans', list[409])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Commercial real estate loans', list[410])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Construction and land development loans', list[411])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by farmland', list[412])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by multifamily properties', list[413])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Secured by nonfarm nonresidential properties', list[414])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Consumer loans', list[415])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Credit cards and other revolving plans', list[416])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other consumer loans', list[417])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Automobile loans', list[418])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other consumer loans', list[419])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All other loans and leases', list[420])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to nondepository financial institutions', list[421])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'All loans not elsewhere classified', list[422])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'LESS: Allowance for loan and lease losses', list[423])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Cash assets', list[424])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total federal funds sold and reverse RPs', list[425])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Loans to commercial banks', list[426])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other assets including trading assets', list[427])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_ASSET(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total assets', list[428])
        cursor.execute(sql)

        sql = "insert into AALOFRIITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Deposits', list[429])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Large time deposits', list[430])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other deposits', list[431])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Borrowings', list[432])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Net due to related foreign offices', list[433])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Other liabilities including trading liabilities', list[434])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Total liabilities', list[435])
        cursor.execute(sql)
        sql = "insert into AALOFRIITUSNS_Liabilities(quarterly,name,value)values('%s','%s','%s')" % (
            timestamp, 'Residual (Assets LESS Liabilities)', list[436])
        cursor.execute(sql)
        db.commit()
    else:
        import time
        time.sleep(43200)
        # time.sleep(timer_start_time)

