#include <bits/stdc++.h>
using namespace std;
long long int base[6][6] = {{2, 1, 1, 1, 0, 0}, {1, 2, 1, 1, 0, 0},
                            {1, 0, 1, 0, 0, 0}, {0, 1, 0, 1, 0, 0},
                            {1, 1, 1, 1, 1, 0}, {0, 0, 0, 0, 1, 1}};
long long int c[6][6];
long long int mod;
void mul(long long int a[6][6], long long int b[6][6]) {
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      c[i][j] = 0;
      for (int k = 0; k < 6; k++) {
        c[i][j] += (a[i][k] * b[k][j]) % mod;
        c[i][j] %= mod;
        c[i][j] += mod;
        c[i][j] %= mod;
      }
    }
  }
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      a[i][j] = c[i][j];
    }
  }
}
void bpow(long long int a[6][6], long long int n) {
  long long int id[6][6];
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      if (i == j)
        id[i][j] = 1;
      else
        id[i][j] = 0;
    }
  }
  while (n > 0) {
    if (n & 1) mul(id, a);
    mul(a, a);
    n /= 2;
  }
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      a[i][j] = id[i][j];
    }
  }
}
int main() {
  long long int n, sx, sy, dx, dy, t;
  cin >> n >> sx >> sy >> dx >> dy >> t;
  mod = n;
  bpow(base, t);
  long long int x = (base[0][0] * sx) % mod + (base[1][0] * sy) % mod +
                    (base[2][0] * dx) % mod + (base[3][0] * dy) % mod +
                    base[5][0];
  long long int y = (base[0][1] * sx) % mod + (base[1][1] * sy) % mod +
                    (base[2][1] * dx) % mod + (base[3][1] * dy) % mod +
                    base[5][1];
  x %= mod;
  y %= mod;
  x += mod;
  y += mod;
  x %= mod;
  y %= mod;
  if (x == 0) x = n;
  if (y == 0) y = n;
  cout << x << " " << y << "\n";
}
