using System;
public class Program
{
public static void Main()
double result;
for (int input = 1; input < 20; input++)
result = input;
for (int i = 0; i < 10; i++)
result = (16807 * result) % int.MaxValue;
result = result % 10;
Console.WriteLine(result);
}
/*int[] array = new int[7];
for (int num = 0; num < 20; num++)
input = num;
for (int i = 0; i < array.Length; i++)
array[i] = (input / (int)Math.Pow(10, array.Length - 1 - i)) % 10;
} //breaks apart 7-digit input into 7 separate ints
Console.Write(array[i]);
Console.WriteLine();
}*/
/*private int seed;
public LehmerRng(int seed)
if (seed <= 0 || seed == int.MaxValue)
throw new Exception("Bad seed");
this.seed = seed;
public double Next()
int hi = seed / q;
int lo = seed % q;
seed = (a * lo) - (r * hi);
if (seed <= 0)
seed = seed + m;
return (seed * 1.0) / m;