using System;

namespace HelpfulMaths
{
    class Program
    {
        static void Main(string[] args)
        {
            string starterEquation = Console.ReadLine();
            string[] splitEquation = starterEquation.Split("+");
            Array.Sort(splitEquation);
            string sortedEquation = string.Join("+", splitEquation);
            Console.WriteLine(sortedEquation);
        }
    }
}


<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

</Project>


using System;
using System.Linq;

class A
{
    static void Main()
    {
        var nums = Console.ReadLine().Split("+").Select(x => int.Parse(x)).ToList();
        nums.Sort();
        int n = nums.Count();
        Console.Write(nums[0]);
        for(int i = 1; i < n; ++i)
        {
            Console.Write($"+{nums[i]}");
        }

        //Console.ReadLine();
    }
}


using System;
using System.Runtime.CompilerServices;
using System.Text;

namespace ConsoleApp1
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            string input = Console.ReadLine();

            int helper = 0;

                int[] tab = Array.ConvertAll(input.Split("+"), int.Parse);

                for (int i = 0; i < tab.Length; i++)
            {

                for (int j = 0; j < tab.Length-1; j++)
                {

                    if (tab[j] > tab[j+1])
                    {
                        helper = tab[j];
                        tab[j] = tab[j+1];
                        tab[j+1] = helper;
                    }
                }

                }
                for (int i = 0; i < tab.Length-1; i++)
            {
                Console.Write(tab[i] + "+");
            }
            Console.Write(tab[tab.Length-1]);

            }

    }
}


using System;
using System.Collections.Generic;
using System.Collections;

public class Test
{
	public static void Main()
	{
		// your code goes here
		string s=Console.ReadLine();
		ArrayList arr = new ArrayList();
		int x=0;
		for(int i=0;i<s.Length;i++)
		{
			if(s[i]!='+')
			{
				arr.Add((int)(s[i]-'0'));
			}
		}
		arr.Sort();
		int b=0;
		foreach(var item in arr)
		{
		    if(b!=arr.count-1)
		    {
		        Console.Write(item+"+");
		    }
		    else
		    {
		        Console.Write(item);
		    }
		}

	}
}


using System;

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = (Console.ReadLine());
            if (s.Length > 1)
            {
                string[] nums = s.Split('+');
                SolveProblem(nums);

            }
            else
            {
                Console.WriteLine(s);
            }
            Console.ReadLine();
        }

        static void SolveProblem(string [] nums)
        {
            ArrayList arr = new ArrayList ();
            arr.AddRange(nums);
            arr.Sort();
            nums = arr.ToArray(typeof (string)) as string [];
            Console.WriteLine(string.Join("+", nums));
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {

        List<int> input = Console.ReadLine().Split("+").Select(int.Parse).ToList();

        input.Sort();

        Console.WriteLine(string.Join("+", input));
    }
    private static List<string> ReadInputParseToList()
    {
        return Console.ReadLine().ToLower().Split().ToList();
    }
}


using System;
namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] inp = Console.ReadLine().Split('+');
            int[] numbers = Array.ConvertAll(inp, int.Parse);
            Array.Sort(numbers);
            if (numbers.Length < 2)
            {
                Console.WriteLine(numbers[numbers.Length - 1]);
            }
            else
            {
                numbers.ToString();
                Console.WriteLine(String.Join("+", numbers));
                a
            }

        }

    }
}


using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using System.Text;
using System;

class Solution
{
    static Dictionary<int, int> d = new Dictionary<int, int>();
    // Complete the climbingLeaderboard function below.
    static Queue<char> qe = new Queue<char>();

    static string solution(List<int> a)
    {
        a.Sort();
        var r = "";
        foreach (var e in a)
            r += e + "+";
        return r.Substring(0, r.Length - 1);
    }

    static void Main(string[] args)
    {
        //var number = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var ints = Console.ReadLine().Split("+").Select(int.Parse).ToList();
        //var rd = Console.ReadLine();
        Console.WriteLine(solution(ints));
        Console.ReadLine();
    }
}


using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace HelpfulMath
{
    class Program
    {
        static void Main(string[] args)
        {
            string exprStr = Console.ReadLine();
            string[] numbersStr = exprStr.Split('+');

            int[] numbers = new int [numbersStr.Length];

            for (int i =0; i<numbersStr.Length;i++)
            {
                Int32.TryParse(numbersStr[i], out int tmp);
                numbers[i] = tmp;
            }

            for (int i =0;i<numbersStr.Length;i++)
            {
                for (int j=0;j< numbersStr.Length - 1;j++)
                {
                    if (numbers[j] > numbers[j + 1])
                    {
                        int temp = numbers[j + 1];
                        numbers[j + 1] = numbers[j];
                        numbers[j] = temp;
                    }
                }

            }

            exprStr = "";
            for (int i = 0; i < numbersStr.Length; i++)
            {
                exprStr += numbers[i].ToString();

                if (i!= numbersStr.Length-1)
                {
                    exprStr += "+";
                }
            }

            Console.WriteLine(exprStr);
        }

    }
}


	string[] Aray1 = Console.ReadLine().Split('+');
			Array.Sort(Aray1);
	       Console.WriteLine(string.Join("+", Aray1));


 class Program
    {

        static void Main(string[] args)
        {

            string S=Console.ReadLine();

            string[] arr = S.Split('+');
            Array.Sort(arr);
            S = "";
            foreach (var a in arr)
            {
                S += a + "+";
            }

            S=S.Substring(0, (S.Length - 1));
            Console.WriteLine(S);
            Console.ReadKey();
        }
    }


using System;
using System.Text;
namespace CP
{
    class Program
    {
        static void Main(string[] args)
        {
            int [] arr = Array.ConvertAll(Console.ReadLine().Split('+') , temp => Convert.ToInt32(temp));
            Array.Sort(arr);
            string s2 = String.Join('+' , arr);
            Console.WriteLine(s2);

        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        Console.Write(Console.ReadLine().Split('+').Select(int.Parse).OrderBy(o => o).Aggregate((a, b) => a + "+" + b));
    }
}


using System;

class MainClass {
  public static void Main (string[] args) {
     string s = "1+1+3+1+3";
     string[] sArr  = s.Split('+');
     for(int i = 0; i < sArr.Length - 1; i++){
       for(int j = i+ 1; j < sArr.Length; j++){
         if(Int16.Parse(sArr[i]) > Int16.Parse(sArr[j])){
           string temp = sArr[i];
           sArr[i] = sArr[j];
           sArr[j] = temp;
         }
       }
     }

     s = String.Join('+' , sArr);

    Console.WriteLine(s);

  }
}


using System;

namespace HelpfulMaths
{
    class Program
    {
        static void Main(string[] args)
        {
            string starterEquation = Console.ReadLine();
            string[] splitEquation = starterEquation.Split('+');
            Array.Sort(splitEquation);
            string sortedEquation = string.Join('+', splitEquation);
            Console.WriteLine(sortedEquation);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication25
{
    class Program
    {
        static void Main(string[] args)
        {
            string x = Console.ReadLine();
            int a = 0, b = 0, c = 0;
            for (int y = 0; y < x.Length; y++)
            {
                switch (x[y].ToString())
                {
                    case "1":
                        a++;
                        break;
                    case"2":
                        b++;
                        break;
                    case"3":
                        c++;
                        break;
                }
                }
            while (a > 0)
            {
                Console.Write("+1");
                a--;
            }
            while (b > 0)
            {
                Console.Write("+2");
                b--;
            }
            while (c > 0)
            {
                Console.Write("+3");
                c--;
            }
            }
        }


namespace Codeforces
{
    using System;
    using System.Data;
    using System.Linq;
    using System.Text;

    class Problem339A {

        private static string GetSumExpression(IOrderedEnumerable<string> summands) {
            var sb = new StringBuilder();
            foreach (var summand in summands) {
                sb.Append(summand);
                sb.Append('+');
            }
            return sb.ToString().Trim('+');
        }

        private static string GetOrderedSumExpression(string sumExpression) {
            var summands = sumExpression.Split('+');
            var orderedSummands = summands.OrderBy(s => s);
            return GetSumExpression(orderedSummands);
        }

        static void Main() {
            string sumExpression = Console.In.ReadLine();
            Console.Out.WriteLine(GetOrderedSumExpression(sumExpression));
            Console.In.ReadLine();
        }

    }
}


using System;
class Sample
{
    static void Main()
    {
        var[] str=Console.ReadLine().Split();
        Array.Sort(str);
        Console.WriteLine(string.Join('+',str));

    }

}


using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;

namespace HelpfulMaths
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            List<int> numbersList = input.Split('+').Select(x => int.Parse(x)).ToList();
            var sortednumber = numbersList.OrderBy(x => x);

            StringBuilder stringBuilder = new StringBuilder();
            foreach (var i in sortednumber)
            {
                stringBuilder.Append(i);
                stringBuilder.Append("+");
            }

            stringBuilder.Remove(stringBuilder.Length - 1, 1);
            Console.WriteLine(stringBuilder);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {

        List<int> input = Console.ReadLine().Split("+").Select(int.Parse).ToList();

        input.Sort();

        Console.WriteLine(string.Join("+", input));
        Console.ReadLine();
    }
    private static List<string> ReadInputParseToList()
    {
        return Console.ReadLine().ToLower().Split().ToList();
    }
}


using System;
using System.Text;
namespace CP
{
    class Program
    {
        static void Main(string[] args)
        {
            int [] arr = Array.ConvertAll(Console.ReadLine().Split('+') , temp => Convert.ToInt32(temp));
            Array.Sort(arr);
            Console.WriteLine(String.Join('+',arr));

        }

    }
}


using System;
using System.Linq;

class Program
{
    static void Main()
    {
        try
        {
            int[] numbers = Console.ReadLine().Split('+', StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

            string outLine = SortArithmeticSentece(numbers);
            Console.WriteLine(outLine);
        }
        catch(Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
        Console.ReadLine();
    }

    private static string SortArithmeticSentece(int[] numbers)
    {
        Array.Sort(numbers);
        string outStr = String.Empty;
        for(int i = 0; i < numbers.Length; i++)
        {
            if(i == numbers.Length - 1)
            {
                outStr += numbers[i];
                break;
            }
            else
            {
                outStr += numbers[i] + "+";
            }
        }
        return outStr;
    }
}


using System;
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            char[] st = new char[s.Length/2+1];
            int j = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] != '+') { st[j] = Convert.ToChar(s[i]); j++; }
            }
            Array.Sort(st);
            foreach (char ch in st
                    Console.Write(ch+"+");
            Console.Write("\b");
        }
    }
}


using System;
using System.Collections.Generic;
using System.Collections;
using System.Runtime.InteropServices;
using System.Dynamic;
using Microsoft.VisualBasic;
using ImTools;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            ArrayList arr = new ArrayList();
            string str = Console.ReadLine();
            for (int i = 0; i < str.Length; i++)
            {
                char ch = str[i];
                if (ch != '+')
                {
                    arr.Add(char.GetNumericValue(ch));
                }
            }

