Traders to the Death You are a foreign trader, hoping to make a profit.  There are 5 goods people wish to trade: Apricots, Boars, Canaries, Daffodils, and Earwigs.  Starting in the winter, you need to decide what to produce.  Then, in the fall, you travel and spend your days trading for a profit.
Gameplay
You start the game with 10 of each product in storage.  Each year, you will consume 2 of each product.
At the beginning of the game, you receive a list of 5 products, along with the amount you will be able to produce each year (ex:5-A,6-B,3-C,12-D,4-E).  You then will return a letter A through E deciding what to produce.
Then, in the fall time you will bring your products (including those in storage) to the market.  You have 50 turns to trade.
You must decide if you want to Purchase, Sell, or Leave the market.  The buyers will then be paired up randomly with the sellers.  If a group has extra, the random extras will miss out this turn.  If a trader is skipped, they will receive S, otherwise, T.  The seller must decide what he wants to sell, and amount (ex:3-A), and then what he would accept (ex:5-B,2-D,1-E) (The values are any of not all of).  The buyer will then be told what product the seller is selling, then the products the seller will take for it, and he can choose a product to trade for it (ex: D or X for nothing).
After all trades are over, or after you have left the market, you will consume 2 of each product, and the year starts over.  If you have less than 2 of any 1 product, you will die (and passed Q).
Your score will be the number of years you last, and after 50 games, your scores will be averaged for your total score.
Optional moves
At any time you can return G to query your goods
At any time you can return N to query the number of new products in your inventory (produced by any player in the past year, and new products will be traded before old products)
At any time you can return T for the current Turn phrase: Produce, Market, or Trading
During a trade, you can query I for an identifier unique to the player you are trading with.
During a trade, you can return M to query the number of people trading
How to code it:
You may use any standard language, and must include a command.txt which is the command to run your program.
The general flow of your program should be:
Get productivity
While alive:
    Output product you want to produce
    While in trading:
        Output whether you want to purchase or sell
        Get whether or not you were skipped.  If not skipped:
            If purchasing:
                print product you offer, and products you will accept
            Else:
                Get product offered, products being accepted, and choose the product you will give

I have a tester program here.  To use it, create a folder in the bots folder with your bot's name.  Add a command.txt, your program, and anything else your program needs.  I will be adding submissions as they come in.  If you don't want to install the languages required to run some or all of them, you just need to delete the command.txt in the bot's folder.
Inner Workings
There will be 5 bots for each program submitted.  The ID will be different for bots of the same type.
I will call the amount a person can produce a given product the productivity. Each product will be given a base productivity, where all of the base productivity will add up to 30.  One of the scores will be ensured to be at most 3, and all will be at least 2.
Then, each player's productivity will vary from the base productivity (One value will vary by +2, another +1, then +0, -1, and the remaining value will vary by -2).
The base productivity will change from game to game.
Scores:
seer:                10.128 years
level_headed_trader: 8.196 years
introvert:           6.856 years
random_ando:         5.408 years
hoarder_trader:      4.12 years
ratio_trader:        3.532 years
scared_trader:       3.056 years
Level-headed Trader

This bot tries to make his quantities as equal as possible

command.txt

python leveller.py


leveller.py

import sys

def current_goods():
    print "G"
    return parse_goods(readline())

def parse_goods(good_string):
    return dict([(a, int(b))
                 for a, b in [product.split("-")
                              for product in good_string.split(",")]])

def get_minimum(goods):
    cur_min = 200
    min_good = "X"
    for good, amount in goods.items():
        if amount &lt; cur_min:
            min_good = good
            cur_min = amount
    return min_good

def get_maximum(goods):
    cur_max = -1
    max_good = "X"
    for good, amount in goods.items():
        if amount &gt; cur_max:
            max_good = good
            cur_max = amount
    return max_good

def add_goods(x, y):
    return {k: int(x.get(k, 0)) + int(y.get(k, 0)) for k in set(x) | set(y)}

def readline():
    line = sys.stdin.readline().strip()
    if line == 'Q' or not line:
        exit()
    return line

def output_goods(goods):
    print ",".join([good+"-"+str(amount) for good, amount in goods.items()])

def output_good(good, amount):
    print good+"-"+str(amount)

def current_turn_is(turn):
    print "T"
    return readline() == turn

turns = MARKET, PRODUCE, TRADING, SKIPPED = "M", "P", "T", "S"
market_options = PURCHASE, SELL = "P", "S"
items = APRICOTS, BOARS, CANARIES, DAFFODILS, EARWIGS, NOTHING = "A", "B", "C", "D", "E", "X"

productivity = parse_goods(readline())
while True:
    product_to_produce = get_minimum(current_goods())
    print product_to_produce
    while current_turn_is(MARKET):
        print SELL
        if readline() != SKIPPED:
            maximum = get_maximum(current_goods())
            goods = {"A": 1, "B": 1, "C": 1, "D": 1, "E": 1}
            del goods[maximum]
            output_good(maximum, 1)
            output_goods(goods)