using System;
using System.Linq;
public class Program
{
public static void Main()
var arr = new [] {0,2,4,6,8,10,12,14,16,18,20,22,24,26,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180};
var res = arr.TakeWhile(x => x <= arr.Aggregate((p,q) => p != q - 2 ? p : q)) ;
res.Dump();
}