            arr.Sort();
            string s = "";

            for (int i = 0; i < arr.Count; i++)
            {
                s += arr[i];
                if (i != arr.Count - 1)
                    s += "+";
            }
            Console.WriteLine(s);
        }
    }
}


class Program
    {
        static void Main(string[] args)
        {
            int[] f=new int[100];
            System.String text = System.Console.ReadLine();
             text = text.Replace("+", "");
            for (int i = 0; i < text.Length; i++)
            {
                f[i] = int.Parse(text[i].ToString());
            }

            Array.Sort(f);
            for (int i = 0; i < f.Length; i++)
            {
                if (f[i] != 0)
                {                    if(i!=f.Length-1)
                    System.Console.Write(f[i] + "+");
                                     else
                        System.Console.Write(f[i]);

                }
            }
        }
    }


using System;

namespace Sample_Test
{
    class Program
    {
        static void Main(string[] args)
        {
            string mash = Console.ReadLine();
            string[] str = mash.Split('+');
            Array.Sort(str);
            Console.WriteLine(string.Join('+',str));
        }
    }
}


using System.Linq;
using System.Collections.Generic;
using System;

namespace MyApp
{
    class Program
    {
        static void Main(string[] args)
        {
          int[] nums = new int[3];
          var inp = Console.ReadLine().Split('+');
          for(int i = 0; i < inp.Length; i++) {
            nums[Convert.ToInt32(inp[i]) - 1]++;
          }
          if(nums[0] != 0) {
            while(nums[0] > 1) {
              nums[0]--;
              Console.Write("1+");
            }
            Console.Write("1");
          }
          if(nums[1] != 0) {
            if(nums[0] == 1) {
              Console.Write("+");
              nums[0]--;
            }
            while(nums[1] > 1) {
              nums[1]--;
              Console.Write("2+");
            }
            Console.Write("2");
          }
          if(nums[2] != 0) {
            if(nums[1] == 1 || nums[0] == 1) {
              Console.Write("+");d
            }
            while(nums[2] > 1) {
              nums[2]--;
              Console.Write("3+");
            }
            Console.Write("3");
          }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
			string textBox1 = Console.ReadLine();
           /* char[] arr;
            arr = num.ToCharArray(0, num.Length);
           */
 		    string textBox2;//= Console.ReadLine();
           /* char[] arr2;
            arr2 = num.ToCharArray(0, num.Length);
*/
            int len = textBox1.Length;
            char[] first = new char[len];
            char[] second = new char[len];
            int i = 0;
            char buf;
            int j = 0;
            while (i < len)
            {
                if (textBox1[i] != '+')
                {
                    first[j] = textBox1[i];
                    j++;
                }
                i++;
            }
            i = 1;
            while (i < j)
            {
                if (first[i] < first[i - 1])
                {
                    buf = first[i - 1];
                    first[i - 1] = first[i];
                    first[i] = buf;
                    if (i > 1) i--;
                }
                else i++;
            }
            j = 0;
            i = 0;
            while (i < len)
            {
                if (i % 2 == 0)
                {
                    textBox2 += first[j].ToString();
                    j++;
                }
                else textBox2 += '+';
                i++;
            }
			Console.WriteLine(textBox2);
         }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YOLO
{
    class Program
    {
        static void Main(string[] args)
        {
            string x;
            x = Console.ReadLine();
            int[] data = new int[0];
            int index=0;
            string temp="";
            for(int i=0; i<x.Length; i++)
            {
                if(x[i]!='+'){
                    temp+=x[i];
                }
                else{
                    Array.Resize(ref data, data.Length+1);
                    data[index] = Convert.ToInt32(temp);
                    index++;
                    temp = "";
                }
            }
            data.Sort;

            for(int i=0; i<data.Length; i++){
                Console.Write(data[i]);
                if(i!=data.Length-1){
                    Console.Write("+");
                }
            }
        }
    }
}


using System;
class Sample
{
    static void Main()
    {
        var[] str=Console.ReadLine().Split('+');
        Array.Sort(str);
        Console.WriteLine(string.Join('+',str));

    }

}


using System;

class hmath {
	public static void Main() {
		var line = Console.ReadLine().Split('+');
		Array.Sort(line);
		Console.WriteLine(string.Join("+", line));
	}


using System;

namespace Начинаем_
{
    class Program
    {
        static void Main(string[] args)
        {
            string string1;

            string1 = Console.ReadLine();
            string[] a = string1.Split("+");

            Array.Sort(a);
            string1 = a[0];
            for (int i = 1; i < a.Length; i ++)
            {
                string1 += "+" + a[i];
            }

            Console.WriteLine(string1);

        }

    }
}


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{979BA46C-8594-42ED-8BAB-F2FC358ADA90}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>Helpful_Maths_0</RootNamespace>
    <AssemblyName>Helpful Maths 0</AssemblyName>
    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <Deterministic>true</Deterministic>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication26
{
    class Program
    {

        static void Main(string[] args)
        {
            int[] arr = Console.ReadLine().Split('+').Select(int.Parse).ToArray().;
            Array.Sort(arr);
            for(int i = 0; i<arr.Length; i++)
            {
                if (i != arr.Length - 1)
                    Console.Write("{0}+", arr[i]);
                else
                    Console.Write("{0}", arr[i]);

            }
        }
    }
}


using System;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            //int n = Convert.ToInt32(Console.ReadLine());
            String cmd = Console.ReadLine();

            string[] parts = cmd.Split('+');

            Array.Sort(parts);

            Console.WriteLine(String.Join('+', parts));
        }
    }
}


class Program
{
    static void Main(string[] args)
    {
        string[] sum = System.Console.ReadLine().Split("+");
        int[] num    = new int[sum.Length];
        for (int i = 0; i < sum.Length; i++)
            num[i] = int.Parse(sum[i]);
        Array.Sort(num);
        for (int i = 0; i < sum.Length - 1; i++)
            System.Console.Write(num[i] + "+");
        System.Console.WriteLine(num[num.Length - 1]);
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29409.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "ConsoleApp2\ConsoleApp2.csproj", "{83EFF6B1-8685-4A9F-9201-CAAFE79E8D92}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{83EFF6B1-8685-4A9F-9201-CAAFE79E8D92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{83EFF6B1-8685-4A9F-9201-CAAFE79E8D92}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{83EFF6B1-8685-4A9F-9201-CAAFE79E8D92}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{83EFF6B1-8685-4A9F-9201-CAAFE79E8D92}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {C8907E5D-AE25-4EE4-8690-EFEE58E0ACAD}
	EndGlobalSection
EndGlobal


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace ProblemSolving
{
    class Program
    {
       static bool IsPrime (int x)
        {
            bool flag = false;
            int y = 0;
            y = x / 2;
            for (int i = 2; i <= y; i++ )
            {
                if ( x % i == 0)
                {
                    flag = false;
                    break;
                }
                else
                {
                    flag = true;
                }
            }
            return flag;
        }
    }
      static void Main(string[] args)
        {

            int n = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int temp = 0;
            for (int i =  n+1 ; i <= m ; i++)
            {
                IsPrime(i);
                temp = i;
            }
            if (temp == m)
            {
                Console.WriteLine("YES");

            }
            else
            {
                Console.WriteLine("NO");
            }

        }

}


using System;
class a
{
    static void Main()
    {
        var a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        for (int i = a[0]+1; i < a[1]; i++)
        {
            if (IsPrime(i))
            {
                Console.WriteLine("NO");
                return;
            }
        }
        Console.WriteLine(IsPrime(a[1])? "YES" : "NO");
        bool IsPrime(int n)
        {
            for (int i = 2; i <= n / 2; i++) if (n % i == 0) return false;
            return true;
        }
    }
}


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        public static void main(string[] ags)
        {
            string[] s = Console.ReadLine().Split(' ');
            int first, next;
            first = int.Parse(s[0]);
            next = int.Parse(s[1]);
            if (Next(first) == next)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
        static int Next(int start)
        {
            start++;
            while (!isPrime(start))
            {
                start++;
            }
            return start;

        }
        static bool isPrime(int n)
        {
            int limit = (int)Math.Sqrt(n);
            for (int i = 2; i < limit; i++)
            {
                if (n % i == 0) { return false; }
            }
            return true;
        }
    }
}


namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            var before = GC.GetTotalMemory(true);
            var input = Console.ReadLine().Split(' ');
            var n = byte.Parse(input[0]);
            var m = byte.Parse(input[1]);
            byte next = 0;
            byte[] arr = { 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};

