#include <bits/stdc++.h>
using namespace std;
long long f(long long n) {
  if (n == 1)
    return 1;
  else {
    return (3 * (f(n - 1) % 1000003)) % 1000003;
  }
}
int main() {
  long long n;
  cin >> n;
  if (n == 0)
    cout << "1";
  else
    cout << (f(n) % (1000003));
  return 0;
}
