Anton is under pressure --- he has to submit all the assignments. As often happens --- he cannot extend the deadline...

You are given a sequence $a$ of $n$ integers, and two integers $l$ and $r$. You need to find the longest subsequence $b$ of the sequence $a$ such that $l \le b_i + b_{i+1} \le r$ ($1 \le i < |b|$). Here, $|b|$ denotes the number of elements in the sequence $b$. In other words, you need to select a subsequence such that the sum of any two adjacent numbers is not less than $l$ and not greater than $r$.

A subsequence of an array is a sequence that can be obtained by deleting several (possibly none) elements from the original sequence.