how to create diagram with for loop

visit shbcf.ru