Number-bases solution