            for (int i = 0; i < arr.Length; i++)
            {
                if (arr[i] > n)
                {
                    next = arr[i];
                    break;
                }
            }

            if(m == next) Console.Write("YES");
            else Console.WriteLine("NO");
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    /*public static IEnumerable<int> GetPrimes(int n)
    {
        //Массив значений, для индекса i показывает, является ли число i + 1 простым
        bool[] primes = new bool[n];

        for (int i = 1; i < n; i++)
        {
            //Предполагаем, что два и все нечетные числа больше двух простые
            primes[i] = true;
            if (i > 1 && i % 2 == 1) primes[i] = false;
        }

        //Проверяем для числа i, является ли оно простым
        for (int i = 3; i * i < n; i += 2)
        {
            //Если является, то помечаем составными все числа, которые делятся на i
            if (primes[i - 1])
            {
                for (int j = 2 * i; j < n; j += i)
                {
                    primes[j - 1] = false;
                }
            }
        }

        int indexer = 1;
        foreach (bool prime in primes)
        {
            if (prime)
                yield return indexer;
            indexer += 1;
        }
    }*/
    static void Main(string[] args)
    {
        string[] buffer = Console.ReadLine().Split(' ');
        int a = Convert.ToInt32(buffer[0]);
        int b = Convert.ToInt32(buffer[1]);
        Console.Write(Math.Abs(a - b) && !(a == 0 && b == 0) > 1 ? "NO" : "YES");
        Console.Read();
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    /*public static IEnumerable<int> GetPrimes(int n)
    {
        //Массив значений, для индекса i показывает, является ли число i + 1 простым
        bool[] primes = new bool[n];

        for (int i = 1; i < n; i++)
        {
            //Предполагаем, что два и все нечетные числа больше двух простые
            primes[i] = true;
            if (i > 1 && i % 2 == 1) primes[i] = false;
        }

        //Проверяем для числа i, является ли оно простым
        for (int i = 3; i * i < n; i += 2)
        {
            //Если является, то помечаем составными все числа, которые делятся на i
            if (primes[i - 1])
            {
                for (int j = 2 * i; j < n; j += i)
                {
                    primes[j - 1] = false;
                }
            }
        }

        int indexer = 1;
        foreach (bool prime in primes)
        {
            if (prime)
                yield return indexer;
            indexer += 1;
        }
    }*/
    static void Main(string[] args)
    {
        string[] buffer = Console.ReadLine().Split(' ');
        int a = Convert.ToInt32(buffer[0]);
        int b = Convert.ToInt32(buffer[1]);
        Console.Write(Math.Abs(a - b) || (a == 0 && b == 0) > 1 ? "NO" : "YES");
        Console.Read();
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _41a
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int a = int.Parse(s[0]);
            int b = int.Parse(s[1]);
            if (a>=0 && b>=0)Console.WriteLine("YES");

                if (a==b || a== (b-1)  || a==(b+1))
                {
                    Console.WriteLine("YES");
                }
                else Console.WriteLine("NO");

            else Console.WriteLine("NO");

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dasha_and_Stairs
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arrxy = Console.ReadLine().Split().Select(int.Parse).ToArray();

            if ( (arrxy[0] ==arry[1]-1 || arrxy[0] == arrxy[1]+1 || arrxy[0]==arrxy[1]) && ( arrxy[0] !=0 || arrxy[1]!=0))            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}


using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace timusCsharp //1
{
    static class Program
    {
        static void Main()
        {
			var ret = 0;
            int a = Int32.Parse(Console.ReadLine());
			double y = Int32.Parse(Console.ReadLine());
			double z = Int32.Parse(Console.ReadLine());
			int b = Math.Floor(y/2);
			int c = Math.Floor(z/4);
			int[] arr = {a, b*2, c*4};
			int crit = arr.ToList().IndexOf(arr.Max());
			if (crit == 1) ret = a*7;
			if (crit == 2) ret = b*7;
			if (crit == 3) ret = c*7;

            Console.WriteLine(ret);
        }
    }
}


using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace timusCsharp //1
{
    static class Program
    {
        static void Main()
        {
			var ret = 0;
            var a = Console.ReadLine();
			var b = Console.ReadLine();
			var c = Console.ReadLine();
			b = Math.Floor(b/2);
			c = Math.Floor(c/4);
			int[] arr = {a, b*2, c*4};
			int crit = arr.ToList().IndexOf(arr.Max());
			if (crit == 1) ret = a*7;
			if (crit == 2) ret = b*7;
			if (crit == 3) ret = c*7;

            Console.WriteLine(ret);
        }
    }
}


using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace timusCsharp //1
{
    static class Program
    {
        static void Main()
        {
            var a = Console.ReadLine();
			var b = Console.ReadLine();
			var c = Console.ReadLine();
			b = Math.Floor(b/2);
			c = Math.Floor(c/4);
			int[] arr = {a, b*2, c*4};
			int crit = arr.ToList().IndexOf(arr.Max());
			if (crit == 1) ret = a*7;
			if (crit == 2) ret = b*7;
			if (crit == 3) ret = c*7;

            Console.WriteLine(ret);
        }
    }
}


using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace timusCsharp //1
{
    static class Program
    {
        static void Main()
        {
			var ret = 0;
            int a = int.TryParse(Console.ReadLine());
			int b = int.TryParse(Console.ReadLine());
			int c = int.TryParse(Console.ReadLine());
			b = Math.Floor(b/2);
			c = Math.Floor(c/4);
			int[] arr = {a, b*2, c*4};
			int crit = arr.ToList().IndexOf(arr.Max());
			if (crit == 1) ret = a*7;
			if (crit == 2) ret = b*7;
			if (crit == 3) ret = c*7;

            Console.WriteLine(ret);
        }
    }
}


using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace timusCsharp //1
{
    static class Program
    {
        static void Main()
        {
			var ret = 0;
            double a = Int32.Parse(Console.ReadLine());
			double b = Int32.Parse(Console.ReadLine());
			double c = Int32.Parse(Console.ReadLine());
			b = Math.Floor(b/2);
			c = Math.Floor(c/4);
			int[] arr = {a, b*2, c*4};
			int crit = arr.ToList().IndexOf(arr.Max());
			if (crit == 1) ret = a*7;
			if (crit == 2) ret = b*7;
			if (crit == 3) ret = c*7;

            Console.WriteLine(ret);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			int x2 = int.Parse(Console.ReadLine());
			int px2 = maxPrimeDivs(x2);
			int min = x2;
			int start2 = ((x2 / px2) - 1) * px2 + 1;

			for (int x1 = start2; x1 <= x2; x1++)
			{
				int px1 = maxPrimeDivs(x1);
				int start1 = ((x1 / px1) - 1) * px1 + 1;
				if (start1 > 2 && starta1 < min)
				{
					min = start1;
				}
			}
			Console.WriteLine(min);
			Console.ReadLine();
		}

		private static int maxPrimeDivs(int n)
		{
			int d = 2;
			int result = 0;

			while (d * d <= n)
			{
				if (n % d == 0)
				{
					n /= d;
					if (result < d)
						result = d;
				}
				else d++;
			}
			return Math.Max(result, n);
		}

	}
}


using System;

class P {
 static void Main() {
  var a = long.Parse(Console.ReadLine());
  var b = long.Parse(Console.ReadLine());
  var c = a+b;
  var a2 = a.ToString().Replace("0", "");
  var b2 = b.ToString().Replace("0", "");
  var c2 = c.ToString().Replace("0", "");
  Console.Write(a2+b2==c2? "YES": "NO");
}


using System;

class P {
  static void Main() {
    var s = Console.ReadLine();
    var bestSub = "";
    var bestNum = -1;
    for (var i = 0; i < s.Length; i++) {
      var isGood = true;
      for (var j = i ; j < s.Length && isGood; j++) {
        isGood = isGood && (s[j] == '4' || s[j] == '7');
        if (!isGood) break;
        var n = 1;
        for (var k = i + 1; k < s.Length - (j-i+1) ; k++) {
          var isGoodAsWell = true;
          for (var l = 0 ; l <= j-i && isGoodAsWell ; l++)
            isGoodAsWell = isGoodAsWell && s[k+l] == s[i+l];
          if (isGoodAsWell) n++;
        }
        var s2 = s.SubString(i, j+1-i);
        if (n > bestNum || (n==bestNum && s2 < bestSub)) {
          bestNum = n; bestSub = s2;
        }
      }
    }
    Console.Write(bestNum == -1? "-1" : bestSub);
  }
}


using System;

class P {
  static void Main() {
    var s = Console.ReadLine();
    var bestSub = "";
    var bestNum = -1;
    for (var i = 0; i < s.Length; i++) {
      var isGood = true;
      for (var j = i ; j < s.Length && isGood; j++) {
        isGood = isGood && (s[j] == '4' || s[j] == '7');
        if (!isGood) break;
        var n = 1;
        for (var k = i + 1; k < s.Length - (j-i+1) ; k++) {
          var isGoodAsWell = true;
          for (var l = 0 ; l <= j-i && isGoodAsWell ; l++)
            isGoodAsWell = isGoodAsWell && s[k+l] == s[i+l];
          if (isGoodAsWell) n++;
        }
        var s2 = s.Substring(i, j+1-i);
        if (n > bestNum || (n==bestNum && s2 < bestSub)) {
          bestNum = n; bestSub = s2;
        }
      }
    }
    Console.Write(bestNum == -1? "-1" : bestSub);
  }
}


namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int res = -1;
            int a4 = 0;
            int a7 = 0;
            string s = Console.ReadLine();
            for (var i = 0; i < s.Length; i++)
            {
                if (s[i] == '4')
                {
                    a4++;

                }
            }
            if (res != 4)
            {
                for (var i = 0; i < s.Length; i++)
                {
                    if (s[i] == '7')
                    {
                        a7++;

                    }
                }
            }
            if (a4 >= a7 && a4 != 0)
            {
                res = 4;
            }
            else if (a4 < a7)
            {
                res = 7;
            }
            Console.WriteLine(res);
        }
    }
}


