#include <bits/stdc++.h>
using namespace std;
long long n, sx, sy, dx, dy, t;
long long arr[6][6] = {{2, 1, 1, 0, 1, 0}, {1, 2, 0, 1, 1, 0},
                       {1, 1, 1, 0, 1, 0}, {1, 1, 0, 1, 1, 0},
                       {0, 0, 0, 0, 1, 1}, {0, 0, 0, 0, 0, 1}};
long long tmp[6][6];
long long res[6][6];
long long st[6];
long long fixmod(long long val) {
  long long to_ret;
  if (val == 0)
    to_ret = n;
  else if (val < 0)
    to_ret = (n + val) % n;
  else
    to_ret = val;
  return (to_ret - 1) % n + 1;
}
int main() {
  cin >> n >> sx >> sy >> dx >> dy >> t;
  st[0] = sx;
  st[1] = sy;
  st[2] = dx;
  st[3] = dy;
  st[4] = 0;
  st[5] = 1;
  int sz = sizeof(res);
  memset(res, 0, sizeof(res));
  ;
  for (int i = 0; i < (int)(6); ++i) res[i][i] = 1;
  while (t) {
    if (t & 1) {
      for (int i = 0; i < (int)(6); ++i) {
        for (int j = 0; j < (int)(6); ++j) {
          tmp[i][j] = 0;
          for (int k = 0; k < (int)(6); ++k) {
            tmp[i][j] += res[i][k] * arr[k][j];
            tmp[i][j] = fixmod(tmp[i][j]);
          }
        }
      }
      memcpy(res, tmp, sz);
    }
    for (int i = 0; i < (int)(6); ++i) {
      for (int j = 0; j < (int)(6); ++j) {
        tmp[i][j] = 0;
        for (int k = 0; k < (int)(6); ++k) {
          tmp[i][j] += arr[i][k] * arr[k][j];
          tmp[i][j] = fixmod(tmp[i][j]);
        }
      }
    }
    memcpy(arr, tmp, sz);
    t >>= 1;
  }
  for (int i = 0; i < (int)(2); ++i) {
    long long t = 0;
    for (int j = 0; j < (int)(6); ++j) {
      t += (res[i][j] * st[j]);
      t = fixmod(t);
    }
    cout << t << (i == 1 ? '\n' : ' ');
  }
  return 0;
}
