using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Xml.XPath;

namespace ConsoleApp2
{
    internal class Program
    {



        static void Main(string[] args)
        {

            string[] ulaz = Console.ReadLine().Split(' ');

            int n = int.Parse(ulaz[0]);
            int q = int.Parse(ulaz[1]);


            string[] ulaz2 = Console.ReadLine().Split(' ');

            List<int> l = new List<int>();

            for (int i = 0; i < n; i++) 
            
            {
                l.Add(int.Parse(ulaz2[i]));
            }


            for (int i = 0; i < q; i++)

            {
                string[] ulaz3 = Console.ReadLine().Split(' ');


                int L = int.Parse(ulaz3[0]);
                int R = int.Parse(ulaz3[1]);



            }


        }
    }
}