#include <bits/stdc++.h>
using namespace std;
long long n, t, sx, sy, dx, dy;
struct matrix {
  long long a[6][6];
  matrix() {
    for (int i = 0; i < 6; i++)
      for (int j = 0; j < 6; j++) a[i][j] = 0;
  }
};
matrix operator*(matrix a, matrix b) {
  matrix c;
  for (int i = 0; i < 6; i++)
    for (int j = 0; j < 6; j++)
      for (int k = 0; k < 6; k++)
        c.a[i][j] += a.a[i][k] * b.a[k][j], c.a[i][j] %= n;
  return c;
}
int main() {
  matrix a, b;
  scanf("%lld%lld%lld%lld%lld%lld", &n, &sx, &sy, &dx, &dy, &t);
  a.a[0][0] = sx - 1;
  a.a[0][1] = sy - 1;
  a.a[0][2] = dx;
  a.a[0][3] = dy;
  a.a[0][4] = 0;
  a.a[0][5] = 1;
  b.a[0][0] = b.a[1][1] = 2;
  b.a[0][2] = b.a[0][3] = b.a[1][0] = b.a[0][1] = b.a[1][2] = b.a[1][3] =
      b.a[2][0] = b.a[3][1] = b.a[2][2] = b.a[3][3] = 1;
  for (int i = 0; i < 5; i++) b.a[4][i] = 1;
  for (int i = 0; i < 4; i++) b.a[5][i] = 2;
  b.a[5][4] = 1;
  b.a[5][5] = 1;
  while (t) {
    if (t & 1) a = a * b;
    b = b * b;
    t >>= 1;
  }
  printf("%lld %lld\n", (a.a[0][0] + n) % n + 1LL, (a.a[0][1] + n) % n + 1LL);
  return 0;
}
