#include<bits/stdc++.h> using namespace std; int main(){ int n, m, num = 0; cin >> n >> m; while(m--){ for(int i = 0; i <= n-1; i++){ if(m==i){ num++; }else{ cout << i << " "; } } } if(num == n-1){ cout << n; } return 0; }