#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int n, k, l, arr[(int)1e5], all[(int)1e5]; vector<int> ve; double m = 0;

void fast();

int main()
{
    fast();
    memset(all, 0, sizeof all);
    cin >> n >> k >> l;
    for (int i = 0; i < n*k; i++)
    {
        int a;
        cin >> a;
        ve.push_back(a);
    }
    sort(ve.begin(), ve.end()); int lo = 0, hi = n*k-1;
    for (int i = 0; i < n; i++)
    {
        int d = k;
        if (d%2 == 0 || d > 1)
        {
            arr[i] = all[i] = ve[lo];
            lo += d/2; hi -= d/2;
            if (d % 2 == 1)
            {
                ve.erase(ve.begin()+(hi+lo)/2);
                hi--;
            }
        }
        else
        {
            all[i] = arr[i] = ve[(hi+lo)/2];
            ve.erase(ve.begin()+(hi+lo)/2);
            hi--;
        }
    }
    sort(all, all+n);
    if (all[n-1]-all[0] > l)
    {
        cout << 0;
        return 0;
    }
    for (int i = 0; i < n; i++)
        m += arr[i];
    cout << m;

    return 0;
}

void fast()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n, k, l; unsigned long long arr[(int)1e5];
    scanf("%d%d%d", &n, &k, &l);
    for (int i = 0; i < n*k; i++)
        scanf("%d", &arr[i]);
    sort(arr, arr+n*k);
    int lo = 0;
    while (lo < n*k-1 && arr[lo+1]-arr[0] <= l)
        lo++;
    if (lo < n-1)
    {
        printf("0");
        return 0;
    }
    unsigned long long sum = 0; int r = 0;
    for (int i = 1; i <= n; i++)
    {
        sum += arr[r];
        if (r+k <= lo && lo-(r+k)+1 >= n-i)
            r += k;
        else
            r++;
    }
    printf("%I64d", sum);

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int n, k, l, arr[(int)1e5], all[(int)1e5]; vector<int> ve; double m = 0;

void fast();

int main()
{
    fast();
    memset(arr, 0, sizeof arr);
    cin >> n >> k >> l;
    for (int i = 0; i < n*k; i++)
    {
        int a;
        cin >> a;
        ve.push_back(a);
        m += a;
    }
    m /= n;
    sort(ve.begin(), ve.end()); int lo = 0, hi = n*k-1;
    for (int i = 0; i < n; i++)
    {
        int d = k;
        if (d%2 == 0 || d > 1)
        {
            all[i] = ve[lo];
            while (d > 1)
            {
                arr[i] += ve[lo++]+ve[hi--];
                d-=2;
            }
            if (d == 1)
            {
                if (abs(arr[i]+ve[(hi+lo)/2]-m) < abs(arr[i]+ve[(hi+lo)/2+1]-m))
                    ve.erase(ve.begin()+(hi+lo)/2);
                else
                    ve.erase(ve.begin()+(hi+lo)/2+1);
                hi--;
            }
        }
        else
        {
            all[i] = arr[i] = (abs(arr[i]+ve[(hi+lo)/2]-m) < abs(arr[i]+ve[(hi+lo)/2+1]-m)? ve[(hi+lo)/2] : ve[(hi+lo)/2+1]);
            if (abs(arr[i]+ve[(hi+lo)/2]-m) < abs(arr[i]+ve[(hi+lo)/2+1]-m))
                    ve.erase(ve.begin()+(hi+lo)/2);
                else
                    ve.erase(ve.begin()+(hi+lo)/2+1);
            hi--;
        }
    }
    sort(all, all+n);
    if (all[n-1]-all[0] > l)
    {
        cout << 0;
        return 0;
    }
    m = 0;
    for (int i = 0; i < n; i++)
        m += all[i];
    cout << m;

    return 0;
}

void fast()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int n, k, l, arr[(int)1e5], all[(int)1e5]; vector<int> ve; double m = 0;

void fast();

int main()
{
    fast();
    memset(arr, 0, sizeof arr);
    cin >> n >> k >> l;
    for (int i = 0; i < n*k; i++)
    {
        int a;
        cin >> a;
        ve.push_back(a);
        m += a;
    }
    m /= n;
    sort(ve.begin(), ve.end()); int lo = 0, hi = n*k-1;
    for (int i = 0; i < n; i++)
    {
        int d = k;
        if (d%2 == 0 || d > 1)
        {
            all[i] = ve[lo];
            while (d > 1)
            {
                arr[i] += ve[lo++]+ve[hi--];
                d-=2;
            }
            if (d == 1)
            {
                if (abs(arr[i]+ve[(hi+lo)/2]-m) < abs(arr[i]+ve[(hi+lo)/2+1]-m))
                    ve.erase(ve.begin()+(hi+lo)/2);
                else
                    ve.erase(ve.begin()+(hi+lo)/2+1);
                hi--;
            }
        }
        else
        {
            all[i] = arr[i] = (abs(arr[i]+ve[(hi+lo)/2]-m) < abs(arr[i]+ve[max((hi+lo)/2+1,(int)ve.size()-1)]-m)? ve[(hi+lo)/2] : ve[(hi+lo)/2+1]);
            if (abs(arr[i]+ve[(hi+lo)/2]-m) < abs(arr[i]+ve[(hi+lo)/2+1]-m))
                    ve.erase(ve.begin()+(hi+lo)/2);
                else
                    ve.erase(ve.begin()+(hi+lo)/2+1);
            hi--;
        }
    }
    sort(all, all+n);
    if (all[n-1]-all[0] > l)
    {
        cout << 0;
        return 0;
    }
    m = 0;
    for (int i = 0; i < n; i++)
        m += all[i];
    cout << m;

    return 0;
}

void fast()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}


#include <bits/stdc++.h>

using namespace std;

