using System;
public class Program
{
public static void Main()
int[] A = new int[] {3, 8, 9, 7, 6};
int k = 4;
int shift = A.Length - k;
int[] B = new int[A.Length];
for(int x = 0; x!= A.Length; x++)
if(x+k<A.Length)
B[x] = A[x+k];
}
for(int x = 0; x!= k; x++)
if(x+1<A.Length)
B[shift+x] = A[x];
foreach(int b in B)
Console.WriteLine(b);