#include <bits/stdc++.h>
using namespace std;
long long int n, sx, sy, dx, dy, t;
const int mida = 6;
vector<long long int> operator*(vector<vector<long long int> > m,
                                vector<long long int> v) {
  vector<long long int> r(mida, 0);
  for (int i = 0; i < mida; i++)
    for (int j = 0; j < mida; j++) r[i] = (r[i] + m[i][j] * v[j]) % n;
  return r;
}
vector<vector<long long int> > operator*(vector<vector<long long int> > m1,
                                         vector<vector<long long int> > m2) {
  vector<vector<long long int> > r(mida, vector<long long int>(mida, 0));
  for (int i = 0; i < mida; i++)
    for (int j = 0; j < mida; j++)
      for (int k = 0; k < mida; k++)
        r[i][j] = (r[i][j] + m1[i][k] * m2[k][j]) % n;
  return r;
}
vector<vector<long long int> > eleva(vector<vector<long long int> > b,
                                     long long int e) {
  if (e == 0) {
    vector<vector<long long int> > r(mida, vector<long long int>(mida, 0));
    for (int i = 0; i < mida; i++) r[i][i] = 1;
    return r;
  }
  if (e % 2 == 0) return eleva(b * b, e / 2);
  return b * eleva(b * b, e / 2);
}
int mat[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}};
int main() {
  cin >> n >> sx >> sy >> dx >> dy >> t;
  vector<vector<long long int> > m(mida, vector<long long int>(mida, 0));
  for (int i = 0; i < mida; i++)
    for (int j = 0; j < mida; j++) m[i][j] = mat[i][j];
  vector<long long int> v(mida, 0);
  v[0] = sx % n;
  v[1] = sy % n;
  v[2] = dx % n;
  v[3] = dy % n;
  v[4] = 0;
  v[5] = 1;
  v = eleva(m, t) * v;
  sx = v[0];
  if (sx == 0) sx = n;
  if (sx < 0) sx += n;
  sy = v[1];
  if (sy == 0) sy = n;
  if (sy < 0) sy += n;
  cout << sx << " " << sy << endl;
}
