using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
var a = new[] { 1, 1, 2, 3, 3, 4, 4, 5 };
var r = a.Where(x => a.Count(n => n == x) > 1).Distinct();
foreach (var item in r)
{
Console.WriteLine(item);
}
}
}