#include <iostream>

using namespace std;

bool isUglyNum(int num) {
  while(num%2 == 0)
    num /= 2;

  while(num%3 == 0)
    num /= 3;

  while(num%5 == 0)
    num /= 5;

  return (num==1?true:false);
}

int getUglyNumber1(int index) {
  if(index<=0)
    return 0;

  int uglyFound = 0;
  int number = 0;
  while(uglyFound < index) {
    ++number;

    if(isUglyNum(number))
      ++uglyFound;
  }

  return number;

}

int main(int argc, char **argv) {
  for(int i=1; i<100; i++)
    cout << getUglyNumber1(i) << endl;

  return 0;
}
