s=k=0N=int(input())while N!=0: K=N%10 s+=k N//=10if s% 2==1: print(1)else: print(2)
48 56
2
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!