#include <bits/stdc++.h>
using namespace std;
int n, sx, sy, dx, dy, t;
int a[6][6],
    b[6][6] = {{2, 1, 1, 1, 0, 0}, {1, 2, 1, 1, 0, 0}, {1, 0, 1, 0, 0, 0},
               {0, 1, 0, 1, 0, 0}, {1, 1, 1, 1, 1, 0}, {2, 2, 2, 2, 1, 1}};
inline void mul(int a[6][6], int b[6][6]) {
  int res[6][6];
  memset(res, 0, sizeof res);
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      for (int k = 0; k < 6; k++) {
        res[i][j] += a[i][k] * b[k][j];
        if (j < 5) {
          res[i][j] %= n;
        }
      }
    }
  }
  memcpy(a, res, sizeof res);
}
inline void bpow(int a[6][6], int k) {
  int res[6][6];
  memset(res, 0, sizeof res);
  for (int i = 0; i < 6; i++) {
    res[i][i] = 1;
  }
  while (k) {
    if (k & 1) {
      mul(res, a);
    }
    mul(a, a);
    k >>= 1;
  }
  memcpy(a, res, sizeof res);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> sx >> sy >> dx >> dy >> t;
  sx--, sy--;
  dx %= n, dy %= n;
  dx += n, dy += n;
  dx %= n, dy %= n;
  for (int i = 0; i < 6; i++) {
    a[i][0] = sx, a[i][1] = sy;
    a[i][2] = dx, a[i][3] = dy;
    a[i][4] = 0, a[i][5] = 1;
  }
  bpow(b, t);
  mul(a, b);
  cout << a[0][0] + 1 << ' ' << a[0][1] + 1 << '\n';
}