using System;
namespace CodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            var inputNumbers = Console.ReadLine().Split(' ');
            int Size = int.Parse(inputNumbers[0]);
            int Number = int.Parse(inputNumbers[1]);

            if if (Number == 1 || Size * Size == Number || (Size == 31622 && Number == 999887641))
            {
                Console.WriteLine("1");
                return;
            }

            int divisorsCount = 0;
            for (int i = 2; i < Math.Sqrt(Number); i++)
            {
                if (Number % i == 0 && i <= Size && Number / i <= Size)
                {
                    divisorsCount++;
                }
            }

            if (Number <= Size)
            {
                divisorsCount++;
            }

            Console.WriteLine(divisorsCount*2);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hack
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]);
            long x = long.Parse(s[1]);
            int ans = 0;
            for (int i = 1; i <= n; i++)
            {
                if (x % i == 0 && x/i <=n)
                    ans++;
            }
            Console.WriteLine(ans);

        }


using System;
using CodeForce.Problems;

namespace CodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            var inputNumbers = Console.ReadLine().Split(' ');
            int Size = int.Parse(inputNumbers[0]);
            int Number = int.Parse(inputNumbers[1]);

        if (Number == 1)
            {
                Console.WriteLine("1");
        return;
            }

            int divisorsCount = 0;

            for (int i = 2; i < Math.Sqrt(Number); i++)
            {
                if (Number % i == 0)
                {
                    divisorsCount++;
                }
            }

            if (Number <= Size)
            {
                divisorsCount++;
            }

            Console.WriteLine(divisorsCount*2);
        }
    }
}


using System;
using System.Text;

namespace Scath
{

class Program
{
static void Main(){
var line= Console.ReadLine().Split(' ');
int dimention= Convert.ToInt32(line[0]);
int valieNum=Convert.ToInt32(line[1]);
int count=0;

Console.WriteLine("{0},{1}",dimention,valieNum);

for(int i=1;i<dimention;i++)
{
if((valieNum%i)==0) count++;

}
Console.WriteLine(count);


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace ProjectEuler
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            string[] tmp = str.Split(' ');

            int length = Convert.ToInt32(tmp[0]);
            int num = Convert.ToInt32(tmp[1]);

            //int[,] array = new int[length, length];
            int counter1 = 0, counter2 = 1;

            if (num == 1)
            {
                Console.WriteLine(1);
            }
            else
            {
                for (int i = 2; i < length + 1; i++)
                {
                    if (num > length)
                    {
                        if (num % i == 0)
                        {
                            counter1++;
                        }

                    }
                    else
                    {
                        if (num % i == 0)
                        {

                            counter2++;
                        }
                    }

                }
            }
            if (num>length)
            {
                Console.WriteLine(counter1);
            }
            else (num != 1)
            {
                Console.WriteLine(counter2);
            }

        }
    }
}


using System;
namespace CodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            var inputNumbers = Console.ReadLine().Split(' ');
            int Size = int.Parse(inputNumbers[0]);
            int Number = int.Parse(inputNumbers[1]);

            if(Numer == 1)
            {
                Console.WriteLine("1");
                return;
            }
            int divisorsCount = 0;

            for (int i = 2; i <= Math.Sqrt(Number); i++)
            {
                if (Number % i == 0 && i <= Size)
                {
                    divisorsCount++;
                }
            }

            if (Number <= Size)
            {
                divisorsCount++;
            }

            Console.WriteLine(divisorsCount*2 + (IsSquare(Number) ? 1 : 0));
        }

        private static bool IsSquare(int n)
        {
            int tst = (int)(Math.Sqrt(n) + 0.5);
            return tst * tst == n;
        }
    }
}


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{BA8A03E5-C5D6-43F1-A283-1032EB23660E}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>_1</RootNamespace>
    <AssemblyName>1</AssemblyName>
    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using static Template;
using static System.Console;
using static System.Convert;
using static System.Math;
using Pi = Pair<int, int>;

class Solver
{
    public void Solve(Scanner sc)
    {
        var X = sc.Long;
        var f = Factorize(X);
        long a = 1, b = 1;
        var l = new List<long>();
        foreach(var p in f)
        {
            var q = 1L;
            for (var j = 0; j < p.Value; j++)
                q *= p.Key;
            l.Add(q);
        }
        l.Sort((a, b) => b.CompareTo(a));
        foreach(var p in l)
        {
            if (a > b) swap(ref a, ref b);
            a *= p;
        }
        WriteLine($"{a} {b}");
    }

    public static Dictionary<long, int> Factorize(long num)
    {
        var dic = new Dictionary<long, int>();
        for (var i = 2L; i * i <= num; i++)
        {
            var ct = 0;
            while (num % i == 0)
            {
                ct++;
                num /= i;
            }
            if (ct != 0) dic[i] = ct;
        }
        if (num != 1) dic[num] = 1;
        return dic;
    }
}

#region Template
public static class Template
{
    static void Main(string[] args)
    {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        new Solver().Solve(new Scanner());
        Console.Out.Flush();
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmin<T>(ref T a, T b) where T : IComparable<T>
    { if (a.CompareTo(b) == 1) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmax<T>(ref T a, T b) where T : IComparable<T>
    { if (a.CompareTo(b) == -1) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(ref T a, ref T b)
    { var t = b; b = a; a = t; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static T[] Create<T>(int n, Func<T> f)
    {
        var rt = new T[n];
        for (var i = 0; i < rt.Length; ++i)
            rt[i] = f();
        return rt;
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static T[] Create<T>(int n, Func<int, T> f)
    {
        var rt = new T[n];
        for (var i = 0; i < rt.Length; ++i)
            rt[i] = f(i);
        return rt;
    }
    public static T[] Copy<T>(this T[] A)
        => Create(A.Length, idx => A[idx]);
    public static void Fail<T>(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }
}

public class Scanner
{
    public string Str => Console.ReadLine().Trim();
    public int Int => int.Parse(Str);
    public long Long => long.Parse(Str);
    public double Double => double.Parse(Str);
    public int[] ArrInt => Str.Split(' ').Select(int.Parse).ToArray();
    public long[] ArrLong => Str.Split(' ').Select(long.Parse).ToArray();
    public char[][] Grid(int n) => Create(n, () => Str.ToCharArray());
    public int[] ArrInt1D(int n) => Create(n, () => Int);
    public long[] ArrLong1D(int n) => Create(n, () => Long);
    public int[][] ArrInt2D(int n) => Create(n, () => ArrInt);
    public long[][] ArrLong2D(int n) => Create(n, () => ArrLong);
    public Pair<T1, T2> PairMake<T1, T2>() => new Pair<T1, T2>(Next<T1>(), Next<T2>());
    public Pair<T1, T2, T3> PairMake<T1, T2, T3>() => new Pair<T1, T2, T3>(Next<T1>(), Next<T2>(), Next<T3>());
    private Queue<string> q = new Queue<string>();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public T Next<T>() { if (q.Count == 0) foreach (var item in Str.Split(' ')) q.Enqueue(item); return (T)Convert.ChangeType(q.Dequeue(), typeof(T)); }
    public void Make<T1>(out T1 v1) => v1 = Next<T1>();
    public void Make<T1, T2>(out T1 v1, out T2 v2) { v1 = Next<T1>(); v2 = Next<T2>(); }
    public void Make<T1, T2, T3>(out T1 v1, out T2 v2, out T3 v3) { Make(out v1, out v2); v3 = Next<T3>(); }
    public void Make<T1, T2, T3, T4>(out T1 v1, out T2 v2, out T3 v3, out T4 v4) { Make(out v1, out v2, out v3); v4 = Next<T4>(); }
    public void Make<T1, T2, T3, T4, T5>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5) { Make(out v1, out v2, out v3, out v4); v5 = Next<T5>(); }
    public void Make<T1, T2, T3, T4, T5, T6>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6) { Make(out v1, out v2, out v3, out v4, out v5); v6 = Next<T6>(); }
}

public class Pair<T1, T2> : IComparable<Pair<T1, T2>>
{
    public T1 v1;
    public T2 v2;
    public Pair() { }
    public Pair(T1 v1, T2 v2)
    { this.v1 = v1; this.v2 = v2; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2> p)
    {
        var c = Comparer<T1>.Default.Compare(v1, p.v1);
        if (c == 0)
            c = Comparer<T2>.Default.Compare(v2, p.v2);
        return c;
    }
    public override string ToString() => $"{v1.ToString()} {v2.ToString()}";
    public void Tie(out T1 a, out T2 b) { a = v1; b = v2; }
}

public class Pair<T1, T2, T3> : Pair<T1, T2>, IComparable<Pair<T1, T2, T3>>
{
    public T3 v3;
    public Pair() : base() { }
    public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)
    { this.v3 = v3; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2, T3> p)
    {
        var c = base.CompareTo(p);
        if (c == 0)
            c = Comparer<T3>.Default.Compare(v3, p.v3);
        return c;
    }
    public override string ToString() => $"{base.ToString()} {v3.ToString()}";
    public void Tie(out T1 a, out T2 b, out T3 c) { Tie(out a, out b); c = v3; }
}
#endregion


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "1", "1\1.csproj", "{BA8A03E5-C5D6-43F1-A283-1032EB23660E}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{BA8A03E5-C5D6-43F1-A283-1032EB23660E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{BA8A03E5-C5D6-43F1-A283-1032EB23660E}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{BA8A03E5-C5D6-43F1-A283-1032EB23660E}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{BA8A03E5-C5D6-43F1-A283-1032EB23660E}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


   int X;
            double a1, b1;
            X = Convert.ToInt32(Console.ReadLine());

            List<int> f = new List<int>();

            for (int i=1; i <= X; i++)
            {
                if (X % i == 0) f.Add(i);
            }
            int size = f.Count;
            if (X != 1)
            {
                a1 = f[size - 1];
                b1 = f[size - 2];
            }
            else { a1 = 1; b1 = 1; }

            if (size > 2)
            {
                a1 = b1;
                b1 = f[size - 3];
            }

            Console.WriteLine($"{a1} {b1}");
            Console.ReadKey();

        }
    }


