#include using namespace std; #define INF 1000000000 #define MOD 998244353 using ll=long long; using Graph=vector>; int main(){ string S; cin>>S; int N=S.size(); int x; if(N==1){ x=S[0]-'0'; }else{ x=10*(S[N-2]-'0')+(S[N-1]-'0'); } x%=4; if(x==2){ cout<<-1<