# BrainCubed

You are the proud maintainer of one of the smartest robots in the world. Well, it used to be. Now its speakers and microphones have been broken and the darn thing only seems to read [Brainfuck](http://esolangs.org/wiki/Brainfuck). To make matters worse, it would appear most of its RAM... disappeared? This will be tough to explain to the boss. No matter. It seems to have figured out how to draw on a whiteboard to supplement its now-shoddy memory, and you have bigger problems on your hands.

You need to know how to fit things in cubes.

## The Task

Lately, your biggest problems (aside from the embarrassing conversation with your boss later) have to do with volume. Cubing things is hard. That's why you'll get the robot to do it for you! Your goal in this challenge is to write a Brainfuck program that computes the cube of a given number. However, the robot's whiteboard isn't very big. **The less memory your Brainfuck program requires, the better.**

## Input

You will receive a single integer as input, `x`.

 - You may choose to accept input in any integer base greater than `0` and less than or equal to `36`, so long as this base does not vary from input to input. (e.g. binary, hexadecimal, decimal)

 - You may assume that `x` is in the range `0 <= x <= 2^16 - 1` 

 - You should take input as a string of *characters*, not bytes. For example, if `x = 33` and my program accepts input in binary, I should receive the string "100001" (bytes: 49 48 48 48 48 49) *not* simply bytes containing 100001.

## Output

 - Your Brainfuck program must output the value of `x^3` in the **same** base that input was received in.

 - As it is for input, your program should output a *string* of ASCII characters, not a sequence of bytes.

 - The program must terminate, and should not print anything except for its numerical output.

## Rules and Scoring

Your score in this challenge is defined in the following manner: 
Let the tape of the Brainfuck memory be described as having a `1`st element at the left-most position, and then with potentially infinite cells to the right, indexed by increasing integers `n`. 

Let `N(x)` denote the right-most (highest `n`) cell that the program ever sends the tape pointer to (**not** necessarily modified) for a given input `x`.
Your score for this challenge is then `sum (x = 0, 1, 2, ... 100) N(x)` (modification pending)

In order to verify score, you may use [this] (soon) modified interpreter.

 - Your program must be written entirely in Brainfuck.
 - Assume the highest value a cell can hold is `255` before wrapping to `0`, and that moving left off of the tape will cause the robot to suddenly and violently crash.
 - Your program should not exceed 10k bytes, nor should it take more than 10 minutes to compute `x^3` for any `x <= 2^16 - 1` on a relatively modern machine.
 - Standard loopholes are disallowed.

---------------------------------------------------------------------

[tag:code-challenge][tag:brainfuck][tag:optimization][tag:arithmetic]

### SANDBOX NOTES

What do you think of BF memory-optimization as a basis for a challenge?

I chose cubing `x` as a challenge that is not so trivial as to allow for different approaches, but still within the grasp of BF (if different bases are allowed). Any other ideas?