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