#include <bits/stdc++.h>
using namespace std;
long long n;
struct mat {
  long long** val;
  mat() {
    val = new long long*[6];
    for (int i = 0; i < 6; i++) {
      val[i] = new long long[6];
      for (int j = 0; j < 6; j++) val[i][j] = 0;
      val[i][i] = 1;
    }
  }
  mat(long long v[6][6]) {
    val = new long long*[6];
    for (int i = 0; i < 6; i++) {
      val[i] = new long long[6];
      for (int j = 0; j < 6; j++) val[i][j] = v[i][j];
    }
  }
  mat operator*(const mat& b) {
    mat ans;
    for (int i = 0; i < 6; i++) {
      for (int j = 0; j < 6; j++) {
        ans.val[i][j] = 0;
        for (int k = 0; k < 6; k++) {
          ans.val[i][j] += (val[i][k] * b.val[k][j]) % n;
          ans.val[i][j] %= n;
        }
      }
    }
    return ans;
  }
  mat& operator=(const mat& b) {
    for (int i = 0; i < 6; i++) {
      for (int j = 0; j < 6; j++) val[i][j] = b.val[i][j];
    }
    return *this;
  }
};
long long rec[6][6] = {{2, 1, 1, 0, 1, 2}, {1, 2, 0, 1, 1, 2},
                       {1, 1, 1, 0, 1, 2}, {1, 1, 0, 1, 1, 2},
                       {0, 0, 0, 0, 1, 1}, {0, 0, 0, 0, 0, 1}};
mat matrec;
mat matexp(long long e) {
  if (e == 0ll) return mat();
  mat tmp = matexp(e / 2ll);
  tmp = (tmp * tmp);
  if (e & 1) return tmp * matrec;
  return tmp;
}
int main() {
  ios::sync_with_stdio(0);
  matrec = mat(rec);
  long long sx, sy, dx, dy, t;
  cin >> n >> sx >> sy >> dx >> dy >> t;
  if (t == 0ll) {
    cout << sx << " " << sy << '\n';
    return 0;
  }
  sx--;
  sy--;
  dx %= n;
  dy %= n;
  while (dx < 0) dx += n;
  while (dy < 0) dy += n;
  long long vec[] = {sx, sy, dx, dy, 0, 1};
  mat ans = matexp(t);
  long long ansx = 0, ansy = 0;
  for (int i = 0; i < 6; i++) {
    ansx += (vec[i] * ans.val[0][i]) % n;
    ansy += (vec[i] * ans.val[1][i]) % n;
    ansx %= n;
    ansy %= n;
  }
  cout << ansx + 1 << " " << ansy + 1 << "\n";
  return 0;
}
