#include <bits/stdc++.h>
using namespace std;
double op[100100];
int main() {
  double n, a;
  while (scanf("%lf%lf", &n, &a) != EOF) {
    double w;
    int nn = n;
    if (nn % 2 == 0)
      w = n / 2;
    else
      w = n / 2 + 1;
    int i, j;
    double tmp;
    int x, y;
    double out = 360.0;
    double cc = (n - 2) * 180.0 / n;
    for (i = 2; i <= 2; i++) {
      for (j = i + 1; j <= n; j++) {
        tmp = ((j - 2) * 180.0 - cc * (j - 2)) / 2.0;
        op[j] = tmp;
        if (fabs(tmp - a) < out) {
          x = i, y = j;
          out = fabs(tmp - a);
        }
        if (out <= 0.00001) break;
      }
      if (j <= n) break;
    }
    printf("%d 1 %d\n", x, y);
  }
  return 0;
}
