#include <bits/stdc++.h>
using namespace std;

struct Node{
	int val;
	Node* next;
	
	Node(int val):val(val),next(nullptr){};
};

Node* addNode(Node* head,int u,int idx){
	if(head == nullptr){
		head->val = u;
		return head;
	};
	if(head->next == nullptr){
		head->next->val = u;
	}
	Node* curr = head;
	
	int cnt = 0;
	while(curr!=nullptr && cnt<=idx ){
		curr = curr->next;
		cnt++;
	}
	curr->val = u;
	return head;
}
Node* LL(vector<int>&a){
	Node* head =  new Node(a[0]);
	Node* curr = head;
	
	for(int i = 0 ; i < a.size();i++){
		curr->next = new Node(a[i]);
		curr = curr->next;
	}
	return head;
}

void print(Node* head){
	Node* temp = head;
	
	while(temp != nullptr){
		cout<<temp->val<<endl;
		temp = temp->next;
	}
}
int main() {
	int n,k,i ; cin>>n>>k>>i;
	vector<int>a(n);
	
	for(int i = 0;i<n ;i++){
		cin>>a[i];
	}
	
	Node* head = LL(a);
	Node* ans = addNode(head,k,i);
	
	print(ans);
	return 0;
}