#include <bits/stdc++.h>
using namespace std;
long long a[5][5] = {
    {2, 1, 1, 0, 0}, {1, 2, 1, 0, 0},   {1, 1, 1, 0, 0},
    {1, 1, 1, 1, 0}, {-1, -1, 0, 1, 1},
};
long long n, sx, sy, dx, dy, t;
long long tmp[5][5];
void mul(long long a[][5], long long b[][5]) {
  memset(tmp, 0, sizeof tmp);
  for (int i = 0; i < 5; ++i)
    for (int j = 0; j < 5; ++j) {
      tmp[i][j] = 0;
      for (int k = 0; k < 5; ++k) tmp[i][j] += a[i][k] * b[k][j] % n;
      tmp[i][j] %= n;
    }
  for (int i = 0; i < 5; ++i)
    for (int j = 0; j < 5; ++j) a[i][j] = tmp[i][j];
}
long long tp[5][5];
void pow(long long a[][5], long long t) {
  memset(tp, 0, sizeof tp);
  for (int i = 0; i < 5; ++i) tp[i][i] = 1;
  while (t) {
    if (t & 1) mul(tp, a);
    mul(a, a);
    t >>= 1;
  }
}
long long va[5], vb[5];
int main() {
  cin >> n >> sx >> sy >> dx >> dy >> t;
  sx %= n;
  sy %= n;
  dx = (dx % n + n) % n;
  dy = (dy % n + n) % n;
  a[4][0] = dx;
  a[4][1] = dy;
  pow(a, t);
  va[0] = sx, va[1] = sy, va[2] = 0, va[3] = 0, va[4] = 1;
  for (int j = 0; j < 5; ++j) {
    for (int i = 0; i < 5; ++i) {
      vb[j] = (vb[j] + va[i] * tp[i][j] % n) % n;
    }
  }
  if (vb[0] == 0) vb[0] = n;
  if (vb[1] == 0) vb[1] = n;
  cout << vb[0] << " " << vb[1] << endl;
  return 0;
}
