<gh_stars>0
#!/usr/bin/env python3
# from typing import *

# def solve(N: int, Q: int, c: List[int], l: List[int], r: List[int]) -> Any:
def solve(N, Q, c, l, r):
    pass  # TODO: edit here

# generated by online-judge-template-generator v4.1.0 (https://github.com/kmyk/online-judge-template-generator)
def main():
    import sys
    tokens = iter(sys.stdin.read().split())
    N = int(next(tokens))
    Q = int(next(tokens))
    c = [None for _ in range(N)]
    l = [None for _ in range(Q)]
    r = [None for _ in range(Q)]
    for i in range(N):
        c[i] = int(next(tokens))
    for i in range(Q):
        l[i] = int(next(tokens))
        r[i] = int(next(tokens))
    assert next(tokens, None) is None
    ans = solve(N, Q, c, l, r)
    print(ans)  # TODO: edit here

if __name__ == '__main__':
    main()

#!/usr/bin/env python3
# from typing import *

# def solve(N: int, Q: int, c: List[int], l: List[int], r: List[int]) -> Any:
def solve(N, Q, c, l, r):
    pass  # TODO: edit here

# generated by online-judge-template-generator v4.1.0 (https://github.com/kmyk/online-judge-template-generator)
def main():
    import sys
    tokens = iter(sys.stdin.read().split())
    N = int(next(tokens))
    Q = int(next(tokens))
    c = [None for _ in range(N)]
    l = [None for _ in range(Q)]
    r = [None for _ in range(Q)]
    for i in range(N):
        c[i] = int(next(tokens))
    for i in range(Q):
        l[i] = int(next(tokens))
        r[i] = int(next(tokens))
    assert next(tokens, None) is None
    ans = solve(N, Q, c, l, r)
    print(ans)  # TODO: edit here

if __name__ == '__main__':
    main()
#!/usr/bin/env python3 # from typing import * # def solve(N: int, Q: int, c: List[int], l: List[int], r: List[int]) -> Any: # TODO: edit here # generated by online-judge-template-generator v4.1.0 (https://github.com/kmyk/online-judge-template-generator) # TODO: edit here