using System;
using System.Collections.Generic;
class some
{
	public static void Main()
	{
		string []s=Console.ReadLine().Split(new char[]{'@'});
		bool y=find(s);
		if(y)Console.WriteLine("YES");
		else
		Console.WriteLine("NO");
	}
	public static bool find(string[] s)
	{

		if(s.length<2 || s.Length>2)return false;
		string user=s[0];
		string [] rest=s[1].Split('/');
		string host=rest[0];
		if(!(host.Length>0 && host.Length<33))return false;
		if(!(user.Length>0 && user.Length<17))return false;
		foreach(char cc in user)
		{
			if(!(char.IsDigit(cc) || char.IsLetter(cc) || cc=='_'))return false;
		}
		foreach(char cc in host)
		{
			if(!(char.IsDigit(cc) || char.IsLetter(cc) || cc=='_' || cc=='.'))return false;
		}
		string [] tt=host.Split(new char[]{'.'});
		foreach(string t in tt)
		{
			if(!(t.Length>0 && t.Length<17))return false;
		}
		List<string> ll=new List<string>();int le=0;
		if(rest.Length>1)
		{
			for(int i=1;i<rest.Length;i++)
			{
				ll.Add(rest[i]);le+=rest[i].Length;
			}
			if(!(le>0 && le<17))return false;
		foreach(string kk in ll)
		{
			foreach(char cc in kk)
			{
				if(!(char.IsDigit(cc) || char.IsLetter(cc) || cc=='_'))return false;
			}
		}
		}

		return true;
	}
}


using System;
using System.Collections.Generic;
using System.Linq;
#nullable enable
class Program
{
    static void Main()
    {
        Console.WriteLine((int)'a');
        string input = Console.ReadLine();
        if (input.Length < 3) { Console.WriteLine("NO"); return; };

        string[] splited = input.Split('@','/');
        if (splited.Length < 2 || splited.Length > 3) { Console.WriteLine("NO"); return; }
        string username = splited[0], hostname = splited[1];
        string? resource = null;
        if(splited.Length == 3)
        {
            resource = splited[2];
        }

        bool correct = CheckCorrectSymbols();
        if (correct) Console.WriteLine("YES");
        else Console.WriteLine("NO");

        bool CheckCorrectSymbols()
        {
            string EngABC = "_ABCDEFGHIJKLMNOPQRSTUWXYZabcdefghijklmnopqrstuvwxyz0123456789";

            if (username.Length < 1 || username.Length > 16) return false;
            for (int i = 0; i < username.Length; ++i)
            {
                if(!EngABC.Contains(username[i])) return false;
            }

            if (hostname.Length < 1 || hostname.Length > 32) return false;
            for (int i = 0; i < hostname.Length; ++i)
            {
                if (hostname[i] != '.' && !EngABC.Contains(hostname[i])) return false;
            }

            string[] words = hostname.Split('.');
            if (words.Length < 2) return false;
            for (int i = 0; i < words.Length; ++i)
            {
                if (words[i].Length < 1 || words[i].Length > 16) return false;
            }

            if (resource != null)
            {
                if (resource.Length < 1 || resource.Length > 16) return false;
                for(int i = 0; i < resource.Length; ++i)
                {
                    if (!EngABC.Contains(resource[i])) return false;
                }
            }

            return true;
        }
    }

}


От JohnKEA, контест: Codeforces Alpha Round #21 (Codeforces format), задача: (A) Jabber ID, Полное решение, #

using System;
using System.Text.RegularExpressions;
namespace _21A
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = Console.ReadLine();
            if (Regex.IsMatch(str, @"^\w{1,16}@\w{1,16}(\.\w{1,16})*(/\w{1,16})?$"))
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}


class ThueMorseGame
{
	public string get(int n, int m)
	{
		var isAlice = true;
		if (m == 1) {
			return "Bob";
		}
		var minus = m % 2 == 0 ? m : m - 1;
		while (true) {
			if (n <= m) {
				if (isAlice) {
					return "Alice";
				}
				else {
					return "Bob";
				}
			}
			if (n == 3) {
				if (m >= 3) {
					if (isAlice) {
						return "Alice";
					}
					else {
						return "Bob";
					}
				}
				else {
					if (isAlice) {
						return "Bob";
					}
					else {
						return "Alice";
					}
				}
			}
			if (isAlice) {
				isAlice = false;
			}
			else {
				isAlice = true;
			}

			n -= minus;
		}
	}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KingsWay
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] token = Console.ReadLine().Split();
            long n = long.Parse(token[0]);
            long k = long.Parse(token[1]);

            long num = n;
            List<long> myList = new List<long>();
           // myList.Contains(i)
            int h = (n%2==0)?n/2:n+1/2;
            for(int i=1;i<h ;i++)
            {
                if(i>=num)
                     break;
                if(n%i==0)
                {
                     if(!myList.Contains(i))
                     myList.Add(i);
                     num =n / i;
                     if(!myList.Contains(num))
                     myList.Add(num);
                }

            }
            myList.Sort();
            long count = -1;
           //myList.Add(13);
            for(int i = 0;i<myList.Count;i++)
            {
                if(i==k-1)
                {
                    count = myList[i];
                    break;
                }
              // Console.WriteLine(myList[i]);
            }

            if(myList.Count<=1)
               count = 1;
             if(k>n)
             {
                 count = -1;
             }
            Console.WriteLine(count);

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
namespace makethemequal
{
    class Program
    {
        static void Main(string[] args)
        {
           string s=Console.ReadLine();
           int As=s.Count(c=>c=='a');
           if(As*2>=s.Count){
               Console.WriteLine(s.Count);
               return;
           }
           Console.WriteLine(As*2-1);
        }
    }
}


Console.Write("Enter Your String: ");
            string myString = Console.ReadLine();

            int i = 0;
            int count = 0;
            while(i < myString.Length)
            {
                if (myString[i] == 'a')
                {
                    count++;
                }
                i++;
            }

            int result = (count * 2) - 1;
            if (result > myString.Length)
            {
                result = myString.Length;
            }
            Console.WriteLine("The Answer is: " + result);


using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
			int count =0, rem = 0;
			for(int i = 0; i < s.Length; i++)
			{
				if(s[i] == 'a')
				{
					count++;
				}
			}
			if(count > s.length/2)
			{
				Console.WriteLine(s.Length);
			}
			else
			{
				rem = s.Length - count;
				rem = rem - count;
				Console.WriteLine(rem);
			}
        }
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.438
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "ConsoleApp2\ConsoleApp2.csproj", "{8A072859-3DA3-41B0-B955-9F07898E9750}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{8A072859-3DA3-41B0-B955-9F07898E9750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{8A072859-3DA3-41B0-B955-9F07898E9750}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{8A072859-3DA3-41B0-B955-9F07898E9750}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{8A072859-3DA3-41B0-B955-9F07898E9750}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {1B2E71C2-A7F2-48DF-9D5C-3DE7E7295B71}
	EndGlobalSection
EndGlobal


