A,B=map(int,input().split()) for n in (A,B+1): if n%3==0: print(n)