Definition: In this task, you are given inputs i,j, and A, where i and j are integers and A is a list. You need to concatenate all elements of A from the ith element to the jth element, and print the resultant string. i and j will be non-negative, and will always have a value less than the length of A. i will always be less than j.
Input: 2, 5, ['7791', '8561', 'r', 'e', '7821', '2611', '1', 'P', 'n', '4097', 'z', 'a', '9589', 'M', '8867']

8561re7821