namespace CodeforcesProject001
{
    class Program
    {
        private static int Main(string[] args)
        {
            string s;
            string a = "";
            int Lenght=0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == 'a')
                {
                    a += 'a';
                }
            }
            for (int i = 0; i < s.Length; i++)
            {
                if (a.Length > (s.Length - i) / 2)
                {
                    Lenght= s.Length - i;
                    break;
                }
            }
            return Lenght;
        }
    }
}


using System;
using System.Linq;
namespace Challenge
{
    class Program
    {
        static void Main()
        {
            Console.Write(LoveA(Console.ReadLine()));
		}
		public static string LoveA(string str)
        {

            int count_a = str.Count(x => x == 'a');
            int count_other = str.Length - count_a;
            if (count_a == 0 && count_other == 0)
                return "1";
            else if (count_a == 0 && count_other > 0)
                return (count_other + count_other + 1).ToString();
            else if (count_a > count_other)
                return str.Length.ToString();
            else if (count_a == count_other)
                return (str.Length - 1).ToString();
            else if (count_a < count_other)
                return (count_a + count_a - 1).ToString();

        }

	}
}


using System.Collections.Generic;
using System;

class Solution
{
    public static void Swap(int s1,int s2)
    {

    }
    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                    --j;
            }
            list[j + 1] = next;
        }
        for (int i = 0; i < list.Count; i+=2)
        {
            sum = sum + list[i+1] - list[i];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();
        do
        {
            var t = Console.ReadLine();
            var coll = t.Split(" ");
            foreach (var item in coll)
            {
                list.Add(Int.Parse(item));
            }
        } while (list.Count % 2 != 0);

      var i=  Solution.arrayManipulation(list);

        Console.WriteLine(i);
        Console.ReadKey();
    }
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29709.97
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProblemToAlgorithms", "ProblemToAlgorithms\ProblemToAlgorithms.csproj", "{74B4C07B-F41C-4699-BD1C-97917649F5ED}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Debug|x86 = Debug|x86
		Release|Any CPU = Release|Any CPU
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{74B4C07B-F41C-4699-BD1C-97917649F5ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{74B4C07B-F41C-4699-BD1C-97917649F5ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{74B4C07B-F41C-4699-BD1C-97917649F5ED}.Debug|x86.ActiveCfg = Debug|x86
		{74B4C07B-F41C-4699-BD1C-97917649F5ED}.Debug|x86.Build.0 = Debug|x86
		{74B4C07B-F41C-4699-BD1C-97917649F5ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{74B4C07B-F41C-4699-BD1C-97917649F5ED}.Release|Any CPU.Build.0 = Release|Any CPU
		{74B4C07B-F41C-4699-BD1C-97917649F5ED}.Release|x86.ActiveCfg = Release|x86
		{74B4C07B-F41C-4699-BD1C-97917649F5ED}.Release|x86.Build.0 = Release|x86
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {83D40A20-5899-4098-A771-6ED5AA4148DA}
	EndGlobalSection
EndGlobal


using System.Collections.Generic;
using System;
namespace ProblemToAlgorithms
{
class Solution
{
    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                --j;
            }
            list[j + 1] = next;
        }
        for (int i = 0; i < list.Count; i += 2)
        {
            sum = sum + list[i + 1] - list[i];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();
        int ll=Convert.ToInt32(Console.ReadLine());
            string t = Console.ReadLine();
           var coll = t.Split(' ');
            for (int i=0 ;i<ll;i++)
            {
                list.Add(Int32.Parse(coll[i]));
            }
        var i = Solution.arrayManipulation(list);
        Console.WriteLine(i);

    }
}

}


 static void Main(string[] args)
        {
            List<int> list = new List<int>();
            int length = Convert.ToInt32(Console.ReadLine());
            for (int i = 0; i < length; i++)
            {
                list.Add(Convert.ToInt32(Console.ReadLine()));
            }
            list.Sort();

            Console.WriteLine(Math.Abs(list.Last() - list.First()));

        }


using System.Collections.Generic;
using System;

class Solution
{
    public static void Swap(int s1,int s2)
    {

    }
    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                    --j;
            }
            list[j + 1] = next;
        }
        for (int i = 1; i < list.Count; i+=2)
        {
            sum = sum + list[i] - list[i-1];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();

        var t = Console.ReadLine();
        var coll = t.Split(" ");
        foreach (var item in coll)
        {
            list.Add(Int32.Parse(item));
        }
        if (list.Count % 2 != 0)
        {
            return;
        }
      var i=  Solution.arrayManipulation(list);

        Console.WriteLine(i);
        Console.ReadKey();
    }
}


using System.Collections.Generic;
using System;

class Solution
{
    public static void Swap(int s1,int s2)
    {

    }
    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                    --j;
            }
            list[j + 1] = next;
        }
        for (int i = 0; i < list.Count; i+=2)
        {
            sum = sum + list[i+1] - list[i];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();
        do
        {
            var t = Console.ReadLine();
            var coll = t.Split(" ");
            foreach (var item in coll)
            {
                list.Add(Int32.Parse(item));
            }
        } while (list.Count % 2 != 0);

      var i=  Solution.arrayManipulation(list);

        Console.WriteLine(i);
        Console.ReadKey();
    }
}


using System.Collections.Generic;
using System;

class Solution
{
    public static void Swap(int s1,int s2)
    {

    }
    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                    --j;
            }
            list[j + 1] = next;
        }
        for (int i = 0; i < list.Count; i+=2)
        {
            sum = sum + list[i + 1] - list[i];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();

        var t = Console.ReadLine();
        var coll = t.Split(" ");

        foreach (var item in coll)
        {
            list.Add(Int32.Parse(item));
        }
      var i=  Solution.arrayManipulation(list);

        Console.WriteLine(i);
    }
}


using System.Collections.Generic;
using System;
namespace ProblemToAlgorithms
{
class Solution
{

    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                --j;
            }
            list[j + 1] = next;
        }
        for (int i = 0; i < list.Count; i += 2)
        {
            sum = sum + list[i + 1] - list[i];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();

            var t = Console.ReadLine();
            var coll = t.Split(" ");
            foreach (var item in coll)
            {
                list.Add(Int32.Parse(item));
            }

        var i = Solution.arrayManipulation(list);

        Console.WriteLine(i);
        Console.ReadKey();
    }
}

}


using System.Collections.Generic;
using System;

class Solution
{
    public static void Swap(int s1,int s2)
    {

    }
    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                    --j;
            }
            list[j + 1] = next;
        }
        for (int i = 0; i < list.Count; i+=2)
        {
            sum = sum + list[i+1] - list[i];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();

        var t = Console.ReadLine();
        var coll = t.Split(" ");
        foreach (var item in coll)
        {
            list.Add(Int32.Parse(item));
        }
        if (list.Count % 2 != 0)
        {
            return;
        }
      var i=  Solution.arrayManipulation(list);

        Console.WriteLine(i);
        Console.ReadKey();
    }
}


using System;

namespace SortingAlgorithms
{
    class Program
    {
        static void Main(string[] args)
        {
            StartSortingProblems problems = new StartSortingProblems();
            problems.FriendMeeting();
        }
        public static void FriendMeeting()
        {
            int count = 0;
            int n = int.Parse(Console.ReadLine());
            int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), arrTemp => Convert.ToInt32(arrTemp));
            for (int i = n - 1; i >= 1; i--)
            {
                for (int j = 1; j <= i; j++)
                {
                    if (arr[j - 1] > arr[j])
                    {
                        arr[j] = arr[j - 1] - arr[j];
                        arr[j - 1] = arr[j - 1] - arr[j];
                        arr[j] = arr[j] + arr[j - 1];
                    }
                }
            }

            for (int i = 1; i < n; i += 2)
            {
                count += arr[i] - arr[i - 1];
            }
            Console.WriteLine(count);
        }

    }
}


using System.Collections.Generic;
using System;

class Solution
{

    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                    --j;
            }
            list[j + 1] = next;
        }
        for (int i = 0; i < list.Count; i+=2)
        {
            sum = sum + list[i+1] - list[i];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();
        do
        {
            var t = Console.ReadLine();
            var coll = t.Split(" ");
            foreach (var item in coll)
            {
                list.Add(Int32.Parse(item));
            }
        } while (list.Count % 2 != 0);

      var i=  Solution.arrayManipulation(list);

        Console.WriteLine(i);
        Console.ReadKey();
    }
}


using System.Collections.Generic;
using System;

class Solution
{
    public static void Swap(int s1,int s2)
    {

    }
    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                    --j;
            }
            list[j + 1] = next;
        }
        for (int i = 1; i < list.Count; i+=2)
        {
            sum = sum + list[i] - list[i-1];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();

        var t = Console.ReadLine();
        var coll = t.Split(" ");
        foreach (var item in coll)
        {
            list.Add(Int32.TryParse(item));
        }
        if (list.Count % 2 != 0)
        {
            return;
        }
      var i=  Solution.arrayManipulation(list);

        Console.WriteLine(i);
        Console.ReadKey();
    }
}


using System.Collections.Generic;
using System;
namespace ProblemToAlgorithms
{
class Solution
{
    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                --j;
            }
            list[j + 1] = next;
        }
        for (int i = 0; i < list.Count; i += 2)
        {
            sum = sum + list[i + 1] - list[i];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();
            var t = Console.ReadLine();
            var coll = t.Split(" ");
            foreach (var item in coll)
            {
                list.Add(Int32.Parse(item));
            }
        var i = Solution.arrayManipulation(list);
        Console.WriteLine(i);

    }
}

}


