#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long int n;
  int a;
  scanf("%lu", &n);
  scanf("%d", &a);
  double a2 = n * a;
  a2 /= 180;
  a2 += 2;
  unsigned long int a1 = (unsigned long int)a2;
  if (a1 < 3)
    a1 = 3;
  else if (a1 >= n)
    a1 = n - 1;
  double ans1 = (a1 - 2) * 180;
  ans1 /= n;
  double ans2 = (a1 - 1) * 180;
  ans2 /= n;
  if (ans2 - a < a - ans1)
    printf("2 1 %lu\n", a1 + 1);
  else
    printf("2 1 %lu\n", a1);
  return 0;
}
