#include<bits/stdc++.h>
usingnamespacestd;
constintMAXN=100;
constintX=3;
longlongf[1005];
voidinit(){
f[0]=1;
for(inti=1;i<MAXN;i++){
f[i]=f[i-1]*X;
}
}
inthash(stringnum)
{
intans=0;
for(inti=0;i<num.length();++i)
ans=ans*f[i]+num[i]-'0';
returnans;
}
intconvert(stringnum,charc,intd)
{
intlen=num.length();
inth=hash(num);
return((c-num[d])*f[len-d-1]+h);
}
intmain()
{
freopen("in.in","r",stdin);
init();
cout<<hash("33")<<endl;
cout<<convert("33",'1',0);
return0;
}