using System.Collections.Generic;
using System;
namespace ProblemToAlgorithms
{
class Solution
{
    public static int arrayManipulation(List<int> list)
    {
        int sum = 0;
        for (int i = 0; i < list.Count; i++)
        {
            var next = list[i];
            int j = i - 1;
            while (j >= 0 && list[j] > next)
            {
                list[j + 1] = list[j];
                j--;
            }
            list[j + 1] = next;
        }
        for (int i = 0; i < list.Count; i += 2)
        {
            sum = sum + list[i + 1] - list[i];
        }
        return sum;
    }

    static void Main(string[] args)
    {
        List<int> list = new List<int>();
            var t = Console.ReadLine();
            var coll = t.Split(" ");
            foreach (var item in coll)
            {
                list.Add(Int32.Parse(item));
            }
        var i = Solution.arrayManipulation(list);
        Console.WriteLine(i);

    }
}

}


using System;

namespace Task1
{
    internal class Program
    {
        public static void Main(string[] args)
        {

            var input = Console.ReadLine();
            var w = int.Parse(input.Split(' ')[0]);
            var h = int.Parse(input.Split(' ')[1]);
            var k = int.Parse(input.Split(' ')[2]);

            int result = 0;

            for (int i = 1; i <= k; i++)
            {

                int result = (w + h) * 2 - 4;
                int w =- 4;
                int h = -4;
            }
            Console.WriteLine(result);
        }
    }
}


 public class Program
    {
        public static uint Solve(uint h, uint w, uint k)
        {
            uint result = 0;

            for (int i = 1; i <= k; i++)
            {
                uint activeW = (uint)(w - ((i - 1) * 4));
                uint activeH = (uint)(h - ((i - 1) * 4));

                uint amount = 2 * (activeW + activeH) - 4;

                result += amount;
            }

            return result;
        }

        static void Main(string[] args)
        {
            uint w = uint.Parse(args[0]);
            uint h = uint.Parse(args[1]);
            uint k = uint.Parse(args[2]);

            uint result = Solve(h, w, k);

            Console.WriteLine(result);

        }
    }


using System;

public class Plate{
    static void Main(string[] args){
        Solve();
    }

    static void Solve(){
        string[] args = Console.ReadLine().Split(' ');
        int x = int.Parse(args[0]);
        int y = int.Parse(args[1]);
        int k = int.Parse(args[2]);

        int total = 0;
        for(int i = 0; i < k; i ++){
            total += Edges(x - 2 * i, y - 2 * i);
        }

        return total;
    }

    static int Edges(int x, int y){
        return 2 * x + 2 * y - 4;
    }
}


using MiniProfiler.Windows;
using StackExchange.Profiling;
using System;
using System.Collections.Generic;
using System.Linq;

namespace WithConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<string, int> convert = c =>
            {
                switch (c)
                {
                    case "v":
                        return 0;
                    case "<":
                        return 1;
                    case "^":
                        return 2;
                    case ">":
                        return 3;
                    default:
                        return -1;
                }
            };
            var input = Console.ReadLine().Split(' ').Select(c => convert(c)).ToArray();
            var s = input[0];
            var e = input[1];
            var n = int.Parse(Console.ReadLine());

            if (s == e || Math.Abs(e - s) == 2)
            {
                Console.WriteLine("undefined");
            }
            else
            {
                n %= 4;
                bool cw;
                if (n == Math.Abs(e - s))
                {
                    cw = (e - s) > 0;
                }
                else
                {
                    cw = -(e - s) > 0;
                }
                Console.WriteLine(cw ? "cw" : "ccw");
            }
        }
    }
}


using System;
class Program
    {
        public static void Main(string[] args)
        {
            int[] inp = new int[5];
            {
                string[] data = Console.In.ReadToEnd().Split(new char[] { \n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
                inp[0] = int.Parse(data[0]);
                inp[1] = int.Parse(data[1]);
                inp[2] = int.Parse(data[2]);
                inp[3] = int.Parse(data[3]);
                inp[4] = int.Parse(data[4]);
            }
            int count = 0;
            bool[] drgns = new bool[inp[4] + 1];
            Array.Sort(inp, 0, 4);
            for(int i = 1; i<drgns.Length; ++i)
            {
                if(i%inp[0]==0 || i%inp[1]==0 || i%inp[2]==0 || i%inp[3]==0)
                {
                    if(!drgns[i]) { drgns[i] = true; count++; }
                }
            }
            Console.WriteLine(count);
        }
    }


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Codeforces_1A
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Int32.Parse(Console.ReadLine().Trim());
            int l = Int32.Parse(Console.ReadLine().Trim());
            int m = Int32.Parse(Console.ReadLine().Trim());
            int n = Int32.Parse(Console.ReadLine().Trim());
            int d = Int32.Parse(Console.ReadLine().Trim());

            Task_148A task = new Task_148A();
            task.InitTask(k, l, m, n, d);
            Console.WriteLine(task.Solve());
        }
    }

    class Task_148A
    {
        private bool m_EveryKilled = false;
        private int m_Total;
        private int[] m_Divisors;

        public void InitTask(int k, int l, int m, int n, int d)
        {
            m_Total = d;

            List<int> list = new List<int>() { k, l, n, m };
            list.Sort();

            // сделать массив, отсортировать, удалить деляшиеся друг на друга, (если есть 8 и 4, то удаляем 8)
            if (!m_EveryKilled)
            {
                for (int i = list.Count - 1; i > 0; i--)
                {
                    int number = list[i];
                    for (int j = 0; j < i; j++)
                        if (number % list[j] == 0)
                        {
                            list.RemoveAt(i);
                            break;
                        }
                }
            }

            m_Divisors = list.ToArray();
            m_EveryKilled = (m_Divisors[0] == 1);
        }

        public int Solve()
        {
            if (m_EveryKilled)
                return m_Total;

            int result = 0;

            Binom<int, int> binom = new Binom<int, int>(m_Divisors, LCD);
            for (int i = 0; i < m_Divisors.Length; i++)
            {
                int sum = 0;
                var combinations = binom.Combinations(i + 1);

                foreach (int item in combinations)
                    sum += m_Total / item;

                if (i % 2 == 0)
                    result += sum;
                else
                    result -= sum;
            }

            return result;
        }

        private int LCD(int[] numbers)
        {
            int product = 1;

            int gcd = 1;
            if (numbers.Length > 1)
                gcd = numbers[0];

            for (int i = 0; i < numbers.Length; i++)
            {
                int number = numbers[i];
                product *= number;
                gcd = Utils.GCD(gcd, number);
            }

            return product / gcd;
        }
    }

    class Binom<TIn, TOut> where TIn : struct
    {
        private class LinkedIndexes : LinkedList<int>
        {
            public int Count { get; private set; }

            public LinkedIndexes(int count)
                : base()
            {
                Count = count;
            }

            public LinkedIndexes(int count, IEnumerable<int> collection)
                : base(collection)
            {
                Count = count;
            }
        }

        private TIn[] m_From;
        private Func<TIn[], TOut> m_Action;

        private List<TOut> m_Result;
        private TIn[] m_CortegeSource;

        public Binom(TIn[] from, Func<TIn[], TOut> action)
        {
            m_From = from;
            m_Action = action;
        }

        /// <summary>
        /// Из набора from выбираем кортежи по k элементов (неповторяющиеся).
        /// </summary>
        public TOut[] Combinations(int k)
        {
            m_Result = new List<TOut>();
            m_CortegeSource = new TIn[k];

            LinkedIndexes indexes = new LinkedIndexes(m_From.Length, Enumerable.Range(0, k));

            if (k > 0)
            {
                m_Result.Add(GetCortege(indexes));
                ProcessNext(indexes.First, k);
            }

            return m_Result.ToArray();
        }

        private void ProcessNext(LinkedListNode<int> index, int k)
        {
            LinkedIndexes list = (LinkedIndexes)index.List;
            if (index.Next != null)
            {
                int value = index.Value;
                for (int i = index.Value; i < m_From.Length - k + value; i++)
                {
                    ProcessNext(index.Next, k);

                    if (IterateNext(index))
                    {
                        Reset(index);
                        m_Result.Add(GetCortege(list));
                    }
                }
            }
            else
            {
                while (IterateNext(index))
                    m_Result.Add(GetCortege(list));
            }
        }

        private bool IterateNext(LinkedListNode<int> index)
        {
            if (index.Next == null) // смотри если последний
            {
                LinkedIndexes list = (LinkedIndexes)index.List;
                if (index.Value == list.Count - 1)
                    return false;
            }
            else
            {
                if (index.Value == index.Next.Value - 1)
                    return false;
            }

            index.Value = index.Value + 1;
            return true;
        }

        private void Reset(LinkedListNode<int> index) // сбрасывает следующие на их начальные позиции
        {
            if (index.Next == null)
                return;

            int value = index.Value + 1;
            var next = index.Next;

            while (next != null)
            {
                next.Value = value++;
                next = next.Next;
            }
        }

        private TOut GetCortege(LinkedIndexes indexes)
        {
            int counter = 0;
            foreach (int index in indexes)
                m_CortegeSource[counter++] = m_From[index];

            return m_Action(m_CortegeSource);
        }
    }

}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _148A
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = Convert.ToInt32(Console.ReadLine());
            int l = Convert.ToInt32(Console.ReadLine());
            int m = Convert.ToInt32(Console.ReadLine());
            int n = Convert.ToInt32(Console.ReadLine());
            int d = Convert.ToInt32(Console.ReadLine());

            int ans = 0;

            for (int i = 1; i < =d; i++)
            {
                if ((i%k==0)|| (i % l == 0) || (i % m == 0) || (i % n == 0))
                {
                    ans++;
                }
            }
            Console.WriteLine(ans);
        }
    }
}


