#include <bits/stdc++.h>
using namespace std;
inline void read_string_to_vector(vector<string> &vec) {
  string str;
  getline(cin, str);
  vec.push_back(str);
}
template <typename T>
inline void read_digit_to_vector(vector<T> &vec) {
  T t;
  cin >> t;
  vec.push_back(t);
}
long long n, a;
double mMinDelta = 100000000000001LL;
long long mI;
int main() {
  scanf("%lld %lld", &n, &a);
  a *= 2 * n;
  for (register long long i = 1; i <= n - 2; ++i) {
    long long main_angle = 360;
    main_angle *= i;
    if (abs(main_angle - a) < mMinDelta)
      mMinDelta = abs(main_angle - a), mI = n - i;
  }
  printf("%lld %lld %lld\n", n, 1LL, mI);
  return 0;
}
