#include <bits/stdc++.h>
using namespace std;
template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()) {
  v.assign(a, vector<T>(b, t));
}
template <class F, class T>
void convert(const F &f, T &t) {
  stringstream ss;
  ss << f;
  ss >> t;
}
void mul(vector<vector<long long> > &a, const vector<vector<long long> > &b,
         long long n) {
  int m = a.size();
  vector<vector<long long> > c;
  initvv(c, m, m);
  for (int j = 0; j < m; ++j)
    for (int k = 0; k < m; ++k)
      for (int i = 0; i < m; ++i) {
        c[i][j] = (c[i][j] + a[i][k] * b[k][j]) % n;
      }
  a.swap(c);
}
void pow(vector<vector<long long> > &x, long long y, long long n) {
  int m = x.size();
  vector<vector<long long> > a;
  initvv(a, m, m);
  for (int i = 0; i < m; ++i) {
    a[i][i] = 1;
  }
  while (y) {
    if (y & 1) {
      mul(a, x, n);
    }
    y >>= 1;
    mul(x, x, n);
  }
  x.swap(a);
}
int main() {
  int ar[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},
  };
  long long n, sx, sy, dx, dy, t;
  cin >> n >> sx >> sy >> dx >> dy >> t;
  vector<long long> v(6);
  v[0] = sx - 1;
  v[1] = sy - 1;
  v[2] = (dx % n + n) % n;
  v[3] = (dy % n + n) % n;
  v[5] = 1;
  vector<vector<long long> > a;
  initvv(a, 6, 6);
  for (int i = 0; i < 6; ++i)
    for (int j = 0; j < 6; ++j) {
      a[i][j] = ar[i][j];
    }
  pow(a, t, n);
  long long ans[6] = {};
  for (int i = 0; i < 6; ++i)
    for (int j = 0; j < 6; ++j) {
      ans[i] = (ans[i] + a[i][j] * v[j]) % n;
    }
  cout << ans[0] + 1 << ' ' << ans[1] + 1 << endl;
}
