#include <bits/stdc++.h>
using namespace std;
long long n, sx, sy, dx, dy, t, ansx, ansy;
long long a[10][10], f[10][10], ans[10][10], dq[10][10];
int main() {
  scanf("%I64d", &n);
  scanf("%I64d%I64d", &sx, &sy);
  scanf("%I64d%I64d", &dx, &dy);
  scanf("%I64d", &t);
  dx = (dx % n + n) % n;
  dy = (dy % n + n) % n;
  f[1][1] = sx - 1;
  f[1][2] = sy - 1;
  f[1][3] = dx;
  f[1][4] = dy;
  f[1][5] = 0;
  f[1][6] = 1;
  a[1][1] = 2;
  a[1][2] = 1;
  a[1][3] = 1;
  a[1][4] = 1;
  a[1][5] = 0;
  a[1][6] = 0;
  a[2][1] = 1;
  a[2][2] = 2;
  a[2][3] = 1;
  a[2][4] = 1;
  a[2][5] = 0;
  a[2][6] = 0;
  a[3][1] = 1;
  a[3][2] = 0;
  a[3][3] = 1;
  a[3][4] = 0;
  a[3][5] = 0;
  a[3][6] = 0;
  a[4][1] = 0;
  a[4][2] = 1;
  a[4][3] = 0;
  a[4][4] = 1;
  a[4][5] = 0;
  a[4][6] = 0;
  a[5][1] = 1;
  a[5][2] = 1;
  a[5][3] = 1;
  a[5][4] = 1;
  a[5][5] = 1;
  a[5][6] = 0;
  a[6][1] = 2;
  a[6][2] = 2;
  a[6][3] = 2;
  a[6][4] = 2;
  a[6][5] = 1;
  a[6][6] = 1;
  memset(ans, 0, sizeof(ans));
  for (int i = 1; i <= 6; ++i) ans[i][i] = 1;
  while (t != 0) {
    if (t % 2 == 1) {
      memset(dq, 0, sizeof(dq));
      for (int i = 1; i <= 6; ++i)
        for (int j = 1; j <= 6; ++j)
          for (int k = 1; k <= 6; ++k) {
            dq[i][j] = dq[i][j] + (a[i][k] * ans[k][j]);
            dq[i][j] = (dq[i][j] % n + n) % n;
          }
      for (int i = 1; i <= 6; ++i)
        for (int j = 1; j <= 6; ++j) ans[i][j] = dq[i][j];
    }
    memset(dq, 0, sizeof(dq));
    for (int i = 1; i <= 6; ++i)
      for (int j = 1; j <= 6; ++j)
        for (int k = 1; k <= 6; ++k) {
          dq[i][j] = dq[i][j] + (a[i][k] * a[k][j]);
          dq[i][j] = (dq[i][j] % n + n) % n;
        }
    for (int i = 1; i <= 6; ++i)
      for (int j = 1; j <= 6; ++j) a[i][j] = dq[i][j];
    t /= 2;
  }
  memset(dq, 0, sizeof(dq));
  for (int i = 1; i <= 1; ++i)
    for (int j = 1; j <= 6; ++j)
      for (int k = 1; k <= 6; ++k) {
        dq[i][j] = f[i][k] * ans[k][j] + dq[i][j];
        dq[i][j] = (dq[i][j] % n + n) % n;
      }
  ansx = dq[1][1];
  ansy = dq[1][2];
  printf("%I64d %I64d\n", ansx + 1, ansy + 1);
  return 0;
}
