#include <iostream>using namespace std;int main(){ int n,j; while ((cin >> n) && (n != 0)){ j=1; while ( j<n ){ if ( j%7 != 0) { cout << j << " "; } j++; } cout << endl; }}