#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int a, n, k;
	cin>>a>>n>>k;
	while(k--) {
		cout<<a%(n+1)<<" "; a=a/(n+1);
	}
	return 0;
}