Thank you for you kind suggestion, but the problem is that the indices and variables are provided in mentioned forms and are of size > 300. If I do this by hand each time I get new set of indices and variables, I'll go crzy...