#include <bits/stdc++.h>
using namespace std;
const int maxn = 10;
long long mod;
struct Mat {
  long long M[maxn][maxn], n, m;
  Mat(int _n, int _m) { n = _n, m = _m; }
  void clear() { memset(M, 0, sizeof(M)); }
  Mat operator*(const Mat &B) const {
    Mat ans(n, B.m);
    ans.clear();
    for (int k = 1; k <= m; k++)
      for (int i = 1; i <= n; i++) {
        if (M[i][k] == 0) continue;
        for (int j = 1; j <= B.m; j++) {
          if (B.M[k][j] == 0) continue;
          ans.M[i][j] = (ans.M[i][j] + M[i][k] * B.M[k][j] % mod + mod) % mod;
        }
      }
    return ans;
  }
};
Mat matrixfast(Mat a, long long k) {
  Mat res(a.n, a.n);
  res.clear();
  for (int i = 1; i <= a.n; i++) res.M[i][i] = 1;
  while (k) {
    if (k & 1) res = res * a;
    a = a * a;
    k >>= 1;
  }
  return res;
}
int main() {
  long long n, sx, sy, dx, dy, t;
  cin >> n >> sx >> sy >> dx >> dy >> t;
  Mat ans(6, 1);
  ans.clear();
  mod = n;
  ans.M[1][1] = sx - 1;
  ans.M[2][1] = sy - 1;
  ans.M[3][1] = dx;
  ans.M[4][1] = dy;
  ans.M[5][1] = 0;
  ans.M[6][1] = 1;
  Mat tr(6, 6);
  tr.clear();
  tr.M[1][1] = 2;
  tr.M[1][2] = 1;
  tr.M[1][3] = 1;
  tr.M[1][4] = 0;
  tr.M[1][5] = 1;
  tr.M[1][6] = 2;
  tr.M[2][1] = 1;
  tr.M[2][2] = 2;
  tr.M[2][3] = 0;
  tr.M[2][4] = 1;
  tr.M[2][5] = 1;
  tr.M[2][6] = 2;
  tr.M[3][1] = 1;
  tr.M[3][2] = 1;
  tr.M[3][3] = 1;
  tr.M[3][4] = 0;
  tr.M[3][5] = 1;
  tr.M[3][6] = 2;
  tr.M[4][1] = 1;
  tr.M[4][2] = 1;
  tr.M[4][3] = 0;
  tr.M[4][4] = 1;
  tr.M[4][5] = 1;
  tr.M[4][6] = 2;
  tr.M[5][1] = 0;
  tr.M[5][2] = 0;
  tr.M[5][3] = 0;
  tr.M[5][4] = 0;
  tr.M[5][5] = 1;
  tr.M[5][6] = 1;
  tr.M[6][1] = 0;
  tr.M[6][2] = 0;
  tr.M[6][3] = 0;
  tr.M[6][4] = 0;
  tr.M[6][5] = 0;
  tr.M[6][6] = 1;
  ans = matrixfast(tr, t) * ans;
  cout << ans.M[1][1] + 1 << ' ' << ans.M[2][1] + 1 << endl;
}