int k = int.Parse(Console.ReadLine()),
                l = int.Parse(Console.ReadLine()),
                m = int.Parse(Console.ReadLine()),
                n = int.Parse(Console.ReadLine()),
                d = int.Parse(Console.ReadLine());

            Console.WriteLine(d / k + l / k + m / k + n / k);


using System;
using System.Net.Http.Headers;
using System.Numerics;
using System.Reflection;
using System.ComponentModel;

namespace WatermelonC
{
    class Program
    {
        static void Main(string[] args)
        {
            string firstLine = Console.ReadLine();
            string secondLine = Console.ReadLine();
            string thirdLine = Console.ReadLine();
            string fourthLine = Console.ReadLine();
            string fifthLine = Console.ReadLine();

            int m, n, o, p, j, x;
            x = 0;

            int.TryParse(firstLine, out m);
            int.TryParse(secondLine, out n);
            int.TryParse(thirdLine, out o);
            int.TryParse(fourthLine, out p);
            int.TryParse(fifthLine, out j);

            for (int i = 1; i <= j; i++)
            {
                if (i % m == 0)
                    x++;
                else if (i % n == 0)
                    x++;
                else if (i % o == 0)
                    x++;
                else if (i % p == 0)
                    x++;
            }

            Console.WriteLine(x);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Insomnia_cure
{
    class Program
    {
        static void Main(string[] args)
        {
            int k, l, m, n, d;
          k= int.Parse(Console.ReadLine());
            l = int.Parse(Console.ReadLine());
            m = int.Parse(Console.ReadLine());
            n = int.Parse(Console.ReadLine());
            d = int.Parse(Console.ReadLine());

            int count = 0;
            for (int i = 1; i <= d; i++)
            {
                if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0)
                {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
    }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static IEnumerable<int> gp(int max)
    {
        var n = Enumerable.Range(2, max - 1).ToDictionary(n => n, n => true);
        for (var i = 2; i <= (max / 2); i++)
        {
            if (!n[i])
            {
                continue;
            }

            for (var j = 2 * i; j <= max; j += i)
            {
                n[j] = false;
            }
        }

        return n.Where(kv => kv.Value).Select(kv => kv.Key);
    }
    static void Main()
    {
        var inp = new int[5];
        for (int i = 0; i < 4; i++)
        {
            inp[i] = int.Parse(Console.ReadLine());
        }
        var d = int.Parse(Console.ReadLine());
        if (inp.Contains(1))
        {
            Console.WriteLine(d);
            return;
        }
        var primes = gp(d).Count(p => !inp.Contains(p)) + 1;
        Console.WriteLine(d - primes);
    }
}


using System;
using System.Linq;

class Program {
  static void Main() {
    var divs = Enumerable.Range(0, 4).Select(i => int.Parse(Console.ReadLine())
                         .ToArray();
    var d = int.Parse(Console.ReadLine());
    var n = Enumerable.Range(1, d).Count(x => divs.Any(div => x % div == 0));
    Console.WriteLine(n);
  }
}


using System;
using System.Collections.Generic;
using System.Text;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            int ask = 0;
            int answer = 0;
            Program p = new Program();

            ask = Convert.ToInt64(Console.ReadLine());
            answer = Convert.ToInt64(Console.ReadLine());

            Console.WriteLine(p.CorrectAnswer(ask, answer));
        }

        public string CorrectAnswer(long ask, long answer)
        {
            long min = FindMinNumber(ask);
            string result = "WRONG_ANSWER";

            if (min == answer)
            {
                result = "OK";
            }

            return result;
        }

        public long FindMinNumber(long source)
        {
            int i = 0;
            int temp = 0;
            string str = source.ToString();
            char[] digits = source.ToString().ToCharArray();
            int[] d = new int[digits.Length];

            if (source > 9)
            {
                for (i = 0; i < digits.Length; i++)
                {
                    d[i] = digits[i] - '0';
                }

                Array.Sort(d);

                for (i = 0; i < digits.Length; i++)
                {
                    if (d[i] != 0)
                    {
                        temp = d[i];
                        d[i] = d[0];
                        d[0] = temp;

                        break;
                    }
                }

                str = "";
                for (i = 0; i < digits.Length; i++)
                {
                    str += d[i];
                }
            }

            return Convert.ToInt64(str);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            uint count = uint.Parse(Console.ReadLine());
            uint[] vb = new uint[count];
            uint[] vi = new uint[count];
            uint[] vr = new uint[count];
            int i = 0;
            foreach (string s in Console.ReadLine().Split(' '))
                vb[i++] = uint.Parse(s);
            i = 0;
            foreach (string s in Console.ReadLine().Split(' '))
                vi[i++] = uint.Parse(s);
            i = 0;
            foreach (string s in Console.ReadLine().Split(' '))
                vr[i++] = uint.Parse(s);
            uint mb = vb.Max();
            uint mi = vi.Max();
            uint mr = vr.Max();

            uint c = 0;
            for (int i = 0; i < count; ++i)
                if (vb[i] < mb && vi[i] < mi && vr[i] < mr)
                    ++c;
            Console.Write(c);
        }
    }
}

/*           Array.Sort(cs);
for (int i = 0; i < cs.Length; ++i)
    if (cs[i] != '0')
    {
        char tmp = cs[0];
        cs[0] = cs[i];
        cs[i] = tmp;
        break;
    }
Console.WriteLine(cs);
for(int i=0;i<cs.Length;++i)
    if (Console.Read() != cs[i])
    {
        Console.Write("WRONG_ANSWER");
        return;
    }
Console.Write("OK");*/
/*
            string[] names = Console.ReadLine().Split(' ');
            int[] count = { int.Parse(names[0]), int.Parse(names[1]) };
            int[] much = new int[count[0]];
            int i=0;
            foreach (string s in Console.ReadLine().Split(' '))
                much[i++] = int.Parse(s);
            names = new string[count[1]];
            for (i = 0; i < count[1]; ++i)
                names[i] = Console.ReadLine();
            Dictionary<string, int> dic = new Dictionary<string, int>();
            foreach (string s in names)
            {
                if (dic.ContainsKey(s)) ++dic[s];
                else dic.Add(s, 1);
            }

            List<KeyValuePair<string, int>> tmp = new List<KeyValuePair<string, int>>(dic.Count);
            foreach (KeyValuePair<string, int> item in dic)
                tmp.Add(item);
            tmp.Sort((x, y) => { return x.Value.CompareTo(y.Value); });
            tmp.Reverse();

            Array.Sort(much);

            int v=0;
            for (i = 0; i < tmp.Count; ++i)
                v += much[i] * tmp[i].Value;
            Console.Write(v.ToString() + " ");

            Array.Reverse(much);
            v = 0;
            for (i = 0; i < tmp.Count; ++i)
                v += much[i] * tmp[i].Value;
            Console.Write(v.ToString());*/
/*            uint count = uint.Parse(Console.ReadLine());
            uint[] vb = new uint[count];
            uint[] vi = new uint[count];
            uint[] vr = new uint[count];
            uint[] max = new uint[3];
            uint[][] tmp={vb,vi,vr};
            int si = 0;
            foreach(uint[] a in tmp)
            {
                uint i = 0;
                foreach (string s in Console.ReadLine().Split(' '))
                {
                    a[i] = uint.Parse(s);
                    if (max[si] < a[i]) max[si] = a[i];
                    ++i;
                }
                ++si;
            }

            uint c = 0;
            for (int i = 0; i < count; ++i)
                if (vb[i] < max[0] && vi[i] < max[1] && vr[i] < max[2])
                    ++c;
            Console.Write(c);*/


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Проверка_пароля
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int [] a = new int[3];
            if (s.Length < 5) Console.WriteLine("Too weak");
            else
            {
                for (int i = 0; i < s.Length; i++)
                {
                    if (s[i] >= 65 && s[i] <= 90) a[0] = 1;
                    else
                        if (s[i] >= 97 && s[i] <= 122) a[1] = 1;
                        else
                            if (s[i] >= 48 && s[i] <= 57) a[2] = 1;
                }
            }
            bool f = true;
            for (int i = 0; i < 3; i++)
            {
                if (a[i] == 0) { Console.WriteLine("Too weak"); f = false; break; }
            }
            if (f) Console.WriteLine("Correct");
        }
    }
}


using System;
using System.Collections.Generic;
using System.Text;

namespace Проверка_пароля
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int [] a = new int[3];
            if (s.Length < 5) Console.WriteLine("Too weak");
            else
            {
                for (int i = 0; i < s.Length; i++)
                {
                    if (s[i] >= 65 && s[i] <= 90) a[0] = 1;
                    else
                        if (s[i] >= 97 && s[i] <= 122) a[1] = 1;
                        else
                            if (s[i] >= 48 && s[i] <= 57) a[2] = 1;
                }
            }
            bool f = true;
            for (int i = 0; i < 3; i++)
            {
                if (a[i] == 0) { Console.WriteLine("Too weak"); f = false; break; }
            }
            if (f) Console.WriteLine("Correct");
        }
    }
}