local function lltonumber(str) local ret = 0LL for i = 1, #str do ret = ret * 10LL + str:sub(i, i):byte() - 48 end return ret end local a = lltonumber(io.read()) local r = 1LL for i = 1, 128 do r = (r * 2) % a end local ret = tostring(r):gsub("LL", "") print(ret)