First solution for ameba problem