#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 10;
int n;
double a;
int main() {
  scanf("%d", &n);
  scanf("%lf", &a);
  double b = (n - 2) * 180 / n, mi = 411;
  int ans = 1;
  for (int i = 1; i <= n - 2; i++) {
    if (((180.0 / n * i - a) > 0 ? (180.0 / n * i - a) : -(180.0 / n * i - a)) <
        mi) {
      mi = ((180.0 / n * i - a) > 0 ? (180.0 / n * i - a)
                                    : -(180.0 / n * i - a));
      ans = i;
    }
  }
  printf("%d %d %d\n", n, n - 1, ans);
  return 0;
}
