#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int main() {
  cout << setprecision(20) << fixed;
  cin.sync_with_stdio(0), cin.tie(0);
  int n, a;
  cin >> n >> a;
  int id = 0;
  double x = (180. - (360. / n));
  double sumai = 180.0, menor = 0x3f3f3f3f;
  for (int i = 3; i <= n; ++i) {
    double angle = (sumai - x * (i - 2.)) / 2.;
    if (fabs(angle - a) < menor) {
      menor = fabs(angle - a);
      id = i;
    }
    sumai += 180.;
  }
  cout << "2 1 " << id << endl;
  return 0;
}
