#include <bits/stdc++.h>
using namespace std;
long long n;
struct mat {
  long long a[4][4];
  mat() {}
  mat(long long x[][4]) {
    for (int i = 0; i < 4; i++)
      for (int k = 0; k < 4; k++) a[i][k] = x[i][k];
  }
  mat operator*(mat ma) {
    mat ret;
    for (int i = 0; i < 4; i++)
      for (int k = 0; k < 4; k++) {
        ret.a[i][k] = 0;
        for (int h = 0; h < 4; h++)
          ret.a[i][k] = (ret.a[i][k] + a[i][h] * ma.a[h][k] % n) % n;
      }
    return ret;
  }
};
mat pw(long long k) {
  long long a[][4] = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};
  long long b[][4] = {
      {6, -10, 6, -1}, {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}};
  mat ret(a), ma(b);
  while (k > 0) {
    if (k & 1) ret = ret * ma;
    k >>= 1;
    ma = ma * ma;
  }
  return ret;
}
int main() {
  long long i, k, x, y, dx, dy, t, a[4], b[4], c[4], d[4];
  scanf("%I64d %I64d %I64d %I64d %I64d %I64d", &n, &x, &y, &dx, &dy, &t);
  x--;
  y--;
  a[0] = x;
  b[0] = y;
  c[0] = ((dx + x + y + 2) % n + n) % n;
  d[0] = ((dy + x + y + 2) % n + n) % n;
  for (i = 1; i < 4; i++) {
    a[i] = (a[i - 1] + c[i - 1]) % n;
    b[i] = (b[i - 1] + d[i - 1]) % n;
    c[i] = (c[i - 1] + a[i] + b[i] + i + 2) % n;
    d[i] = (d[i - 1] + a[i] + b[i] + i + 2) % n;
  }
  if (t <= 3) {
    printf("%I64d %I64d", a[t] + 1, b[t] + 1);
    return 0;
  }
  mat ret = pw(t - 3);
  x = y = 0;
  for (i = 0, k = 3; i < 4; i++, k--) {
    x = (x + ret.a[0][i] * a[k] % n + n) % n;
    y = (y + ret.a[0][i] * b[k] % n + n) % n;
  }
  printf("%I64d %I64d", x + 1, y + 1);
  return 0;
}