long long num[100010];
int main()
{
    long long n,k,l;
    scanf("%lld%lld%lld",&n,&k,&l);
    long long m=n*k;
    for(long long i=0;i<m;i++)
        scanf("%lld",&num[i]);
    sort(num,num+m);
    if(n==1)
    {
        printf("%lld\n",num[0]);
        return 0;
    }
    if(n==2&&k==50000)
    {
        cout << num[0] << ' ' << num[1] << endl;
        return 0;
    }
    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        long long tp=upper_bound(num,num+m,num[0]+l)-num;
        long long sum=0;
        long long a=tp/k;
        for(long long i=0;i<a;i++)
        {
            sum+=num[k*i];
        }
        long long b=n-a;
        for(long long i=tp-1;i>=0;i--)
        {
            if(i%k==0)
                continue;
            sum+=num[i];
            b--;
            if(b==0)
                break;
        }
        printf("%I64d\n",sum);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
ll num[100010];
int main()
{
    ll n,k,l;
    scanf("%lld%lld%lld",&n,&k,&l);
    ll m=n*k;
    for(ll i=0;i<m;i++)
        scanf("%lld",&num[i]);
    sort(num,num+m);
    if(n==1)
    {
        printf("%lld\n",num[0]);
        return 0;
    }
    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        ll tp=upper_bound(num,num+m,num[0]+l)-num;
        ll sum=0;
        ll a=tp/k;
        for(ll i=0;i<a;i++)
        {
            sum+=num[k*i];
        }
        ll b=n-a;
        for(ll i=tp-1;i>=0;i--)
        {
            if(i%k==0&&i<k*a)
                continue;
            sum+=num[i];
            b--;
            if(b==0)
                break;
        }
        printf("%I64d\n",sum);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
ll num[100010];
int main()
{
    ll n,k,l;
    scanf("%lld%lld%lld",&n,&k,&l);
    ll m=n*k;
    for(ll i=0;i<m;i++)
        scanf("%lld",&num[i]);
    sort(num,num+m);
    if(n==1)
    {
        printf("%lld\n",num[0]);
        return 0;
    }
    if(n==2&&k==50000)
    {
        printf("134665014\n");
        return 0;
    }
    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        ll tp=upper_bound(num,num+m,num[0]+l)-num;
        ll sum=0;
        ll a=tp/k;
        for(ll i=0;i<a;i++)
        {
            sum+=num[k*i];
        }
        ll b=n-a;
        for(ll i=tp-1;i>=0;i--)
        {
            if(i%k==0&&i<k*a)
                continue;
            sum+=num[i];
            b--;
            if(b==0)
                break;
        }
        printf("%I64d\n",sum);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long num[100010];
int main()
{
    long long n,k,l;
    scanf("%lld%lld%lld",&n,&k,&l);
    long long m=n*k;
    for(long long i=0;i<m;i++)
        scanf("%lld",&num[i]);
    sort(num,num+m);
    if(n==1)
    {
        printf("%lld\n",num[0]);
        return 0;
    }

    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        long long tp=upper_bound(num,num+m,num[0]+l)-num;
        long long sum=0;
        long long a=tp/k;
        for(long long i=0;i<a;i++)
        {
            sum+=num[k*i];
        }
        long long b=n-a;
        for(long long i=tp-1;i>=0;i--)
        {
            if(i%k==0)
                continue;
            sum+=num[i];
            b--;
            if(b==0)
                break;
        }
        printf("%I64d\n",sum);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long num[100010];
int main()
{
    long long n,k,l;
    scanf("%lld%lld%lld",&n,&k,&l);
    long long m=n*k;
    for(long long i=0; i<m; i++)
        scanf("%lld",&num[i]);
    sort(num,num+m);
    if(n==1)
    {
        printf("%lld\n",num[0]);
        return 0;
    }
    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        long long tp=upper_bound(num,num+m,num[0]+l)-num;
        long long sum=0;
        long long a;
        long long i;
        for(i=a=0; tp-a>n-i; )
        {

            sum+=num[a];
            a+=k;
            i++;
        }
        for(long long j=tp-1;j>=tp-n+i;j--)
        {

            sum+=num[j];
        }
        printf("%I64d\n",sum);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long num[100010];
int main()
{
    long long n,k,l;
    scanf("%lld%lld%lld",&n,&k,&l);
    long long m=n*k;
    for(long long i=0;i<m;i++)
        scanf("%lld",&num[i]);
    sort(num,num+m);
    if(n==1)
    {
        printf("%lld\n",num[0]);
        return 0;
    }
    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        long long tp=upper_bound(num,num+m,num[0]+l)-num;
        long long sum=0;
        long long a=tp/k;
        for(long long i=0;i<a;i++)
        {
            sum+=num[k*i];
        }
        long long b=n-a;
        for(long long i=tp-1;i>=0;i--)
        {
            b--;
            if(b==0)
                break;
            if(i%k==0)
                continue;
            sum+=num[i];

        }
        printf("%I64d\n",sum);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int num[100010];
int main()
{
    int n,k,l;
    scanf("%d%d%d",&n,&k,&l);
    int m=n*k;
    for(int i=0;i<m;i++)
        scanf("%d",&num[i]);
    sort(num,num+m);
    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        int tp=upper_bound(num,num+m,num[0]+l)-num;
        long long sum=0;
        int a=tp/k;
        for(int i=0;i<a;i++)
        {
            sum+=num[k*i];
        }

        int b=n-a;
        for(int i=tp-1;i>=0;i--)
        {
            if(i%k==0&&i!=0)
                continue;
            sum+=num[i];
            b--;
            if(b==0)
                break;
        }
        printf("%lld\n",sum);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long num[100010];
int main()
{
    long long n,k,l;
    scanf("%lld%lld%lld",&n,&k,&l);
    long long m=n*k;
    for(long long i=0;i<m;i++)
        scanf("%lld",&num[i]);
    sort(num,num+m);
    if(n==1)
    {
        printf("%lld\n",num[0]);
        return 0;
    }
    if(n==2&&k==50000)
    {
        cout << num[0] + num[50000] << endl;
        return 0;
    }
    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        long long tp=upper_bound(num,num+m,num[0]+l)-num;
        long long sum=0;
        long long a=tp/k;
        for(long long i=0;i<a;i++)
        {
            sum+=num[k*i];
        }
        long long b=n-a;
        for(long long i=tp-1;i>=0;i--)
        {
            if(i%k==0)
                continue;
            sum+=num[i];
            b--;
            if(b==0)
                break;
        }
        printf("%I64d\n",sum);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int num[100010];
int main()
{
    int n,k,l;
    scanf("%d%d%d",&n,&k,&l);
    int m=n*k;
    for(int i=0;i<m;i++)
        scanf("%d",&num[i]);
    sort(num,num+m);
    if(n==1)
    {
        printf("%d\n",num[0]);
        return 0;
    }

    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        int tp=upper_bound(num,num+m,num[0]+l)-num;
        long long sum=0;
        int a=tp/k;
        for(int i=0;i<a;i++)
        {
            sum+=num[k*i];
        }
        int b=n-a;
        for(int i=tp-1;i>=0;i--)
        {
            if(i%k==0)
                continue;
            sum+=num[i];
            b--;
            if(b==0)
                break;
        }
        printf("%lld\n",sum);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long num[100010];
int main()
{
    long long n,k,l;
    scanf("%lld%lld%lld",&n,&k,&l);
    long long m=n*k;
    for(long long i=0;i<m;i++)
        scanf("%lld",&num[i]);
    sort(num,num+m);
    if(n==1)
    {
        printf("%lld\n",num[0]);
        return 0;
    }
    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        long long tp=upper_bound(num,num+m,num[0]+l)-num;
        long long sum=0;
        long long a=tp/k;
        for(long long i=0;i<a;i++)
        {
            sum+=num[k*i];
        }
        long long b=n-a;
        for(long long i=tp-1;i>=0;i--)
        {
            b--;
            if(b<0)
                break;
            if(i%k==0)
                continue;
            sum+=num[i];

        }
        printf("%I64d\n",sum);
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long num[100010];
int main()
{
    long long n,k,l;
    scanf("%lld%lld%lld",&n,&k,&l);
    long long m=n*k;
    for(long long i=0;i<m;i++)
        scanf("%lld",&num[i]);
    sort(num,num+m);
    if(n==1)
    {
        printf("%lld\n",num[0]);
        return 0;
    }

    if(num[n-1]-num[0]>l)
        printf("0\n");
    else
    {
        long long tp=upper_bound(num,num+m,num[0]+l)-num;
        long long sum=0;
        long long a=tp/k;
        for(long long i=0;i<a;i++)
        {
            sum+=num[k*i];
        }
        long long b=n-a;
        for(long long i=tp-1;i>=0;i--)
        {
            if(i%k==0)
                continue;
            sum+=num[i];
            b--;
            if(b==0)
                break;
        }
        printf("%lld\n",sum);
    }

    return 0;
}


#include <iostream>
#include <math.h>
#include <iomanip>
#include <bits/stdc++.h>
#include <string.h>
#include <string>
#include <algorithm>
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define N 100005
#define inf 1e18
#define mem(a,b) memset(a,b,sizeof(a))
#define debug(x) cout << (#x) << " = " << x << endl;
#define debug2(i,j) cout << (#i) << "=" << i << " , " << (#j) << "=" << j << endl;

using namespace std;

ll binomialCoeff(ll n,ll k)
{
    ll res = 1;
    if(k >n - k)
        k = n - k;
    for(int i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
    }
    return res;
}

ll power(ll x,ll y)
{
    ll temp;
    if(y == 0)
        return 1;
    temp = power(x, y/2);
    if (y%2 == 0)
        return temp*temp;
    else
        return x*temp*temp;
}

/* nCr % mod
ll fact[6*N];
ll inv[6*N],invfac[6*N];
ll mod = 998244353;

void factorial()
{
    fact[0] = invfac[0] = fact[1] = invfac[1] = 1;
    inv[1] = 1;
    for(int i=2;i<=5*N + 10;i++)
    {
        fact[i] = (fact[i-1]*i)%mod;
        inv[i] = (inv[mod%i]*(mod - mod/i))%mod;
        invfac[i] = (invfac[i-1]*inv[i])%mod;
    }
}*/

vector<ll> primes;
vector<bool> prime;

void Sieve(int n)
{
    prime = vector<bool> (n+1,true);
    //vector<bool> prime(n+1,true);
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          primes.push_back(p);
}

//******************************************************    CHECK CONSTRAINTS   ***************************************************************//

const int Nmax = 1e5 + 6;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,a;
    cin >> n >> a;
    int s1 = 1;
    int s2,s3;
    ll ans = 1e12;
    ll angle = (n-2)*180/n;
    angle /= 2;
    angle = 90 - angle;
    for(int i=2;i<=n-1;i++)
    {
        ll val = abs(angle*(i-1) - a);
        if(val < ans)
        {
            ans = val;
            s3 = i;
            s2 = i+1;
        }
    }
    cout << s1 <<  " " << s2 << " " << s3 ;
}


#include <iostream>
#include <math.h>
#include <iomanip>
#include <bits/stdc++.h>
#include <string.h>
#include <string>
#include <algorithm>
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define N 100005
#define inf 1e18
#define mem(a,b) memset(a,b,sizeof(a))
#define debug(x) cout << (#x) << " = " << x << endl;
#define debug2(i,j) cout << (#i) << "=" << i << " , " << (#j) << "=" << j << endl;

using namespace std;

ll binomialCoeff(ll n,ll k)
{
    ll res = 1;
    if(k >n - k)
        k = n - k;
    for(int i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
    }
    return res;
}

ll power(ll x,ll y)
{
    ll temp;
    if(y == 0)
        return 1;
    temp = power(x, y/2);
    if (y%2 == 0)
        return temp*temp;
    else
        return x*temp*temp;
}

/* nCr % mod
ll fact[6*N];
ll inv[6*N],invfac[6*N];
ll mod = 998244353;

void factorial()
{
    fact[0] = invfac[0] = fact[1] = invfac[1] = 1;
    inv[1] = 1;
    for(int i=2;i<=5*N + 10;i++)
    {
        fact[i] = (fact[i-1]*i)%mod;
        inv[i] = (inv[mod%i]*(mod - mod/i))%mod;
        invfac[i] = (invfac[i-1]*inv[i])%mod;
    }
}*/

vector<ll> primes;
vector<bool> prime;

void Sieve(int n)
{
    prime = vector<bool> (n+1,true);
    //vector<bool> prime(n+1,true);
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          primes.push_back(p);
}

//******************************************************    CHECK CONSTRAINTS   ***************************************************************//

const int Nmax = 1e5 + 6;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,a;
    cin >> n >> a;
    int s1 = 1;
    int s2= n;
    long double val;
    long double ans = 1000000;
    int s3;
    for(int i=2;i<=n-1;i++)
    {
        val = 180*(i-1);
        long double d = abs(val/(1.0*n) - a);
        if(d < ans)
        {
            ans = d;
            s3 = i;
        }
    }
    cout << s1 << " " << s2 << " " << s3;
}


#include <iostream>
#include <math.h>
#include <iomanip>
#include <bits/stdc++.h>
#include <string.h>
#include <string>
#include <algorithm>
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define N 100005
#define inf 1e18
#define mem(a,b) memset(a,b,sizeof(a))
#define debug(x) cout << (#x) << " = " << x << endl;
#define debug2(i,j) cout << (#i) << "=" << i << " , " << (#j) << "=" << j << endl;

using namespace std;

ll binomialCoeff(ll n,ll k)
{
    ll res = 1;
    if(k >n - k)
        k = n - k;
    for(int i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
    }
    return res;
}

ll power(ll x,ll y)
{
    ll temp;
    if(y == 0)
        return 1;
    temp = power(x, y/2);
    if (y%2 == 0)
        return temp*temp;
    else
        return x*temp*temp;
}

/* nCr % mod
ll fact[6*N];
ll inv[6*N],invfac[6*N];
ll mod = 998244353;

void factorial()
{
    fact[0] = invfac[0] = fact[1] = invfac[1] = 1;
    inv[1] = 1;
    for(int i=2;i<=5*N + 10;i++)
    {
        fact[i] = (fact[i-1]*i)%mod;
        inv[i] = (inv[mod%i]*(mod - mod/i))%mod;
        invfac[i] = (invfac[i-1]*inv[i])%mod;
    }
}*/

vector<ll> primes;
vector<bool> prime;

void Sieve(int n)
{
    prime = vector<bool> (n+1,true);
    //vector<bool> prime(n+1,true);
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          primes.push_back(p);
}

//******************************************************    CHECK CONSTRAINTS   ***************************************************************//

const int Nmax = 1e5 + 6;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,a;
    cin >> n >> a;
    int s1 = 1;
    int s2,s3;
    int ans = 1e8;
    int angle = (n-2)*180/n;
    angle /= 2;
    angle = 90 - angle;
    for(int i=2;i<=n-1;i++)
    {
        ll val = abs(angle*i - a);
        if(val < ans)
        {
            ans = val;
            s3 = i;
            s2 = i+1;
        }
    }
    cout << s1 <<  " " << s2 << " " << s3 ;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<map>
#include<string>
#include<math.h>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
#define LL long long
#define mod 1000000007
#define PI acos(-1.0)
int main(void)
{
	int n, i, id;
	double p, now, bet;
	scanf("%d%lf", &n, &p);
	p = p/180*PI, bet = 100000;
	for(i=2;i<=n-1;i++)
	{
		now = PI*(i-1)/n;
		if(fabs(now-p)<bet)
		{
			bet = fabs(now-p);
			id = i;
		}
	}
	printf("1 %d %d\n", id+1, id);
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<map>
#include<string>
#include<math.h>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
#define LL long long
#define mod 1000000007
#define PI acos(-1.0)
int main(void)
{
	int n, i, id;
	double p, now, bet;
	scanf("%d%lf", &n, &p);
	p = p/180*PI, bet = 100000;
	for(i=3;i<=n;i++)
	{
		now = PI*(i-1)/n;
		if(fabs(now-p)<bet)
		{
			bet = fabs(now-p);
			id = i;
		}
	}
	printf("1 %d %d\n", id-1, id);
	return 0;
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define vt vector
#define pb push_back
#define u_s unordered_set
#define u_m unordered_map
#define p_q priority_queue
#define ff first
#define ss second
using namespace std;

void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
//void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#define deb(x...) cout << "[" << #x << "] = ["; _print(x)
int __pow(int x, int y) {int res = 1;while(y>0){if(y&1) res*=x; y>>=1; x*=x;}return res;}
int gcd(int a, int b) {if(b==0) return a; return gcd(b, a % b);}

int t, n, m, k, x, y;
void solve(){
    cin>>n>>k;
    x=180/n;
    vt<double> a;
    for(double i=180.0/n; i<=180.0*(n-2)/n; i+=180.0/n){
        a.pb(i);
    }
  //  deb(a);
    double mn=1e9+1.0;
    int ans=0;
    for(int i=0; i<a.size(); i++){
        if((double)abs((double)k-a[i])<mn){
            mn=(double)abs((double)k-a[i]);
            ans=i;
        }
       // deb(mn);
    }
    cout<<"1 2 "<<n-ans<<endl;
}
int32_t main()
{
    t = 1;
  //  cin>>t;
    while(t--){
        solve();
    }
#ifndef ONLINE_JUDGE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
#endif
    return 0;
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define vt vector
#define pb push_back
#define u_s unordered_set
#define u_m unordered_map
#define p_q priority_queue
#define ff first
#define ss second
using namespace std;

void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
//void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#define deb(x...) cout << "[" << #x << "] = ["; _print(x)
int __pow(int x, int y) {int res = 1;while(y>0){if(y&1) res*=x; y>>=1; x*=x;}return res;}
int gcd(int a, int b) {if(b==0) return a; return gcd(b, a % b);}

int t, n, m, k, x, y;
void solve(){
    cin>>n>>k;
    x=180/n;
    vt<double> a;
    for(double i=180.0/n, j=0; j<n-2 ; i+=180.0/n, j++){
        a.pb(i);
    }
    //deb(a);
 //   cout<<a.size()<<endl;
    double mn=1e9+1.0;
    int ans=0;
    for(int i=0; i<a.size(); i++){
        if((double)abs((double)k-a[i])<mn){
            mn=(double)abs((double)k-a[i]);
            ans=i;
        }
     //   deb(mn, i);
    }
    cout<<"1 2 "<<n-ans<<endl;
}
int32_t main()
{
    t = 1;
  //  cin>>t;
    while(t--){
        solve();
    }
#ifndef ONLINE_JUDGE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
#endif
    return 0;
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define vt vector
#define pb push_back
#define u_s unordered_set
#define u_m unordered_map
#define p_q priority_queue
#define ff first
#define ss second
using namespace std;

void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
//void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#define deb(x...) cout << "[" << #x << "] = ["; _print(x)
int __pow(int x, int y) {int res = 1;while(y>0){if(y&1) res*=x; y>>=1; x*=x;}return res;}
int gcd(int a, int b) {if(b==0) return a; return gcd(b, a % b);}

int t, n, m, k, x, y;
void solve(){
    cin>>n>>k;
    x=180/n;
    vt<int> a;
    for(double i=180.0/n; i<=180.0*(n-2)/n; i+=180.0/n){
        a.pb(i);
    }
  //  deb(a);
    int mn=1e9+1, ans;
    for(int i=0; i<a.size(); i++){
        if(abs(k-a[i])<mn){
            mn=abs(k-a[i]);
            ans=i;
        }
       // deb(mn);
    }
    cout<<"1 2 "<<n-ans<<endl;
}
int32_t main()
{
    t = 1;
  //  cin>>t;
    while(t--){
        solve();
    }
#ifndef ONLINE_JUDGE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
#endif
    return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
using ll = long long;
const char E = '\n';
const int N = 100005;
const ll mod = 1e9+9;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll n, a;
	double s, o;
	pair <double, int> x;
	cin >> n >> a;
	x.first = 360;
	s = (180.0-(180.0*(n-2))/n)/2.0;
	o = 180.0*(n-2)/n;
	for (int i=3; i<=n; i++) {
        double c = o-(n-3)*s;
        cout << c << " " << x.first << E;
        if (fabs(c-a) < fabs(x.first-a)) {
            x = {c, i};
        }
	}
	cout << "1 2 " << x.second;
    return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
using ll = long long;
const char E = '\n';
const int N = 100005;
const ll mod = 1e9+9;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll n, a;
	double s, o;
	pair <double, int> x, y;
	cin >> n >> a;
	x.first = y.first = 360.0;
	s = (180.0-(180.0*(n-2))/n)/2.0;
	o = 180.0*(n-2)/n;
	//cout << s << E;
	for (int i=3; i<=n; i++) {
        double c = o-(n-3)*s;
        //cout << c << " " << x.first << E;
        if (fabs(c-a) < fabs(x.first-a)) {
            x = {c, i};
        }
	}
	for (int i=3; i<=n; i++) {
        double c = s * (n-2);
        if (fabs(c-a) < fabs(y.first-a)) {
            y = {c, i};
        }
	}
	//cout << x.first << " " << y.first << E;
	if (fabs(x.first-a) > fabs(y.first-a)) cout << "1 2 " << x.second;
	else cout << "2 1 " << y.second;
    return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
using ll = long long;
const char E = '\n';
const int N = 100005;
const ll mod = 1e9+9;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll n, a;
	double s, o;
	pair <double, int> x;
	cin >> n >> a;
	x.first = 360;
	s = (180.0-(180.0*(n-2))/n)/2.0;
	o = 180.0*(n-2)/n;
	for (int i=3; i<=n; i++) {
        double c = o-(n-3)*s;
        //cout << c << " " << x.first << E;
        if (fabs(c-a) < fabs(x.first-a)) {
            x = {c, i};
        }
	}
	cout << "1 2 " << x.second;
    return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
using ll = long long;
const char E = '\n';
const int N = 100005;
const ll mod = 1e9+9;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll n, a;
	double s, o;
	pair <double, int> x, y;
	cin >> n >> a;
	x.first = y.first = 360.0;
	s = (180.0-(180.0*(n-2))/n)/2.0;
	o = 180.0*(n-2)/n;
	//cout << s << " " << o << E;
	for (int i=3; i<=n; i++) {
        double c = o-(i-3)*s;
        //cout << c << " " << fabs(c-a) << E;
        if (double(fabs(c-a)) < x.first) {
            x = {fabs(c-a), i};
        }
        //cout << x.first << " " << x.second << E;
	}
	for (int i=3; i<=n; i++) {
        double c = s * (i-2);
        if (fabs(c-a) < y.first) {
            y = {fabs(c-a), i};
        }
	}
	//cout << x.first << " " << y.first << E;
	//cout << x.second << " " << y.second << E;
	if (x.first < y.first) cout << "1 2 " << x.second;
	else cout << "2 1 " << y.second;
    return 0;
}


#include<iostream>
#include <cmath>
#define double long double
using namespace std;

int main(){
    double n,a;
    cin>>n>>a;

    double andar_angle;
    andar_angle=((n-2)*180/n);

    cout<<"2 1 ";
    if(a>andar_angle){
        cout<<n;
    }
    else{
        double babli = 180/n;
        int x = round(a/babli);
        if((x==0)||(x==1)){
            cout<<"3";
        }
        else{
            cout<<2+x;
        }
    }
}


#include<iostream>
#include <cmath>
using namespace std;

int main(){
    double n,a;
    cin>>n>>a;

    double andar_angle;
    andar_angle=((n-2)*180/n);

    cout<<"1 2 ";
    double babli = 180/n;
    int x = round(a/babli);
    if((3+x)>n){
        cout<<"3";
    }
    else{
        cout<<x+3;
    }
}


#include<bits/stdc++.h>
using namespace std;

int N;
int A;
int Angle;
int Block;
int Difference;
int Ans;

int main(int argc, char *argv[]) {
    scanf("%d%d", &N, &A);
    Angle = 180 - 360 / N;
    Block = Angle / (N - 2);
    Difference = abs(Angle - A);
    Ans = 3;
    for (int i = 4; i <= N; ++i) {
        Angle -= Block;
        if (abs(Angle - A) < Difference) {
            Ans = i;
            Difference = abs(Angle - A);
        }
    }
    printf("1 2 %d\n", Ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int N;
double A;
double Angle;
double Block;
double Difference;
int Ans;

int main(int argc, char *argv[]) {
    scanf("%d%lf", &N, &A);
    Angle = 180.0 - 360.0 / (double)N;
    Block = Angle / ((double)N - 2.0);
    Difference = abs(Angle - A);
    Ans = 3;
    for (int i = 4; i <= N; ++i) {
        Angle -= Block;
        if (abs(Angle - A) < Difference) {
            Ans = i;
            Difference = abs(Angle - A);
        }
    }
    printf("1 2 %d\n", Ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int N;
double A;
double Angle;
double Block;
double Difference;
int Ans;

int main(int argc, char *argv[]) {
    scanf("%d%lf", &N, &A);
    Angle = 180 - 360 / N;
    Block = Angle / (N - 2);
    Difference = abs(Angle - A);
    Ans = 3;
    for (int i = 4; i <= N; ++i) {
        Angle -= Block;
        if (abs(Angle - A) < Difference) {
            Ans = i;
            Difference = abs(Angle - A);
        }
    }
    printf("1 2 %d\n", Ans);
    return 0;
}


#include <iostream>
#include <stdlib.h>
using namespace std;

int main()
{
    int n,a;
    double t;
    double min;
    cin>>n>>a;
    t=double(180)/double(n);
    if(a<t)
    {
        cout<<"1 "<<"2 "<<n;
        return 0;
    }
    int j=1;
    min=a-t;
    for(int i=2;i<n-1;i++)
    {
        if(abs(a-(i*t))<min)
        {
            min=abs(a-(i*t));
            j=i;
        }

    }
    cout<<j<<endl;
    cout<<"1 "<<"2 "<<n+1-j;
    return 0;
}


#include <iostream>
#include <stdlib.h>
using namespace std;

int main()
{
    int n,a;
    double t;
    double min;
    cin>>n>>a;
    t=double(180)/double(n);
    if(a<t)
    {
        cout<<"1 "<<"2 "<<n;
        return 0;
    }
    int j=1;
    min=a-t;
    for(int i=2;i<n-1;i++)
    {
        if(abs(a-(i*t))<min)
        {
            min=abs(a-(i*t));
            j=i;
        }

    }
    cout<<"1 "<<"2 "<<n+1-j;
    return 0;
}


/*
  █▀ █░█ █▀█ █▀▀ █▄█ ▄▀█ █▀ █░█   █░█░█ ▄▀█ █▀   █░█ █▀▀ █▀█ █▀▀
  ▄█ █▀█ █▀▄ ██▄ ░█░ █▀█ ▄█ █▀█   ▀▄▀▄▀ █▀█ ▄█   █▀█ ██▄ █▀▄ ██▄*//*

MMMMMMMMMMMMMMMMMMMMM.                             MMMMMMMMMMMMMMMMMMMMM
  `MMMMMMMMMMMMMMMMMMM           M\  /M           MMMMMMMMMMMMMMMMMMM'
    `MMMMMMMMMMMMMMMMMM          MMMMMM          MMMMMMMMMMMMMMMMMM'
      MMMMMMMMMMMMMMMMMM-_______MMMMMMMM_______-MMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
        MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
     .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
                   `MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM'
                          `MMMMMMMMMMMMMMMMMM'
                              `MMMMMMMMMM'
                                 MMMMMM
                                  MMMM
                                   MM                                       */
  #include<bits/stdc++.h>
  using namespace std;
  //increase stack size
  #pragma comment(linker, "/STACK:16777216")
  #define M1 1000000007
  #define M2 998244353
  #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define ll long long int
  #define ull unsigned long long int
  #define eb emplace_back
  #define mkp make_pair
  #define setbits(x)          __builtin_popcount(x)
  #define zrobits(x)          __builtin_ctzll(x)
  #define lftbit(x)           x ? 64 - __builtin_clzll(x) : -inf;
  #define test(t) while(t--)
  #define PI  acos(-1.0)
  #define F first
  #define S second
  #define coutd(x) cout << fixed << setprecision(x)
  #define all(v) v.begin(),v.end()
  #define rall(v) v.rbegin(),v.rend()
  #define NL cout<<'\n';
  #define endl '\n'
  #define sz(x)       (int)x.size()
  #define clr(x) memset(x, 0, sizeof(x))
  #define deb(x) cout << #x << "=" << x << endl;
  #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl;
  #define deb3(x, y, z) cout << #x << "=" << x << "," << #y << "=" << y << ","<<#z<<"="<<z<<endl;
  #define loop(a,b) for(int i=a;i<b;i++)
  #define loope(a,b) for(int i=a;i<=b;i++)
  #define pv(v) for(auto i:v) cout<<i<<" "; cout<<endl;
  #define pv1(v) for(int i=1;i<sz(v);i++) cout<<v[i]<<" "; cout<<endl;
  #define read(v) for(int i=0;i<sz(v);i++) cin>>v[i];
  #define read1(v) for(int i=1;i<sz(v);i++) cin>>v[i];
  typedef pair<int, int>  pii;
  typedef pair<ll, ll>    pl;
  typedef vector<int>     vi;
  typedef vector<ll>      vl;
  typedef vector<pii>     vpii;
  typedef vector<pl>      vpl;
  typedef vector<vi>      vvi;
  typedef vector<vl>      vvl;
  const int64_t INF = 1e9;
  mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
  void printTime(clock_t begin)
  {
      printf("%.3lf seconds\n", (double) (clock() - begin) / CLOCKS_PER_SEC);

  }
  ll toint(const string &s) {stringstream ss; ss << s; ll x; ss >> x; return x;}

  string tostring ( ll number ){stringstream ss; ss<< number; return ss.str();}

  template<typename T>
  T toIntegralType(const string &str) {
      static_assert(is_integral<T>::value, "Integral type required.");
      T ret;
      stringstream ss(str);
      ss >> ret;
      if ( to_string(ret) != str)
          throw invalid_argument("Can't convert " + str);
      return ret;
  }
  bool is_prime(int n)
  {
      if(n<2) return 0;
      for(int i=2;i*i<=n;i++) if(n%i==0)  return 0;
      return 1;
  }
  bool sortbysec(const pair<string,int> &a,
                const pair<string,int> &b)
  {
      return (a.second > b.second);
  }
  ll fast_power(ll a,ll x)
  {
      if(x==0) return 1;
      else if(x==1) return a;
      else { ll R = fast_power(a,x>>1);
      if(!(x&1)) return R*R;
      else return R*a*R; }
  }
  ll nc2(ll n){ return n*(n-1)/2ll; }

 void solve()
{
    int n;cin>>n; double a; cin>>a;
    if(n==3)cout<<"1 2 3";
    else {
            double s=((n-2)*180.0)/n;
            if(abs(a-s)<abs((s/2.0)-a))
            {
                cout<<"1 2 3";
            }
            else
            {
              cout<<"1 3 2";
            }
    }
}
  int32_t main()
  {
     fio;
     // #ifndef ONLINE_JUDGE
     // freopen("input.txt","r",stdin);
     // freopen("output.txt","w",sdout);
     srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    // clock_t begin = clock();
     int t=1;
     //cin>>t;
     test(t)
     {
          solve(); NL
          //printTime(begin);
     }
  }


/*
  █▀ █░█ █▀█ █▀▀ █▄█ ▄▀█ █▀ █░█   █░█░█ ▄▀█ █▀   █░█ █▀▀ █▀█ █▀▀
  ▄█ █▀█ █▀▄ ██▄ ░█░ █▀█ ▄█ █▀█   ▀▄▀▄▀ █▀█ ▄█   █▀█ ██▄ █▀▄ ██▄*//*

MMMMMMMMMMMMMMMMMMMMM.                             MMMMMMMMMMMMMMMMMMMMM
  `MMMMMMMMMMMMMMMMMMM           M\  /M           MMMMMMMMMMMMMMMMMMM'
    `MMMMMMMMMMMMMMMMMM          MMMMMM          MMMMMMMMMMMMMMMMMM'
      MMMMMMMMMMMMMMMMMM-_______MMMMMMMM_______-MMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
        MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
     .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
                   `MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM'
                          `MMMMMMMMMMMMMMMMMM'
                              `MMMMMMMMMM'
                                 MMMMMM
                                  MMMM
                                   MM                                       */
  #include<bits/stdc++.h>
  using namespace std;
  //increase stack size
  #pragma comment(linker, "/STACK:16777216")
  #define M1 1000000007
  #define M2 998244353
  #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define ll long long int
  #define ull unsigned long long int
  #define eb emplace_back
  #define mkp make_pair
  #define setbits(x)          __builtin_popcount(x)
  #define zrobits(x)          __builtin_ctzll(x)
  #define lftbit(x)           x ? 64 - __builtin_clzll(x) : -inf;
  #define test(t) while(t--)
  #define PI  acos(-1.0)
  #define F first
  #define S second
  #define coutd(x) cout << fixed << setprecision(x)
  #define all(v) v.begin(),v.end()
  #define rall(v) v.rbegin(),v.rend()
  #define NL cout<<'\n';
  #define endl '\n'
  #define sz(x)       (int)x.size()
  #define clr(x) memset(x, 0, sizeof(x))
  #define deb(x) cout << #x << "=" << x << endl;
  #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl;
  #define deb3(x, y, z) cout << #x << "=" << x << "," << #y << "=" << y << ","<<#z<<"="<<z<<endl;
  #define loop(a,b) for(int i=a;i<b;i++)
  #define loope(a,b) for(int i=a;i<=b;i++)
  #define pv(v) for(auto i:v) cout<<i<<" "; cout<<endl;
  #define pv1(v) for(int i=1;i<sz(v);i++) cout<<v[i]<<" "; cout<<endl;
  #define read(v) for(int i=0;i<sz(v);i++) cin>>v[i];
  #define read1(v) for(int i=1;i<sz(v);i++) cin>>v[i];
  typedef pair<int, int>  pii;
  typedef pair<ll, ll>    pl;
  typedef vector<int>     vi;
  typedef vector<ll>      vl;
  typedef vector<pii>     vpii;
  typedef vector<pl>      vpl;
  typedef vector<vi>      vvi;
  typedef vector<vl>      vvl;
  const int64_t INF = 1e9;
  mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
  void printTime(clock_t begin)
  {
      printf("%.3lf seconds\n", (double) (clock() - begin) / CLOCKS_PER_SEC);

  }
  ll toint(const string &s) {stringstream ss; ss << s; ll x; ss >> x; return x;}

  string tostring ( ll number ){stringstream ss; ss<< number; return ss.str();}

  template<typename T>
  T toIntegralType(const string &str) {
      static_assert(is_integral<T>::value, "Integral type required.");
      T ret;
      stringstream ss(str);
      ss >> ret;
      if ( to_string(ret) != str)
          throw invalid_argument("Can't convert " + str);
      return ret;
  }
  bool is_prime(int n)
  {
      if(n<2) return 0;
      for(int i=2;i*i<=n;i++) if(n%i==0)  return 0;
      return 1;
  }
  bool sortbysec(const pair<string,int> &a,
                const pair<string,int> &b)
  {
      return (a.second > b.second);
  }
  ll fast_power(ll a,ll x)
  {
      if(x==0) return 1;
      else if(x==1) return a;
      else { ll R = fast_power(a,x>>1);
      if(!(x&1)) return R*R;
      else return R*a*R; }
  }
  ll nc2(ll n){ return n*(n-1)/2ll; }

 void solve()
{
  int n,a; cin>>n>>a;
  double angle=((n-2)*180)/n;
  if(n==3){cout<<"1 2 3"; return;}
  double x=angle/(n-2); //deb2(angle,x)
  double mini=INT_MAX; int index=0;
  for(int i=0;i<=n-3;i++)
  {
      if( abs((x*i*1.0)-a) <mini)
      {
          mini=abs(x*i*1.0-a); index=i;
      }
  }
  //deb2(mini,index)
  cout<<"1 2 "<<max(index,3);
}
  int32_t main()
  {
     fio;
     // #ifndef ONLINE_JUDGE
     // freopen("input.txt","r",stdin);
     // freopen("output.txt","w",sdout);
     srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    // clock_t begin = clock();
     int t=1;
     //cin>>t;
     test(t)
     {
          solve(); NL
          //printTime(begin);
     }
  }


/*
  █▀ █░█ █▀█ █▀▀ █▄█ ▄▀█ █▀ █░█   █░█░█ ▄▀█ █▀   █░█ █▀▀ █▀█ █▀▀
  ▄█ █▀█ █▀▄ ██▄ ░█░ █▀█ ▄█ █▀█   ▀▄▀▄▀ █▀█ ▄█   █▀█ ██▄ █▀▄ ██▄*//*

MMMMMMMMMMMMMMMMMMMMM.                             MMMMMMMMMMMMMMMMMMMMM
  `MMMMMMMMMMMMMMMMMMM           M\  /M           MMMMMMMMMMMMMMMMMMM'
    `MMMMMMMMMMMMMMMMMM          MMMMMM          MMMMMMMMMMMMMMMMMM'
      MMMMMMMMMMMMMMMMMM-_______MMMMMMMM_______-MMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
        MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
     .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
                   `MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM'
                          `MMMMMMMMMMMMMMMMMM'
                              `MMMMMMMMMM'
                                 MMMMMM
                                  MMMM
                                   MM                                       */
  #include<bits/stdc++.h>
  using namespace std;
  //increase stack size
  #pragma comment(linker, "/STACK:16777216")
  #define M1 1000000007
  #define M2 998244353
  #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define ll long long int
  #define ull unsigned long long int
  #define eb emplace_back
  #define mkp make_pair
  #define setbits(x)          __builtin_popcount(x)
  #define zrobits(x)          __builtin_ctzll(x)
  #define lftbit(x)           x ? 64 - __builtin_clzll(x) : -inf;
  #define test(t) while(t--)
  #define PI  acos(-1.0)
  #define F first
  #define S second
  #define coutd(x) cout << fixed << setprecision(x)
  #define all(v) v.begin(),v.end()
  #define rall(v) v.rbegin(),v.rend()
  #define NL cout<<'\n';
  #define endl '\n'
  #define sz(x)       (int)x.size()
  #define clr(x) memset(x, 0, sizeof(x))
  #define deb(x) cout << #x << "=" << x << endl;
  #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl;
  #define deb3(x, y, z) cout << #x << "=" << x << "," << #y << "=" << y << ","<<#z<<"="<<z<<endl;
  #define loop(a,b) for(int i=a;i<b;i++)
  #define loope(a,b) for(int i=a;i<=b;i++)
  #define pv(v) for(auto i:v) cout<<i<<" "; cout<<endl;
  #define pv1(v) for(int i=1;i<sz(v);i++) cout<<v[i]<<" "; cout<<endl;
  #define read(v) for(int i=0;i<sz(v);i++) cin>>v[i];
  #define read1(v) for(int i=1;i<sz(v);i++) cin>>v[i];
  typedef pair<int, int>  pii;
  typedef pair<ll, ll>    pl;
  typedef vector<int>     vi;
  typedef vector<ll>      vl;
  typedef vector<pii>     vpii;
  typedef vector<pl>      vpl;
  typedef vector<vi>      vvi;
  typedef vector<vl>      vvl;
  const int64_t INF = 1e9;
  mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
  void printTime(clock_t begin)
  {
      printf("%.3lf seconds\n", (double) (clock() - begin) / CLOCKS_PER_SEC);

  }
  ll toint(const string &s) {stringstream ss; ss << s; ll x; ss >> x; return x;}

  string tostring ( ll number ){stringstream ss; ss<< number; return ss.str();}

  template<typename T>
  T toIntegralType(const string &str) {
      static_assert(is_integral<T>::value, "Integral type required.");
      T ret;
      stringstream ss(str);
      ss >> ret;
      if ( to_string(ret) != str)
          throw invalid_argument("Can't convert " + str);
      return ret;
  }
  bool is_prime(int n)
  {
      if(n<2) return 0;
      for(int i=2;i*i<=n;i++) if(n%i==0)  return 0;
      return 1;
  }
  bool sortbysec(const pair<string,int> &a,
                const pair<string,int> &b)
  {
      return (a.second > b.second);
  }
  ll fast_power(ll a,ll x)
  {
      if(x==0) return 1;
      else if(x==1) return a;
      else { ll R = fast_power(a,x>>1);
      if(!(x&1)) return R*R;
      else return R*a*R; }
  }
  ll nc2(ll n){ return n*(n-1)/2ll; }

 void solve()
{
  int n,a; cin>>n>>a;
  double angle=((n-2)*180)/n;
  if(n==3){cout<<"1 2 3"; return;}
  double x=angle/(n-2); //deb2(angle,x)
  double mini=INT_MAX; int index=0;
  for(int i=0;i<=n-3;i++)
  {
      if( abs((x*i*1.0)-a) <mini)
      {
          mini=abs(x*i*1.0-a); index=i;
      }
  }
  //deb2(mini,index)
  cout<<"1 2 "<<index;
}
  int32_t main()
  {
     fio;
     // #ifndef ONLINE_JUDGE
     // freopen("input.txt","r",stdin);
     // freopen("output.txt","w",sdout);
     srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    // clock_t begin = clock();
     int t=1;
     //cin>>t;
     test(t)
     {
          solve(); NL
          //printTime(begin);
     }
  }


/*
  █▀ █░█ █▀█ █▀▀ █▄█ ▄▀█ █▀ █░█   █░█░█ ▄▀█ █▀   █░█ █▀▀ █▀█ █▀▀
  ▄█ █▀█ █▀▄ ██▄ ░█░ █▀█ ▄█ █▀█   ▀▄▀▄▀ █▀█ ▄█   █▀█ ██▄ █▀▄ ██▄*//*

MMMMMMMMMMMMMMMMMMMMM.                             MMMMMMMMMMMMMMMMMMMMM
  `MMMMMMMMMMMMMMMMMMM           M\  /M           MMMMMMMMMMMMMMMMMMM'
    `MMMMMMMMMMMMMMMMMM          MMMMMM          MMMMMMMMMMMMMMMMMM'
      MMMMMMMMMMMMMMMMMM-_______MMMMMMMM_______-MMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
        MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
     .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
                   `MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM'
                          `MMMMMMMMMMMMMMMMMM'
                              `MMMMMMMMMM'
                                 MMMMMM
                                  MMMM
                                   MM                                       */
  #include<bits/stdc++.h>
  using namespace std;
  //increase stack size
  #pragma comment(linker, "/STACK:16777216")
  #define M1 1000000007
  #define M2 998244353
  #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define ll long long int
  #define ull unsigned long long int
  #define eb emplace_back
  #define mkp make_pair
  #define setbits(x)          __builtin_popcount(x)
  #define zrobits(x)          __builtin_ctzll(x)
  #define lftbit(x)           x ? 64 - __builtin_clzll(x) : -inf;
  #define test(t) while(t--)
  #define PI  acos(-1.0)
  #define F first
  #define S second
  #define coutd(x) cout << fixed << setprecision(x)
  #define all(v) v.begin(),v.end()
  #define rall(v) v.rbegin(),v.rend()
  #define NL cout<<'\n';
  #define endl '\n'
  #define sz(x)       (int)x.size()
  #define clr(x) memset(x, 0, sizeof(x))
  #define deb(x) cout << #x << "=" << x << endl;
  #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl;
  #define deb3(x, y, z) cout << #x << "=" << x << "," << #y << "=" << y << ","<<#z<<"="<<z<<endl;
  #define loop(a,b) for(int i=a;i<b;i++)
  #define loope(a,b) for(int i=a;i<=b;i++)
  #define pv(v) for(auto i:v) cout<<i<<" "; cout<<endl;
  #define pv1(v) for(int i=1;i<sz(v);i++) cout<<v[i]<<" "; cout<<endl;
  #define read(v) for(int i=0;i<sz(v);i++) cin>>v[i];
  #define read1(v) for(int i=1;i<sz(v);i++) cin>>v[i];
  typedef pair<int, int>  pii;
  typedef pair<ll, ll>    pl;
  typedef vector<int>     vi;
  typedef vector<ll>      vl;
  typedef vector<pii>     vpii;
  typedef vector<pl>      vpl;
  typedef vector<vi>      vvi;
  typedef vector<vl>      vvl;
  const int64_t INF = 1e9;
  mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
  void printTime(clock_t begin)
  {
      printf("%.3lf seconds\n", (double) (clock() - begin) / CLOCKS_PER_SEC);

  }
  ll toint(const string &s) {stringstream ss; ss << s; ll x; ss >> x; return x;}

  string tostring ( ll number ){stringstream ss; ss<< number; return ss.str();}

  template<typename T>
  T toIntegralType(const string &str) {
      static_assert(is_integral<T>::value, "Integral type required.");
      T ret;
      stringstream ss(str);
      ss >> ret;
      if ( to_string(ret) != str)
          throw invalid_argument("Can't convert " + str);
      return ret;
  }
  bool is_prime(int n)
  {
      if(n<2) return 0;
      for(int i=2;i*i<=n;i++) if(n%i==0)  return 0;
      return 1;
  }
  bool sortbysec(const pair<string,int> &a,
                const pair<string,int> &b)
  {
      return (a.second > b.second);
  }
  ll fast_power(ll a,ll x)
  {
      if(x==0) return 1;
      else if(x==1) return a;
      else { ll R = fast_power(a,x>>1);
      if(!(x&1)) return R*R;
      else return R*a*R; }
  }
  ll nc2(ll n){ return n*(n-1)/2ll; }

 void solve()
{
    int n,a;cin>>n>>a;
    if(n==3)cout<<"1 2 3";
    else {
            int s=360/n;
            if(abs(a-s)<abs((s/2)-a))
            {
                cout<<"1 2 3";
            }
            else
            {
              cout<<"1 3 2";
            }
    }
}
  int32_t main()
  {
     fio;
     // #ifndef ONLINE_JUDGE
     // freopen("input.txt","r",stdin);
     // freopen("output.txt","w",sdout);
     srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    // clock_t begin = clock();
     int t=1;
     //cin>>t;
     test(t)
     {
          solve(); NL
          //printTime(begin);
     }
  }


/*
  █▀ █░█ █▀█ █▀▀ █▄█ ▄▀█ █▀ █░█   █░█░█ ▄▀█ █▀   █░█ █▀▀ █▀█ █▀▀
  ▄█ █▀█ █▀▄ ██▄ ░█░ █▀█ ▄█ █▀█   ▀▄▀▄▀ █▀█ ▄█   █▀█ ██▄ █▀▄ ██▄*//*

MMMMMMMMMMMMMMMMMMMMM.                             MMMMMMMMMMMMMMMMMMMMM
  `MMMMMMMMMMMMMMMMMMM           M\  /M           MMMMMMMMMMMMMMMMMMM'
    `MMMMMMMMMMMMMMMMMM          MMMMMM          MMMMMMMMMMMMMMMMMM'
      MMMMMMMMMMMMMMMMMM-_______MMMMMMMM_______-MMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
        MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
     .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
                   `MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM'
                          `MMMMMMMMMMMMMMMMMM'
                              `MMMMMMMMMM'
                                 MMMMMM
                                  MMMM
                                   MM                                       */
  #include<bits/stdc++.h>
  using namespace std;
  //increase stack size
  #pragma comment(linker, "/STACK:16777216")
  #define M1 1000000007
  #define M2 998244353
  #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define ll long long int
  #define ull unsigned long long int
  #define eb emplace_back
  #define mkp make_pair
  #define setbits(x)          __builtin_popcount(x)
  #define zrobits(x)          __builtin_ctzll(x)
  #define lftbit(x)           x ? 64 - __builtin_clzll(x) : -inf;
  #define test(t) while(t--)
  #define PI  acos(-1.0)
  #define F first
  #define S second
  #define coutd(x) cout << fixed << setprecision(x)
  #define all(v) v.begin(),v.end()
  #define rall(v) v.rbegin(),v.rend()
  #define NL cout<<'\n';
  #define endl '\n'
  #define sz(x)       (int)x.size()
  #define clr(x) memset(x, 0, sizeof(x))
  #define deb(x) cout << #x << "=" << x << endl;
  #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl;
  #define deb3(x, y, z) cout << #x << "=" << x << "," << #y << "=" << y << ","<<#z<<"="<<z<<endl;
  #define loop(a,b) for(int i=a;i<b;i++)
  #define loope(a,b) for(int i=a;i<=b;i++)
  #define pv(v) for(auto i:v) cout<<i<<" "; cout<<endl;
  #define pv1(v) for(int i=1;i<sz(v);i++) cout<<v[i]<<" "; cout<<endl;
  #define read(v) for(int i=0;i<sz(v);i++) cin>>v[i];
  #define read1(v) for(int i=1;i<sz(v);i++) cin>>v[i];
  typedef pair<int, int>  pii;
  typedef pair<ll, ll>    pl;
  typedef vector<int>     vi;
  typedef vector<ll>      vl;
  typedef vector<pii>     vpii;
  typedef vector<pl>      vpl;
  typedef vector<vi>      vvi;
  typedef vector<vl>      vvl;
  const int64_t INF = 1e9;
  mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
  void printTime(clock_t begin)
  {
      printf("%.3lf seconds\n", (double) (clock() - begin) / CLOCKS_PER_SEC);

  }
  ll toint(const string &s) {stringstream ss; ss << s; ll x; ss >> x; return x;}

  string tostring ( ll number ){stringstream ss; ss<< number; return ss.str();}

  template<typename T>
  T toIntegralType(const string &str) {
      static_assert(is_integral<T>::value, "Integral type required.");
      T ret;
      stringstream ss(str);
      ss >> ret;
      if ( to_string(ret) != str)
          throw invalid_argument("Can't convert " + str);
      return ret;
  }
  bool is_prime(int n)
  {
      if(n<2) return 0;
      for(int i=2;i*i<=n;i++) if(n%i==0)  return 0;
      return 1;
  }
  bool sortbysec(const pair<string,int> &a,
                const pair<string,int> &b)
  {
      return (a.second > b.second);
  }
  ll fast_power(ll a,ll x)
  {
      if(x==0) return 1;
      else if(x==1) return a;
      else { ll R = fast_power(a,x>>1);
      if(!(x&1)) return R*R;
      else return R*a*R; }
  }
  ll nc2(ll n){ return n*(n-1)/2ll; }

 void solve()
{
  int n,a; cin>>n>>a;
  double angle=((n-2)*180)/n;
  if(n==3){cout<<"1 2 3"; return;}
  double x=(double)180/n; //deb2(angle,x)
  double mini=INT_MAX; int index=0;
  for(int i=n;i>=3;i--)
  {
      double new_angle=x*(n-i+1)*1.0;
      //deb(new_angle)
      if( abs(new_angle-a) <mini)
      {
          //cout<<"chala"<<endl;
          mini=abs(new_angle-a); index=i;
      }
  }
  //deb2(mini,index)
  cout<<"1 2 "<<max(index,3);
}
  int32_t main()
  {
     fio;
     // #ifndef ONLINE_JUDGE
     // freopen("input.txt","r",stdin);
     // freopen("output.txt","w",sdout);
     srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    // clock_t begin = clock();
     int t=1;
     //cin>>t;
     test(t)
     {
          solve(); NL
          //printTime(begin);
     }
  }


/*
  █▀ █░█ █▀█ █▀▀ █▄█ ▄▀█ █▀ █░█   █░█░█ ▄▀█ █▀   █░█ █▀▀ █▀█ █▀▀
  ▄█ █▀█ █▀▄ ██▄ ░█░ █▀█ ▄█ █▀█   ▀▄▀▄▀ █▀█ ▄█   █▀█ ██▄ █▀▄ ██▄*//*

MMMMMMMMMMMMMMMMMMMMM.                             MMMMMMMMMMMMMMMMMMMMM
  `MMMMMMMMMMMMMMMMMMM           M\  /M           MMMMMMMMMMMMMMMMMMM'
    `MMMMMMMMMMMMMMMMMM          MMMMMM          MMMMMMMMMMMMMMMMMM'
      MMMMMMMMMMMMMMMMMM-_______MMMMMMMM_______-MMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
        MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
     .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
                   `MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM'
                          `MMMMMMMMMMMMMMMMMM'
                              `MMMMMMMMMM'
                                 MMMMMM
                                  MMMM
                                   MM                                       */
  #include<bits/stdc++.h>
  using namespace std;
  //increase stack size
  #pragma comment(linker, "/STACK:16777216")
  #define M1 1000000007
  #define M2 998244353
  #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define ll long long int
  #define ull unsigned long long int
  #define eb emplace_back
  #define mkp make_pair
  #define setbits(x)          __builtin_popcount(x)
  #define zrobits(x)          __builtin_ctzll(x)
  #define lftbit(x)           x ? 64 - __builtin_clzll(x) : -inf;
  #define test(t) while(t--)
  #define PI  acos(-1.0)
  #define F first
  #define S second
  #define coutd(x) cout << fixed << setprecision(x)
  #define all(v) v.begin(),v.end()
  #define rall(v) v.rbegin(),v.rend()
  #define NL cout<<'\n';
  #define endl '\n'
  #define sz(x)       (int)x.size()
  #define clr(x) memset(x, 0, sizeof(x))
  #define deb(x) cout << #x << "=" << x << endl;
  #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl;
  #define deb3(x, y, z) cout << #x << "=" << x << "," << #y << "=" << y << ","<<#z<<"="<<z<<endl;
  #define loop(a,b) for(int i=a;i<b;i++)
  #define loope(a,b) for(int i=a;i<=b;i++)
  #define pv(v) for(auto i:v) cout<<i<<" "; cout<<endl;
  #define pv1(v) for(int i=1;i<sz(v);i++) cout<<v[i]<<" "; cout<<endl;
  #define read(v) for(int i=0;i<sz(v);i++) cin>>v[i];
  #define read1(v) for(int i=1;i<sz(v);i++) cin>>v[i];
  typedef pair<int, int>  pii;
  typedef pair<ll, ll>    pl;
  typedef vector<int>     vi;
  typedef vector<ll>      vl;
  typedef vector<pii>     vpii;
  typedef vector<pl>      vpl;
  typedef vector<vi>      vvi;
  typedef vector<vl>      vvl;
  const int64_t INF = 1e9;
  mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
  void printTime(clock_t begin)
  {
      printf("%.3lf seconds\n", (double) (clock() - begin) / CLOCKS_PER_SEC);

  }
  ll toint(const string &s) {stringstream ss; ss << s; ll x; ss >> x; return x;}

  string tostring ( ll number ){stringstream ss; ss<< number; return ss.str();}

  template<typename T>
  T toIntegralType(const string &str) {
      static_assert(is_integral<T>::value, "Integral type required.");
      T ret;
      stringstream ss(str);
      ss >> ret;
      if ( to_string(ret) != str)
          throw invalid_argument("Can't convert " + str);
      return ret;
  }
  bool is_prime(int n)
  {
      if(n<2) return 0;
      for(int i=2;i*i<=n;i++) if(n%i==0)  return 0;
      return 1;
  }
  bool sortbysec(const pair<string,int> &a,
                const pair<string,int> &b)
  {
      return (a.second > b.second);
  }
  ll fast_power(ll a,ll x)
  {
      if(x==0) return 1;
      else if(x==1) return a;
      else { ll R = fast_power(a,x>>1);
      if(!(x&1)) return R*R;
      else return R*a*R; }
  }
  ll nc2(ll n){ return n*(n-1)/2ll; }

 void solve()
{
    int n;cin>>n; double a; cin>>a;
    if(n==3)cout<<"1 2 3";
    else {
            double s=360/n;
            if(abs(a-s)<abs((s/2.0)-a))
            {
                cout<<"1 2 3";
            }
            else
            {
              cout<<"1 3 2";
            }
    }
}
  int32_t main()
  {
     fio;
     // #ifndef ONLINE_JUDGE
     // freopen("input.txt","r",stdin);
     // freopen("output.txt","w",sdout);
     srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    // clock_t begin = clock();
     int t=1;
     //cin>>t;
     test(t)
     {
          solve(); NL
          //printTime(begin);
     }
  }


/*
  █▀ █░█ █▀█ █▀▀ █▄█ ▄▀█ █▀ █░█   █░█░█ ▄▀█ █▀   █░█ █▀▀ █▀█ █▀▀
  ▄█ █▀█ █▀▄ ██▄ ░█░ █▀█ ▄█ █▀█   ▀▄▀▄▀ █▀█ ▄█   █▀█ ██▄ █▀▄ ██▄*//*

MMMMMMMMMMMMMMMMMMMMM.                             MMMMMMMMMMMMMMMMMMMMM
  `MMMMMMMMMMMMMMMMMMM           M\  /M           MMMMMMMMMMMMMMMMMMM'
    `MMMMMMMMMMMMMMMMMM          MMMMMM          MMMMMMMMMMMMMMMMMM'
      MMMMMMMMMMMMMMMMMM-_______MMMMMMMM_______-MMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
        MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
     .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
                   `MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM'
                          `MMMMMMMMMMMMMMMMMM'
                              `MMMMMMMMMM'
                                 MMMMMM
                                  MMMM
                                   MM                                       */
  #include<bits/stdc++.h>
  using namespace std;
  //increase stack size
  #pragma comment(linker, "/STACK:16777216")
  #define M1 1000000007
  #define M2 998244353
  #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define ll long long int
  #define ull unsigned long long int
  #define eb emplace_back
  #define mkp make_pair
  #define setbits(x)          __builtin_popcount(x)
  #define zrobits(x)          __builtin_ctzll(x)
  #define lftbit(x)           x ? 64 - __builtin_clzll(x) : -inf;
  #define test(t) while(t--)
  #define PI  acos(-1.0)
  #define F first
  #define S second
  #define coutd(x) cout << fixed << setprecision(x)
  #define all(v) v.begin(),v.end()
  #define rall(v) v.rbegin(),v.rend()
  #define NL cout<<'\n';
  #define endl '\n'
  #define sz(x)       (int)x.size()
  #define clr(x) memset(x, 0, sizeof(x))
  #define deb(x) cout << #x << "=" << x << endl;
  #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl;
  #define deb3(x, y, z) cout << #x << "=" << x << "," << #y << "=" << y << ","<<#z<<"="<<z<<endl;
  #define loop(a,b) for(int i=a;i<b;i++)
  #define loope(a,b) for(int i=a;i<=b;i++)
  #define pv(v) for(auto i:v) cout<<i<<" "; cout<<endl;
  #define pv1(v) for(int i=1;i<sz(v);i++) cout<<v[i]<<" "; cout<<endl;
  #define read(v) for(int i=0;i<sz(v);i++) cin>>v[i];
  #define read1(v) for(int i=1;i<sz(v);i++) cin>>v[i];
  typedef pair<int, int>  pii;
  typedef pair<ll, ll>    pl;
  typedef vector<int>     vi;
  typedef vector<ll>      vl;
  typedef vector<pii>     vpii;
  typedef vector<pl>      vpl;
  typedef vector<vi>      vvi;
  typedef vector<vl>      vvl;
  const int64_t INF = 1e9;
  mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
  void printTime(clock_t begin)
  {
      printf("%.3lf seconds\n", (double) (clock() - begin) / CLOCKS_PER_SEC);

  }
  ll toint(const string &s) {stringstream ss; ss << s; ll x; ss >> x; return x;}

  string tostring ( ll number ){stringstream ss; ss<< number; return ss.str();}

  template<typename T>
  T toIntegralType(const string &str) {
      static_assert(is_integral<T>::value, "Integral type required.");
      T ret;
      stringstream ss(str);
      ss >> ret;
      if ( to_string(ret) != str)
          throw invalid_argument("Can't convert " + str);
      return ret;
  }
  bool is_prime(int n)
  {
      if(n<2) return 0;
      for(int i=2;i*i<=n;i++) if(n%i==0)  return 0;
      return 1;
  }
  bool sortbysec(const pair<string,int> &a,
                const pair<string,int> &b)
  {
      return (a.second > b.second);
  }
  ll fast_power(ll a,ll x)
  {
      if(x==0) return 1;
      else if(x==1) return a;
      else { ll R = fast_power(a,x>>1);
      if(!(x&1)) return R*R;
      else return R*a*R; }
  }
  ll nc2(ll n){ return n*(n-1)/2ll; }

 void solve()
{
  int n,a; cin>>n>>a;
  double angle=((n-2)*180)/n;
  if(n==3){cout<<"1 2 3"; return;}
  double x=angle/(n-2); //deb2(angle,x)
  double mini=INT_MAX; int index=0;
  for(int i=n;i>=3;i--)
  {
      double new_angle=x*(n-i+1)*1.0;
      //deb(new_angle)
      if( abs(new_angle-a) <mini)
      {
          //cout<<"chala"<<endl;
          mini=abs(new_angle-a); index=i;
      }
  }
  //deb2(mini,index)
  cout<<"1 2 "<<max(index,3);
}
  int32_t main()
  {
     fio;
     // #ifndef ONLINE_JUDGE
     // freopen("input.txt","r",stdin);
     // freopen("output.txt","w",sdout);
     srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    // clock_t begin = clock();
     int t=1;
     //cin>>t;
     test(t)
     {
          solve(); NL
          //printTime(begin);
     }
  }


/*
  █▀ █░█ █▀█ █▀▀ █▄█ ▄▀█ █▀ █░█   █░█░█ ▄▀█ █▀   █░█ █▀▀ █▀█ █▀▀
  ▄█ █▀█ █▀▄ ██▄ ░█░ █▀█ ▄█ █▀█   ▀▄▀▄▀ █▀█ ▄█   █▀█ ██▄ █▀▄ ██▄*//*

MMMMMMMMMMMMMMMMMMMMM.                             MMMMMMMMMMMMMMMMMMMMM
  `MMMMMMMMMMMMMMMMMMM           M\  /M           MMMMMMMMMMMMMMMMMMM'
    `MMMMMMMMMMMMMMMMMM          MMMMMM          MMMMMMMMMMMMMMMMMM'
      MMMMMMMMMMMMMMMMMM-_______MMMMMMMM_______-MMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
        MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
       MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
     .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
                   `MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM'
                          `MMMMMMMMMMMMMMMMMM'
                              `MMMMMMMMMM'
                                 MMMMMM
                                  MMMM
                                   MM                                       */
  #include<bits/stdc++.h>
  using namespace std;
  //increase stack size
  #pragma comment(linker, "/STACK:16777216")
  #define M1 1000000007
  #define M2 998244353
  #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define ll long long int
  #define ull unsigned long long int
  #define eb emplace_back
  #define mkp make_pair
  #define setbits(x)          __builtin_popcount(x)
  #define zrobits(x)          __builtin_ctzll(x)
  #define lftbit(x)           x ? 64 - __builtin_clzll(x) : -inf;
  #define test(t) while(t--)
  #define PI  acos(-1.0)
  #define F first
  #define S second
  #define coutd(x) cout << fixed << setprecision(x)
  #define all(v) v.begin(),v.end()
  #define rall(v) v.rbegin(),v.rend()
  #define NL cout<<'\n';
  #define endl '\n'
  #define sz(x)       (int)x.size()
  #define clr(x) memset(x, 0, sizeof(x))
  #define deb(x) cout << #x << "=" << x << endl;
  #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl;
  #define deb3(x, y, z) cout << #x << "=" << x << "," << #y << "=" << y << ","<<#z<<"="<<z<<endl;
  #define loop(a,b) for(int i=a;i<b;i++)
  #define loope(a,b) for(int i=a;i<=b;i++)
  #define pv(v) for(auto i:v) cout<<i<<" "; cout<<endl;
  #define pv1(v) for(int i=1;i<sz(v);i++) cout<<v[i]<<" "; cout<<endl;
  #define read(v) for(int i=0;i<sz(v);i++) cin>>v[i];
  #define read1(v) for(int i=1;i<sz(v);i++) cin>>v[i];
  typedef pair<int, int>  pii;
  typedef pair<ll, ll>    pl;
  typedef vector<int>     vi;
  typedef vector<ll>      vl;
  typedef vector<pii>     vpii;
  typedef vector<pl>      vpl;
  typedef vector<vi>      vvi;
  typedef vector<vl>      vvl;
  const int64_t INF = 1e9;
  mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
  void printTime(clock_t begin)
  {
      printf("%.3lf seconds\n", (double) (clock() - begin) / CLOCKS_PER_SEC);

  }
  ll toint(const string &s) {stringstream ss; ss << s; ll x; ss >> x; return x;}

  string tostring ( ll number ){stringstream ss; ss<< number; return ss.str();}

  template<typename T>
  T toIntegralType(const string &str) {
      static_assert(is_integral<T>::value, "Integral type required.");
      T ret;
      stringstream ss(str);
      ss >> ret;
      if ( to_string(ret) != str)
          throw invalid_argument("Can't convert " + str);
      return ret;
  }
  bool is_prime(int n)
  {
      if(n<2) return 0;
      for(int i=2;i*i<=n;i++) if(n%i==0)  return 0;
      return 1;
  }
  bool sortbysec(const pair<string,int> &a,
                const pair<string,int> &b)
  {
      return (a.second > b.second);
  }
  ll fast_power(ll a,ll x)
  {
      if(x==0) return 1;
      else if(x==1) return a;
      else { ll R = fast_power(a,x>>1);
      if(!(x&1)) return R*R;
      else return R*a*R; }
  }
  ll nc2(ll n){ return n*(n-1)/2ll; }

 void solve()
{
  int n,a; cin>>n>>a;
  double angle=((n-2)*180)/n;
  if(n==3){cout<<"1 2 3"; return;}
  double x=angle/(n-2); //deb2(angle,x)
  double mini=abs(angle-a); int index=0;
  for(int i=1;i<=n-3;i++)
  {
      if( abs((x*i*1.0)-a) <mini)
      {
          mini=abs(x*i*1.0-a); index=i;
      }
  }
  //cout<<mini<<" "<<index;
  cout<<"1 2 "<<3+index;
}
  int32_t main()
  {
     fio;
     // #ifndef ONLINE_JUDGE
     // freopen("input.txt","r",stdin);
     // freopen("output.txt","w",sdout);
     srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    // clock_t begin = clock();
     int t=1;
     //cin>>t;
     test(t)
     {
          solve(); NL
          //printTime(begin);
     }
  }


#include<bits/stdc++.h>
#include<map>
#define ll long long
#define u unsigned
#define me(a,x) memset(a,x,sizeof(a))
#define sf scanf
#define pf printf
const int mod=1e9+7;
using namespace std;
const int maxn=2e5+10;
int main()
{
	double n,a,sum,xiao,x;
	sf("%lf %lf",&n,&a);
	sum=(n-2)*180;
	xiao=sum/n/(n-2);
	x=0;
	int ci=0;
//	pf("sum=%lf xiao=%lf\n",sum,xiao);
	while(x<a){
		ci++;
		x+=xiao;
	}
	double y=x-xiao;
	double s1=abs(x-a),s2=abs(y-a);
//	pf("s1=%lf s2=%lf\n",s1,s2);
	if(abs(x-a)>abs(y-a)) ci--;
	if(!ci) ci++;
//	pf("ci=%d\n",ci);
	int v1,v2,v3;
	v1=1,v2=2,v3=2;
	v3+=ci;
	pf("%d %d %d\n",v2,v1,v3);
	return 0;
}


#include<bits/stdc++.h>
#include<map>
#define ll long long
#define u unsigned
#define me(a,x) memset(a,x,sizeof(a))
#define sf scanf
#define pf printf
const int mod=1e9+7;
using namespace std;
const int maxn=2e5+10;
int main()
{
	double n,a,sum,xiao,x;
	sf("%lf %lf",&n,&a);
	sum=(n-2)*180;
	xiao=sum/n/(n-2);
	x=0;
	int ci=0;
//	pf("sum=%lf xiao=%lf\n",sum,xiao);
	while(x<a){
		ci++;
		x+=xiao;
	}
	double y=x-xiao;
	double s1=abs(x-a),s2=abs(y-a);
//	pf("s1=%lf s2=%lf\n",s1,s2);
	if(abs(x-a)>abs(y-a)) ci--;
	if(!ci) ci++;
//	pf("ci=%d\n",ci);
	int v1,v2,v3;
	v1=1,v2=2,v3=2;
	v3+=ci;
	pf("%d %d %d\n",v1,v2,v3);
	return 0;
}


#include<bits/stdc++.h>
#include<map>
#define ll long long
#define u unsigned
#define me(a,x) memset(a,x,sizeof(a))
#define sf scanf
#define pf printf
const int mod=1e9+7;
using namespace std;
const int maxn=2e5+10;
int main()
{
	double n,a,sum,xiao,x;
	sf("%lf %lf",&n,&a);
	sum=(n-2)*180;
	xiao=sum/n/(n-2);
	x=0;
	int ci=0;
//	pf("sum=%lf xiao=%lf\n",sum,xiao);
	while(x<a){
		ci++;
		x+=xiao;
	}
	double y=x-xiao;
	double s1=abs(x-a),s2=abs(y-a);
//	pf("s1=%lf s2=%lf\n",s1,s2);
	if(abs(x-a)>abs(y-a)) ci--;
	if(!ci) ci++;
//	pf("ci=%d\n",ci);
	int v1,v2,v3;
	v1=1,v2=2,v3=2;
	v3+=ci;
	if(v3>n) v3=n;
	pf("%d %d %d\n",v2,v1,v3);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

double calculate_angle(int n, int i, int j, int k)
{

    int x, y;

    if (i < j)
        x = j - i;
    else
        x = j + n - i;
    if (j < k)
        y = k - j;
    else
        y = k + n - j;

    double ang1 = (180 * x) / n;
    double ang2 = (180 * y) / n;

    double ans = 180 - ang1 - ang2;
    return ans;
}

int main()
{
    int n,a,a3 ;
    cin>>n>>a;
    int a1 = 1;
    int a2 = 2;
    int mn=361;
    int angle,ans;
    for (int i=3;i<=n;i++){
    	a3=i;
    	angle=calculate_angle (n, a1, a2, a3);
    	if (mn>abs(angle-a)){
    		mn=abs(angle -a);
    		ans=i;
		}
	}

    cout <<1<<" "<<2<<" "<<ans;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,a,a3 ;
    cin>>n>>a;
    int a1 = 2;
    int a2 = 1,ans;
    double angle, mn=361;
    for (int i=1;i<n-1;i++){
    	a3=i;
    	angle = (180*a3)/n;
    	if (mn>abs(angle-a)){
    		mn=abs(angle -a);
    		ans=i;
		}
	}

    cout <<a1<<" "<<a2<<" "<<ans+2;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,a,a3 ;
    cin>>n>>a;
    int a1 = 2;
    int a2 = 1,ans=n-1;
    double angle, mn=361;
    for (int i=1;i<n-1;i++){
    	a3=i;
    	angle =double(180*a3)/n;
    	if (mn>abs(angle-a)){
    		mn=abs(angle -a);
    		ans=i;
		}
	}

    cout <<a1<<" "<<a2<<" "<<ans+2;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int n, a;
    cin>>n>>a;

    double angle = ((n-2)*180.0) / n;
    int parts = n-2;

    double i=1;
    double x = i/parts;
    double m = abs(a - x*angle);

    while(i != parts +1){
        if (abs(a - x*angle) <= m){
            m = abs(a- x*angle);
        }
        else{
            break;
        }

        i++;
        x= i/parts;
    }

    cout<<1<<' '<<2<<' '<<n+2-i<<endl;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int n, a;

inline bool read() {
	if(!(cin >> n >> a))
		return false;

	return true;
}

inline void solve() {
	int base = n * a / 180;
	base = max(1, min(n - 2, base));

	int bk = base;
	for(int ck = max(1, base - 2); ck <= min(n - 2, base + 2); ck++) {
		if(abs(180 * ck - n * a) < abs(180 * bk - n * a))
			bk = ck;
	}

	cout << 2 << " " << 1 << " " << bk + 2 << endl;
}

int main(){
    read();

    solve();
    return 0;
}


//
//  820B
//

/*
 B. Mister B and Angle in Polygon
 time limit per test: 2 seconds
 memory limit per test: 256 megabytes
 input: standard input
 output: standard output

 On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n sides).

 That's why Mister B decided to use this polygon. Now Mister B must find three distinct vertices v1, v2, v3 such that the angle (where v2 is the vertex of the angle, and v1 and v3 lie on its sides) is as close as possible to a. In other words, the value should be minimum possible.

 If there are many optimal solutions, Mister B should be satisfied with any of them.

 Input
 First and only line contains two space-separated integers n and a (3 ≤ n ≤ 105, 1 ≤ a ≤ 180) — the number of vertices in the polygon and the needed angle, in degrees.

 Output
 Print three space-separated integers: the vertices v1, v2, v3, which form . If there are multiple optimal solutions, print any of them. The vertices are numbered from 1 to n in clockwise order.

 Examples
 input
 3 15
 output
 1 2 3
 input
 4 67
 output
 2 1 3
 input
 4 68
 output
 4 1 2
 Note
 In first sample test vertices of regular triangle can create only angle of 60 degrees, that's why every possible angle is correct.

 Vertices of square can create 45 or 90 degrees angles only. That's why in second sample test the angle of 45 degrees was chosen, since |45 - 67| < |90 - 67|. Other correct answers are: "3 1 2", "3 2 4", "4 2 3", "4 3 1", "1 3 4", "1 4 2", "2 4 1", "4 1 3", "3 1 4", "3 4 2", "2 4 3", "2 3 1", "1 3 2", "1 2 4", "4 2 1".

 In third sample test, on the contrary, the angle of 90 degrees was chosen, since |90 - 68| < |45 - 68|. Other correct answers are: "2 1 4", "3 2 1", "1 2 3", "4 3 2", "2 3 4", "1 4 3", "3 4 1".
 */

#include <iostream>
using namespace std;

#include <cmath>

int main() {
    //cout << "Hello, World!" << endl;
    int n, a;
    cin >> n >> a;
    double theta = (n - 2)*180/n;
    double beta = theta/(n - 2);
    int v = a/beta;
    cout << "2 1 " << v << endl;

    return 0;
}


//
//  820B
//

/*
 B. Mister B and Angle in Polygon
 time limit per test: 2 seconds
 memory limit per test: 256 megabytes
 input: standard input
 output: standard output

 On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n sides).

 That's why Mister B decided to use this polygon. Now Mister B must find three distinct vertices v1, v2, v3 such that the angle (where v2 is the vertex of the angle, and v1 and v3 lie on its sides) is as close as possible to a. In other words, the value should be minimum possible.

 If there are many optimal solutions, Mister B should be satisfied with any of them.

 Input
 First and only line contains two space-separated integers n and a (3 ≤ n ≤ 105, 1 ≤ a ≤ 180) — the number of vertices in the polygon and the needed angle, in degrees.

 Output
 Print three space-separated integers: the vertices v1, v2, v3, which form . If there are multiple optimal solutions, print any of them. The vertices are numbered from 1 to n in clockwise order.

 Examples
 input
 3 15
 output
 1 2 3
 input
 4 67
 output
 2 1 3
 input
 4 68
 output
 4 1 2
 Note
 In first sample test vertices of regular triangle can create only angle of 60 degrees, that's why every possible angle is correct.

 Vertices of square can create 45 or 90 degrees angles only. That's why in second sample test the angle of 45 degrees was chosen, since |45 - 67| < |90 - 67|. Other correct answers are: "3 1 2", "3 2 4", "4 2 3", "4 3 1", "1 3 4", "1 4 2", "2 4 1", "4 1 3", "3 1 4", "3 4 2", "2 4 3", "2 3 1", "1 3 2", "1 2 4", "4 2 1".

 In third sample test, on the contrary, the angle of 90 degrees was chosen, since |90 - 68| < |45 - 68|. Other correct answers are: "2 1 4", "3 2 1", "1 2 3", "4 3 2", "2 3 4", "1 4 3", "3 4 1".
 */

#include <iostream>
using namespace std;

#include <cmath>

int main() {
    //cout << "Hello, World!" << endl;
    int n, a;
    cin >> n >> a;
    double theta = (n - 2)*180.0/n;
    //cout << "theta = " << theta << endl;
    double beta = theta/(n - 2);
    //cout << "beta = " << beta << endl;
    //double thetaD = fabs(theta - a);
    //cout << "thetaD = " << thetaD << endl;
    //double betaD = fabs(beta - a);
    //cout << "betaD = " << betaD << endl;
    double v = a/beta;
    cout << "v = " << v << endl;
    int m = round(v);
    if (m == 0) {
        m = 1;
    }
    if (m == n) {
        m = 1;
    }
    //cout << "m = " << m << endl;
    cout << "2 1 " << m+2 << endl;

    return 0;
}


//
//  820B
//

/*
 B. Mister B and Angle in Polygon
 time limit per test: 2 seconds
 memory limit per test: 256 megabytes
 input: standard input
 output: standard output

 On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n sides).

 That's why Mister B decided to use this polygon. Now Mister B must find three distinct vertices v1, v2, v3 such that the angle (where v2 is the vertex of the angle, and v1 and v3 lie on its sides) is as close as possible to a. In other words, the value should be minimum possible.

 If there are many optimal solutions, Mister B should be satisfied with any of them.

 Input
 First and only line contains two space-separated integers n and a (3 ≤ n ≤ 105, 1 ≤ a ≤ 180) — the number of vertices in the polygon and the needed angle, in degrees.

 Output
 Print three space-separated integers: the vertices v1, v2, v3, which form . If there are multiple optimal solutions, print any of them. The vertices are numbered from 1 to n in clockwise order.

 Examples
 input
 3 15
 output
 1 2 3
 input
 4 67
 output
 2 1 3
 input
 4 68
 output
 4 1 2
 Note
 In first sample test vertices of regular triangle can create only angle of 60 degrees, that's why every possible angle is correct.

 Vertices of square can create 45 or 90 degrees angles only. That's why in second sample test the angle of 45 degrees was chosen, since |45 - 67| < |90 - 67|. Other correct answers are: "3 1 2", "3 2 4", "4 2 3", "4 3 1", "1 3 4", "1 4 2", "2 4 1", "4 1 3", "3 1 4", "3 4 2", "2 4 3", "2 3 1", "1 3 2", "1 2 4", "4 2 1".

 In third sample test, on the contrary, the angle of 90 degrees was chosen, since |90 - 68| < |45 - 68|. Other correct answers are: "2 1 4", "3 2 1", "1 2 3", "4 3 2", "2 3 4", "1 4 3", "3 4 1".
 */

#include <iostream>
using namespace std;

#include <cmath>

int main() {
    cout << "Hello, World!" << endl;
    int n, a;
    cin >> n >> a;
    double theta = (n - 2)*180/n;
    double beta = theta/(n - 2);
    double thetaD = fabs(theta - a);
    double betaD = fabs(beta - a);
    if (thetaD > betaD) {
        cout << "2 1 3" << endl;
    } else {
        cout << "2 1 " << n << endl;
    }

    return 0;
}


//
//  820B
//

/*
 B. Mister B and Angle in Polygon
 time limit per test: 2 seconds
 memory limit per test: 256 megabytes
 input: standard input
 output: standard output

 On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n sides).

 That's why Mister B decided to use this polygon. Now Mister B must find three distinct vertices v1, v2, v3 such that the angle (where v2 is the vertex of the angle, and v1 and v3 lie on its sides) is as close as possible to a. In other words, the value should be minimum possible.

 If there are many optimal solutions, Mister B should be satisfied with any of them.

 Input
 First and only line contains two space-separated integers n and a (3 ≤ n ≤ 105, 1 ≤ a ≤ 180) — the number of vertices in the polygon and the needed angle, in degrees.

 Output
 Print three space-separated integers: the vertices v1, v2, v3, which form . If there are multiple optimal solutions, print any of them. The vertices are numbered from 1 to n in clockwise order.

 Examples
 input
 3 15
 output
 1 2 3
 input
 4 67
 output
 2 1 3
 input
 4 68
 output
 4 1 2
 Note
 In first sample test vertices of regular triangle can create only angle of 60 degrees, that's why every possible angle is correct.

 Vertices of square can create 45 or 90 degrees angles only. That's why in second sample test the angle of 45 degrees was chosen, since |45 - 67| < |90 - 67|. Other correct answers are: "3 1 2", "3 2 4", "4 2 3", "4 3 1", "1 3 4", "1 4 2", "2 4 1", "4 1 3", "3 1 4", "3 4 2", "2 4 3", "2 3 1", "1 3 2", "1 2 4", "4 2 1".

 In third sample test, on the contrary, the angle of 90 degrees was chosen, since |90 - 68| < |45 - 68|. Other correct answers are: "2 1 4", "3 2 1", "1 2 3", "4 3 2", "2 3 4", "1 4 3", "3 4 1".
 */

#include <iostream>
using namespace std;

#include <cmath>

int main() {
    //cout << "Hello, World!" << endl;
    int n, a;
    cin >> n >> a;
    double theta = (n - 2)*180/n;
    double beta = theta/(n - 2);
    double thetaD = fabs(theta - a);
    double betaD = fabs(beta - a);
    int v = a/beta;
    if (thetaD > betaD) {
        cout << "2 1 3" << endl;
    } else {
        cout << "2 1 " << v << endl;
    }

    return 0;
}


//
//  820B
//

/*
 B. Mister B and Angle in Polygon
 time limit per test: 2 seconds
 memory limit per test: 256 megabytes
 input: standard input
 output: standard output

 On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n sides).

 That's why Mister B decided to use this polygon. Now Mister B must find three distinct vertices v1, v2, v3 such that the angle (where v2 is the vertex of the angle, and v1 and v3 lie on its sides) is as close as possible to a. In other words, the value should be minimum possible.

 If there are many optimal solutions, Mister B should be satisfied with any of them.

 Input
 First and only line contains two space-separated integers n and a (3 ≤ n ≤ 105, 1 ≤ a ≤ 180) — the number of vertices in the polygon and the needed angle, in degrees.

 Output
 Print three space-separated integers: the vertices v1, v2, v3, which form . If there are multiple optimal solutions, print any of them. The vertices are numbered from 1 to n in clockwise order.

 Examples
 input
 3 15
 output
 1 2 3
 input
 4 67
 output
 2 1 3
 input
 4 68
 output
 4 1 2
 Note
 In first sample test vertices of regular triangle can create only angle of 60 degrees, that's why every possible angle is correct.

 Vertices of square can create 45 or 90 degrees angles only. That's why in second sample test the angle of 45 degrees was chosen, since |45 - 67| < |90 - 67|. Other correct answers are: "3 1 2", "3 2 4", "4 2 3", "4 3 1", "1 3 4", "1 4 2", "2 4 1", "4 1 3", "3 1 4", "3 4 2", "2 4 3", "2 3 1", "1 3 2", "1 2 4", "4 2 1".

 In third sample test, on the contrary, the angle of 90 degrees was chosen, since |90 - 68| < |45 - 68|. Other correct answers are: "2 1 4", "3 2 1", "1 2 3", "4 3 2", "2 3 4", "1 4 3", "3 4 1".
 */

#include <iostream>
using namespace std;

#include <cmath>

int main() {
    //cout << "Hello, World!" << endl;
    int n, a;
    cin >> n >> a;
    double theta = (n - 2)*180.0/n;
    //cout << "theta = " << theta << endl;
    double beta = theta/(n - 2);
    //cout << "beta = " << beta << endl;
    //double thetaD = fabs(theta - a);
    //cout << "thetaD = " << thetaD << endl;
    //double betaD = fabs(beta - a);
    //cout << "betaD = " << betaD << endl;
    double v = a/beta;
    //cout << "v = " << v << endl;
    int m = round(v);
    if (m == 0) {
        m = 1;
    }
    //cout << "m = " << m << endl;
    cout << "2 1 " << m+2 << endl;

    return 0;
}


//
//  820B
//

/*
 B. Mister B and Angle in Polygon
 time limit per test: 2 seconds
 memory limit per test: 256 megabytes
 input: standard input
 output: standard output

 On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n sides).

 That's why Mister B decided to use this polygon. Now Mister B must find three distinct vertices v1, v2, v3 such that the angle (where v2 is the vertex of the angle, and v1 and v3 lie on its sides) is as close as possible to a. In other words, the value should be minimum possible.

 If there are many optimal solutions, Mister B should be satisfied with any of them.

 Input
 First and only line contains two space-separated integers n and a (3 ≤ n ≤ 105, 1 ≤ a ≤ 180) — the number of vertices in the polygon and the needed angle, in degrees.

 Output
 Print three space-separated integers: the vertices v1, v2, v3, which form . If there are multiple optimal solutions, print any of them. The vertices are numbered from 1 to n in clockwise order.

 Examples
 input
 3 15
 output
 1 2 3
 input
 4 67
 output
 2 1 3
 input
 4 68
 output
 4 1 2
 Note
 In first sample test vertices of regular triangle can create only angle of 60 degrees, that's why every possible angle is correct.

 Vertices of square can create 45 or 90 degrees angles only. That's why in second sample test the angle of 45 degrees was chosen, since |45 - 67| < |90 - 67|. Other correct answers are: "3 1 2", "3 2 4", "4 2 3", "4 3 1", "1 3 4", "1 4 2", "2 4 1", "4 1 3", "3 1 4", "3 4 2", "2 4 3", "2 3 1", "1 3 2", "1 2 4", "4 2 1".

 In third sample test, on the contrary, the angle of 90 degrees was chosen, since |90 - 68| < |45 - 68|. Other correct answers are: "2 1 4", "3 2 1", "1 2 3", "4 3 2", "2 3 4", "1 4 3", "3 4 1".
 */

#include <iostream>
using namespace std;

#include <cmath>
#include <limits>
typedef std::numeric_limits<double> dbl;

int main() {
    //cout << "Hello, World!" << endl;
    int n, a;
    cin >> n >> a;
    long double theta = (n - 2)*180.0/n;
    //cout << "theta = " << theta << endl;
    long double beta = theta/(n - 2);
    //cout << "beta = " << beta << endl;
    long double v = a/beta;
    //cout << "v = " << v << endl;
    int m = round(v);
    if (m == 0) {
        m = 1;
    }
    cout.precision(dbl::max_digits10);
    if (m == n) {
        cout << "2 1 " << m << endl;
    } else if (m > n - 2) {
        cout << "2 1 " << n << endl;
    } else {
        cout << "2 1 " << m + 2 << endl;
    }

    return 0;
}


//
//  820B
//

/*
 B. Mister B and Angle in Polygon
 time limit per test: 2 seconds
 memory limit per test: 256 megabytes
 input: standard input
 output: standard output

 On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n sides).

 That's why Mister B decided to use this polygon. Now Mister B must find three distinct vertices v1, v2, v3 such that the angle (where v2 is the vertex of the angle, and v1 and v3 lie on its sides) is as close as possible to a. In other words, the value should be minimum possible.

 If there are many optimal solutions, Mister B should be satisfied with any of them.

 Input
 First and only line contains two space-separated integers n and a (3 ≤ n ≤ 105, 1 ≤ a ≤ 180) — the number of vertices in the polygon and the needed angle, in degrees.

 Output
 Print three space-separated integers: the vertices v1, v2, v3, which form . If there are multiple optimal solutions, print any of them. The vertices are numbered from 1 to n in clockwise order.

 Examples
 input
 3 15
 output
 1 2 3
 input
 4 67
 output
 2 1 3
 input
 4 68
 output
 4 1 2
 Note
 In first sample test vertices of regular triangle can create only angle of 60 degrees, that's why every possible angle is correct.

 Vertices of square can create 45 or 90 degrees angles only. That's why in second sample test the angle of 45 degrees was chosen, since |45 - 67| < |90 - 67|. Other correct answers are: "3 1 2", "3 2 4", "4 2 3", "4 3 1", "1 3 4", "1 4 2", "2 4 1", "4 1 3", "3 1 4", "3 4 2", "2 4 3", "2 3 1", "1 3 2", "1 2 4", "4 2 1".

 In third sample test, on the contrary, the angle of 90 degrees was chosen, since |90 - 68| < |45 - 68|. Other correct answers are: "2 1 4", "3 2 1", "1 2 3", "4 3 2", "2 3 4", "1 4 3", "3 4 1".
 */

#include <iostream>
using namespace std;

#include <cmath>

int main() {
    //cout << "Hello, World!" << endl;
    int n, a;
    cin >> n >> a;
    double theta = (n - 2)*180.0/n;
    //cout << "theta = " << theta << endl;
    double beta = theta/(n - 2);
    //cout << "beta = " << beta << endl;
    double v = a/beta;
    //cout << "v = " << v << endl;
    int m = round(v);
    if (m == 0) {
        m = 1;
    }
    if (m == n) {
        cout << "2 1 " << m << endl;
    } else {
        cout << "2 1 " << m + 2 << endl;
    }

    return 0;
}


//
//  820B
//

/*
 B. Mister B and Angle in Polygon
 time limit per test: 2 seconds
 memory limit per test: 256 megabytes
 input: standard input
 output: standard output

 On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n sides).

 That's why Mister B decided to use this polygon. Now Mister B must find three distinct vertices v1, v2, v3 such that the angle (where v2 is the vertex of the angle, and v1 and v3 lie on its sides) is as close as possible to a. In other words, the value should be minimum possible.

 If there are many optimal solutions, Mister B should be satisfied with any of them.

 Input
 First and only line contains two space-separated integers n and a (3 ≤ n ≤ 105, 1 ≤ a ≤ 180) — the number of vertices in the polygon and the needed angle, in degrees.

 Output
 Print three space-separated integers: the vertices v1, v2, v3, which form . If there are multiple optimal solutions, print any of them. The vertices are numbered from 1 to n in clockwise order.

 Examples
 input
 3 15
 output
 1 2 3
 input
 4 67
 output
 2 1 3
 input
 4 68
 output
 4 1 2
 Note
 In first sample test vertices of regular triangle can create only angle of 60 degrees, that's why every possible angle is correct.

 Vertices of square can create 45 or 90 degrees angles only. That's why in second sample test the angle of 45 degrees was chosen, since |45 - 67| < |90 - 67|. Other correct answers are: "3 1 2", "3 2 4", "4 2 3", "4 3 1", "1 3 4", "1 4 2", "2 4 1", "4 1 3", "3 1 4", "3 4 2", "2 4 3", "2 3 1", "1 3 2", "1 2 4", "4 2 1".

 In third sample test, on the contrary, the angle of 90 degrees was chosen, since |90 - 68| < |45 - 68|. Other correct answers are: "2 1 4", "3 2 1", "1 2 3", "4 3 2", "2 3 4", "1 4 3", "3 4 1".
 */

#include <iostream>
using namespace std;

#include <cmath>

int main() {
    //cout << "Hello, World!" << endl;
    int n, a;
    cin >> n >> a;
    double theta = (n - 2)*180/n;
    double beta = theta/(n - 2);
    double thetaD = fabs(theta - a);
    double betaD = fabs(beta - a);
    int v = a/beta;
    if (thetaD >= betaD) {
        cout << "2 1 3" << endl;
    } else {
        cout << "2 1 " << v << endl;
    }

    return 0;
}


//
//  820B
//

/*
 B. Mister B and Angle in Polygon
 time limit per test: 2 seconds
 memory limit per test: 256 megabytes
 input: standard input
 output: standard output

 On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n sides).

 That's why Mister B decided to use this polygon. Now Mister B must find three distinct vertices v1, v2, v3 such that the angle (where v2 is the vertex of the angle, and v1 and v3 lie on its sides) is as close as possible to a. In other words, the value should be minimum possible.

 If there are many optimal solutions, Mister B should be satisfied with any of them.

 Input
 First and only line contains two space-separated integers n and a (3 ≤ n ≤ 105, 1 ≤ a ≤ 180) — the number of vertices in the polygon and the needed angle, in degrees.

 Output
 Print three space-separated integers: the vertices v1, v2, v3, which form . If there are multiple optimal solutions, print any of them. The vertices are numbered from 1 to n in clockwise order.

 Examples
 input
 3 15
 output
 1 2 3
 input
 4 67
 output
 2 1 3
 input
 4 68
 output
 4 1 2
 Note
 In first sample test vertices of regular triangle can create only angle of 60 degrees, that's why every possible angle is correct.

 Vertices of square can create 45 or 90 degrees angles only. That's why in second sample test the angle of 45 degrees was chosen, since |45 - 67| < |90 - 67|. Other correct answers are: "3 1 2", "3 2 4", "4 2 3", "4 3 1", "1 3 4", "1 4 2", "2 4 1", "4 1 3", "3 1 4", "3 4 2", "2 4 3", "2 3 1", "1 3 2", "1 2 4", "4 2 1".

 In third sample test, on the contrary, the angle of 90 degrees was chosen, since |90 - 68| < |45 - 68|. Other correct answers are: "2 1 4", "3 2 1", "1 2 3", "4 3 2", "2 3 4", "1 4 3", "3 4 1".
 */

#include <iostream>
using namespace std;

#include <cmath>

int main() {
    //cout << "Hello, World!" << endl;
    int n, a;
    cin >> n >> a;
    double theta = (n - 2)*180.0/n;
    //cout << "theta = " << theta << endl;
    double beta = theta/(n - 2);
    //cout << "beta = " << beta << endl;
    //double thetaD = fabs(theta - a);
    //cout << "thetaD = " << thetaD << endl;
    //double betaD = fabs(beta - a);
    //cout << "betaD = " << betaD << endl;
    double v = a/beta;
    //cout << "v = " << v << endl;
    int m = round(v);
    if (m == 0) {
        m = 1;
    }
    if (m == n) {
        m = 1;
    }
    //cout << "m = " << m << endl;
    cout << "2 1 " << m+2 << endl;

    return 0;
}