#include <bits/stdc++.h>
using namespace std;
void mult(const long long int* a, const long long int* b, long long int* c) {
  for (int r = 0; r < 3; ++r) {
    for (int j = 0; j < 3; ++j) {
      int idx = j * 3 + r;
      c[idx] = 0;
      for (int i = 0; i < 3; ++i) c[idx] += a[i * 3 + r] * b[j * 3 + i];
    }
  }
}
void power(const long long int* m, long long int e, long long int* d) {
  long long int dest[9];
  if (e == 0) {
    memset(d, 0, sizeof(long long int) * 9);
    d[0] = d[4] = d[8] = 1;
  } else if (e & 1) {
    power(m, e - 1, dest);
    mult(dest, m, d);
  } else {
    power(m, e >> 1, dest);
    mult(dest, dest, d);
  }
}
long long int N, M;
int Ax[100000];
int Ay[100000];
int main() {
  while (cin >> N >> M) {
    int Mx, My;
    cin >> Mx >> My;
    for (long long int i = 0; i < N; ++i) {
      cin >> Ax[i] >> Ay[i];
    }
    long long int m[9] = {1, 0, 0, 0, 1, 0, 0, 0, 1};
    for (long long int i = 0; i < N; ++i) {
      long long int mi[9] = {-1, 0, 0, 0, -1, 0, 2 * Ax[i], 2 * Ay[i], 1};
      long long int dest[9];
      mult(mi, m, dest);
      memcpy(m, dest, sizeof(m));
    }
    long long int count = M / N;
    long long int q = M % N;
    long long int p[9] = {1, 0, 0, 0, 1, 0, 0, 0, 1};
    if (count != 0) memcpy(p, m, sizeof(p));
    long long int temp[9];
    power(p, count, temp);
    memcpy(p, temp, sizeof(p));
    long long int T[9];
    memcpy(T, p, sizeof(T));
    for (long long int i = 0; i < q; ++i) {
      long long int dest[9];
      long long int mi[9] = {-1, 0, 0, 0, -1, 0, 2 * Ax[i], 2 * Ay[i], 1};
      mult(mi, T, dest);
      memcpy(T, dest, sizeof(T));
    }
    long long int Rx = T[0] * Mx + T[3] * My + T[6];
    long long int Ry = T[1] * Mx + T[4] * My + T[7];
    cout << Rx << " " << Ry << endl;
  }
  return 0;
}

### Prompt

Your challenge is to write a CPP solution to the following problem:

You are given the following points with integer coordinates on the plane: M0, A0, A1, ..., An - 1, where n is odd number. Now we define the following infinite sequence of points Mi: Mi is symmetric to Mi - 1 according <image> (for every natural number i). Here point B is symmetric to A according M, if M is the center of the line segment AB. Given index j find the point Mj.

Input

On the first line you will be given an integer n (1 ≤ n ≤ 105), which will be odd, and j (1 ≤ j ≤ 1018), where j is the index of the desired point. The next line contains two space separated integers, the coordinates of M0. After that n lines follow, where the i-th line contain the space separated integer coordinates of the point Ai - 1. The absolute values of all input coordinates will not be greater then 1000.

Output

On a single line output the coordinates of Mj, space separated.

Examples

Input

3 4
0 0
1 1
2 3
-5 3


Output

14 0


Input

3 1
5 5
1000 1000
-1000 1000
3 100


Output

1995 1995

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
void mult(const long long int* a, const long long int* b, long long int* c) {
  for (int r = 0; r < 3; ++r) {
    for (int j = 0; j < 3; ++j) {
      int idx = j * 3 + r;
      c[idx] = 0;
      for (int i = 0; i < 3; ++i) c[idx] += a[i * 3 + r] * b[j * 3 + i];
    }
  }
}
void power(const long long int* m, long long int e, long long int* d) {
  long long int dest[9];
  if (e == 0) {
    memset(d, 0, sizeof(long long int) * 9);
    d[0] = d[4] = d[8] = 1;
  } else if (e & 1) {
    power(m, e - 1, dest);
    mult(dest, m, d);
  } else {
    power(m, e >> 1, dest);
    mult(dest, dest, d);
  }
}
long long int N, M;
int Ax[100000];
int Ay[100000];
int main() {
  while (cin >> N >> M) {
    int Mx, My;
    cin >> Mx >> My;
    for (long long int i = 0; i < N; ++i) {
      cin >> Ax[i] >> Ay[i];
    }
    long long int m[9] = {1, 0, 0, 0, 1, 0, 0, 0, 1};
    for (long long int i = 0; i < N; ++i) {
      long long int mi[9] = {-1, 0, 0, 0, -1, 0, 2 * Ax[i], 2 * Ay[i], 1};
      long long int dest[9];
      mult(mi, m, dest);
      memcpy(m, dest, sizeof(m));
    }
    long long int count = M / N;
    long long int q = M % N;
    long long int p[9] = {1, 0, 0, 0, 1, 0, 0, 0, 1};
    if (count != 0) memcpy(p, m, sizeof(p));
    long long int temp[9];
    power(p, count, temp);
    memcpy(p, temp, sizeof(p));
    long long int T[9];
    memcpy(T, p, sizeof(T));
    for (long long int i = 0; i < q; ++i) {
      long long int dest[9];
      long long int mi[9] = {-1, 0, 0, 0, -1, 0, 2 * Ax[i], 2 * Ay[i], 1};
      mult(mi, T, dest);
      memcpy(T, dest, sizeof(T));
    }
    long long int Rx = T[0] * Mx + T[3] * My + T[6];
    long long int Ry = T[1] * Mx + T[4] * My + T[7];
    cout << Rx << " " << Ry << endl;
  }
  return 0;
}

```