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