#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long power(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret *= a;
    a *= a;
    if (ret >= MOD) ret %= MOD;
    if (a >= MOD) a %= MOD;
    b >>= 1;
  }
  return ret;
}
long long invmod(long long x) { return power(x, MOD - 2); }
int main() {
  double n, i, a;
  cin >> n >> a;
  double o = 360.0 / n;
  double mn = 1000000000;
  long long x;
  for (i = 2; i <= n - 1; i++) {
    if (mn > abs(a - (180 - ((i)*o) / 2.0)))
      x = i, mn = abs(a - (180 - ((i)*o) / 2.0));
  }
  cout << 1 << " " << x << " " << x + 1;
  return 0;
}
