#include <iostream>
#include <vector>
using namespace std;
vector<int> multiplyArrayByInt(const vector<int> &num) {
int n = num.size();
vector<int> product(n, 0);
int carry = 0;
for (int i = n - 1; i >= 0; i--) {
int digit = num[i] * 2 + carry;
carry = digit / 10;
product[i] = digit%10;
}
if (carry > 0) {
product.insert(product.begin(), carry);
}
return product;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
vector<vector<int>> m(10001);
m[0] = {1};
for (int i = 1; i <= 10000; i++) {
m[i] = multiplyArrayByInt(m[i - 1]);
}
while (cin >> n) {
if (n == 0) {
break;
} else {
for (int digit : m[n]) {
cout << digit;
}
cout << endl;
}
}
return 0;
}
#include
#include
using namespace std;
vector multiplyArrayByInt(const vector &num) {
int n = num.size();
vector product(n, 0);
int carry = 0;
for (int i = n - 1; i >= 0; i--) {
int digit = num[i] * 2 + carry;
carry = digit / 10;
product[i] = digit%10;
}
if (carry > 0) {
product.insert(product.begin(), carry);
}
return product;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
vector> m(10001);
m[0] = {1};for (int i = 1; i <= 10000; i++) {
m[i] = multiplyArrayByInt(m[i - 1]);
}
while (cin >> n) {
if (n == 0) {
break;
} else {
for (int digit : m[n]) {
cout << digit;
}
cout << endl;
}
}return 0;
}