using System.IO;
using System.Text;

namespace Gile.TextSplit
{
    class Program
    {
        static void Main(string[] args)
        {
            int start = int.Parse(args[1]) - 1;
            int length = int.Parse(args[2]) - start;
            using (StreamReader sr = new StreamReader(args[0], Encoding.Default))
            using (StreamWriter sw = new StreamWriter(args[3], false))
            {
                for (int i = 0; i < start; i++)
                {
                    string line = sr.ReadLine();
                }
                for (int i = 0; i < length; i++)
                {
                    sw.WriteLine(sr.ReadLine());
                }
            }
        }
    }
}
