using System;
using System.Windows.Forms;

namespace _4_18
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            for (int i = 10000; i <= 99999; i++)
            {
                int m = 0, n = i;
                while (n > 0)
                {
                    m = (m * 10) + (n % 10);
                    n = n / 10;
                }

                if (i == m)
                    listBox1.Items.Add(i.ToString());
            }
        }
    }
}