#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
template <class T, class Compare = less<T> >
using MaxHeap = priority_queue<T, vector<T>, Compare>;
template <class T, class Compare = greater<T> >
using MinHeap = priority_queue<T, vector<T>, Compare>;
using llong = long long;
inline uint32_t xorshift32() {
  static uint32_t s = 1719;
  s = s ^ (s << 13);
  s = s ^ (s >> 17);
  s = s ^ (s << 5);
  return s;
}
inline double norm(double a) { return a * a; }
inline double dist(double x1, double y1, double x2, double y2) {
  return sqrt(norm(x1 - x2) + norm(y1 - y2));
}
const int N = (int)(2 * 1e8);
const int M = (int)(2 * 1e8);
llong n, l;
llong t;
double x[3005];
double y[3005];
int a, b, c;
double sumx;
double sumy;
double la, lb, lc;
int main() {
  cin >> n >> l;
  for (int i = 0; i < n; i++) {
    cin >> t;
    x[i] = cos(2.0 * M_PI * t / l);
    y[i] = sin(2.0 * M_PI * t / l);
  }
  double ansx, ansy;
  chrono::system_clock::time_point start, end;
  start = chrono::system_clock::now();
  end = chrono::system_clock::now();
  double elapsed =
      chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
  int cnt = 0;
  while (chrono::duration_cast<chrono::milliseconds>(end - start).count() <
         3980) {
    a = xorshift32() % n;
    b = xorshift32() % n;
    c = xorshift32() % n;
    if (a == b || b == c || c == a) continue;
    la = dist(x[b], y[b], x[c], y[c]);
    lb = dist(x[a], y[a], x[c], y[c]);
    lc = dist(x[a], y[a], x[b], y[b]);
    sumx += (la * x[a] + lb * x[b] + lc * x[c]) / (la + lb + lc);
    sumy += (la * y[a] + lb * y[b] + lc * y[c]) / (la + lb + lc);
    cnt++;
    end = chrono::system_clock::now();
  }
  ansx = sumx / cnt;
  ansy = sumy / cnt;
  printf("%.*lf, %.*lf\n", DBL_DIG, ansx, DBL_DIG, ansy);
  return 0;
}
