#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a;
  cin >> n >> a;
  vector<pair<double, double> > b;
  double r = 1;
  for (long long i = 0; i < n; i++) {
    b.push_back({r * cos(2 * 3.14159265358979323846 * i / n),
                 r * sin(2 * 3.14159265358979323846 * i / n)});
  }
  long long ans = -2;
  double min = INFINITY;
  for (long long i = 2; i < n; i++) {
    double c, d, e, f;
    c = b[1].first - b[0].first;
    d = b[1].first - b[i].first;
    e = b[1].second - b[0].second;
    f = b[1].second - b[i].second;
    double theta =
        acos((c * d + e * f) / (sqrt(c * c + e * e) * sqrt(d * d + f * f)));
    theta = theta * 180 / 3.14159265358979323846;
    if (theta < 0) {
      theta += 180;
      if (theta = 0) theta = 180;
    }
    if (abs(theta - a) < min) {
      min = abs(theta - a);
      ans = i;
    }
  }
  cout << "1 2 " << ans + 1 << endl;
  return 0;
}
