#include <iostream>

using namespace std;

struct node{
    node * back;
    int index,
        cost;
};
/*
function (from, to, openlist)
    if from == to
        return call build(from)
    elif up() and up() is not in openlist
        add up(with from) in openlist
        openlist = function(up, to, openlist)
    elif down...
    ...
    return openlist
*/
int main()
{

    return 0;
}
