import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int Card[] = new int[N]; //カード配列作成 for(int i=0; i0){ Card[K-1] = Card[K-2]; K--; } Card[0]=temp; } System.out.println(Card[0]); } }