#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define MOD 1000000007
#define FOR(i,a,b) for (int i = (a);i <= (b);i++)
#define FOD(i,a,b) for (int i = (b);i >= (a);i--)
#define ALL(x) (x).begin(),(x).end()
#define ii pair<int,int>
#define iii pair<int,pair<int,int>>
//const int MOD = 998244353;
const int MAXN = 1e5+7;
ll f[MAXN];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
FOR(i,1,1e4){
f[1] = f[2] = 1;
int j = 3;
while((f[j - 1] + f[j - 2]) % 10000 != 0){
f[j] = f[j - 1] + f[j - 2];
f[j] = f[j] % 10000;
j++;
}
}
return (0^0);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgZmkgZmlyc3QKI2RlZmluZSBzZSBzZWNvbmQKI2RlZmluZSBNT0QgMTAwMDAwMDAwNwojZGVmaW5lIEZPUihpLGEsYikgZm9yIChpbnQgaSA9IChhKTtpIDw9IChiKTtpKyspCiNkZWZpbmUgRk9EKGksYSxiKSBmb3IgKGludCBpID0gKGIpO2kgPj0gKGEpO2ktLSkKI2RlZmluZSBBTEwoeCkgKHgpLmJlZ2luKCksKHgpLmVuZCgpCiNkZWZpbmUgaWkgcGFpcjxpbnQsaW50PgojZGVmaW5lIGlpaSBwYWlyPGludCxwYWlyPGludCxpbnQ+PgovL2NvbnN0IGludCBNT0QgPSA5OTgyNDQzNTM7CmNvbnN0IGludCBNQVhOID0gMWU1Kzc7CmxsIGZbTUFYTl07CmludCBtYWluKCl7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKICAgIGNpbi50aWUoMCk7IGNvdXQudGllKDApOwogICAgRk9SKGksMSwxZTQpewogICAgICAgIGZbMV0gPSBmWzJdID0gMTsKICAgICAgICBpbnQgaiA9IDM7CiAgICAgICAgd2hpbGUoKGZbaiAtIDFdICsgZltqIC0gMl0pICUgMTAwMDAgIT0gMCl7CiAgICAgICAgICAgIGZbal0gPSBmW2ogLSAxXSArIGZbaiAtIDJdOwogICAgICAgICAgICBmW2pdID0gZltqXSAlIDEwMDAwOwogICAgICAgICAgICBqKys7CiAgICAgICAgfQogICAgfQogICAgcmV0dXJuICgwXjApOwp9Cg==