#include #define MOD 1000000007 #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef long long ll; typedef vectorvec; typedef vectormat; mat mul(mat&a, mat&b) { mat c(a.size(), vec(b[0].size())); rep(i, a.size())rep(j, b[0].size())rep(k, b.size()) (c[i][j] += a[i][k] * b[k][j]) %= MOD; return c; } mat ppow(mat&a, ll b) { mat res(a.size(), vec(a.size())); rep(i, a.size())res[i][i] = 1; while (b) { if (b & 1)res = mul(res, a); a = mul(a, a); b >>= 1; } return res; } string s[]{ "1","101","10101","1010101","101010101","10101010101","1010101010101","101010101010101","10101010101010101","1010101010101010101","0" }; int main() { ll n; scanf("%lld", &n); mat a{ {100,1},{0,1} }; a = ppow(a, n); cout << a[0][1] << endl; cout << s[(n-1) % 11] << endl; }