#include <bits/stdc++.h>
using namespace std;
long long mod;
struct matrix {
  vector<vector<long long> > src;
  matrix operator*(matrix &a) const {
    matrix ans;
    ans.src.resize(6, vector<long long>(6, 0));
    for (int i = 0; i < 6; i++)
      for (int j = 0; j < 6; j++)
        for (int k = 0; k < 6; k++)
          ans.src[i][j] += (src[i][k] * a.src[k][j]) % mod,
              ans.src[i][j] %= mod;
    return ans;
  }
};
int main() {
  long long n, sx, sy, dx, dy, t;
  cin >> n >> sx >> sy >> dx >> dy >> t;
  mod = n;
  matrix start;
  start.src.resize(6, vector<long long>(6, 0));
  start.src[0][0] = start.src[0][5] = start.src[2][1] = start.src[1][3] =
      start.src[1][4] = start.src[1][2] = start.src[2][3] = start.src[2][4] =
          start.src[3][1] = start.src[3][3] = start.src[4][2] =
              start.src[4][4] = start.src[5][3] = start.src[5][4] =
                  start.src[5][5] = start.src[5][1] = start.src[5][2] = 1;
  start.src[1][1] = start.src[2][2] = start.src[0][1] = start.src[0][2] =
      start.src[0][3] = start.src[0][4] = 2;
  matrix cur;
  cur.src.resize(6, vector<long long>(6, 0));
  for (int i = 0; i < 6; i++) cur.src[i][i] = 1;
  while (t) {
    if (t % 2 == 1)
      cur = cur * start, t--;
    else
      start = start * start, t /= 2;
  }
  sx--, sy--;
  dx += 100 * n;
  dy += 100 * n;
  dx %= n, dy %= n;
  long long nx = cur.src[0][1] + (cur.src[1][1] * sx) % n +
                 (cur.src[2][1] * sy) % n + (cur.src[3][1] * dx) % n +
                 (cur.src[4][1] * dy) % n;
  nx %= n;
  long long ny = cur.src[0][2] + (cur.src[1][2] * sx) % n +
                 (cur.src[2][2] * sy) % n + (cur.src[3][2] * dx) % n +
                 (cur.src[4][2] * dy) % n;
  ny %= n;
  cout << nx + 1 << " " << ny + 1 << endl;
}
