#include <bits/stdc++.h>
int main() {
  long long n, a;
  std::cin >> n >> a;
  long long nAngle = (n - 2) * 180;
  long long num = (a * n) / 180;
  if (num == 0) {
    std::cout << "2 1 3";
    return 0;
  }
  if (num >= n - 2) {
    std::cout << "2 1 " << n;
    return 0;
  }
  if (std::abs(180 * num - a * n) < std::abs(180 * (num + 1) - a * n)) {
    std::cout << "2 1 " << num + 2;
  } else {
    std::cout << "2 1 " << num + 3;
  }
}
