#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
int IT_MAX = 1 << 18;
const long long MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x1f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
int main() {
  int N, A, i, j;
  scanf("%d %d", &N, &A);
  int mn = INF, a1 = -1, a2 = -1, a3 = -1;
  for (i = 1; i <= N - 2; i++) {
    int t = abs(A * N - 180 * i);
    if (mn > t) {
      mn = t;
      a1 = 1, a2 = (N - 1 - i) + 1, a3 = (N - 1 - i) + 2;
    }
  }
  return !printf("%d %d %d\n", a1, a2, a3);
}
