#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > mul(vector<vector<long long> > a,
                               vector<vector<long long> > b, long long mod) {
  vector<vector<long long> > c(a.size(), vector<long long>(b[0].size()));
  for (int i = 0; i < a.size(); i++) {
    for (int k = 0; k < a[0].size(); k++) {
      for (int j = 0; j < b[0].size(); j++) {
        c[i][j] = (c[i][j] + a[i][k] * b[k][j] % mod) % mod;
      }
    }
  }
  return c;
}
vector<vector<long long> > q_pow(vector<vector<long long> > base, long long n,
                                 long long mod) {
  vector<vector<long long> > ans(base.size(), vector<long long>(base.size()));
  for (int i = 0; i < ans.size(); i++) ans[i][i] = 1;
  while (n) {
    if (n & 1) ans = mul(ans, base, mod);
    base = mul(base, base, mod);
    n >>= 1;
  }
  return ans;
}
int main() {
  long long n, sx, sy, dx, dy, t;
  while (~scanf("%lld%lld%lld%lld%lld%lld", &n, &sx, &sy, &dx, &dy, &t)) {
    sx--;
    sy--;
    vector<vector<long long> > a(6, vector<long long>(6));
    a = {{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}};
    a = q_pow(a, t, n);
    vector<vector<long long> > b(6, vector<long long>(1));
    b[0][0] = sx;
    b[1][0] = sy;
    b[2][0] = (dx % n + n) % n;
    b[3][0] = (dy % n + n) % n;
    b[4][0] = 0;
    b[5][0] = 1;
    a = mul(a, b, n);
    printf("%lld %lld\n", a[0][0] + 1, a[1][0] + 1);
  }
  return 0;
}
