#include <iostream> using namespace std; int main() { int n = 0 , m = 0; while(cin >> n >> m){ int counter = 1; int r[20000] = {0}; r[0] = n; for(int i = 1 ; i < 20000 ; i++){ r[i] = n / m; n /= m; if(n == 1){ r[i+1] = 1; counter = i+1; break; } } char t = 'f'; for(int i = 0 ; i < counter - 1 ; i++){ if(r[i] % m != 0){ t = 't'; } } if(t == 't'){ cout << "Boring!" << endl; }else{ for(int i = 0 ; i < counter ; i++){ cout << r[i] << " "; } cout << endl; } } }