using System;
using System.Windows.Forms;

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

        public static void Rev(string str, ref string rev)
        {
            if (str.Length == 1)
                rev += str;
            else
            {
                rev += str[str.Length - 1].ToString();
                Rev(str.Substring(0, str.Length - 1), ref rev);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string str = textBox1.Text.Trim();
            string rev = string.Empty;
            
            Rev(str, ref rev);
            
            MessageBox.Show(rev);
        }
    }
}