# -*- coding: utf-8 -*-

import math

import sys

import itertools

import numpy as np

import functools

import collections

mo = 1000000007

r = range



x, y, z = list(map(int, input().split()))



ret = 0

while not(x % 2 == 1 or y % 2 == 1 or z % 2 == 1):

    ret += 1

    x, y, z = y//2+z//2, z//2+x//2, x//2+y//2

    if ret > 10000:

        ret = -1

        break;



print(ret)
x, y, z = list(map(int, input().split()))



ret = 0

while not(x % 2 == 1 or y % 2 == 1 or z % 2 == 1):

    ret += 1

    x, y, z = y//2+z//2, z//2+x//2, x//2+y//2

    if ret > 10000:

        ret = -1

        break;



print(ret)
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np
import functools
import collections

mo = 1000000007
r = range
x, y, z = list(map(int, input().split()))
ret = 0
while not (x % 2 == 1 or y % 2 == 1 or z % 2 == 1):
    ret += 1
    x, y, z = y // 2 + z // 2, z // 2 + x // 2, x // 2 + y // 2
    if ret > 10000:
        ret = -1
        break
print(ret)

x, y, z = list(map(int, input().split()))
ret = 0
while not (x % 2 == 1 or y % 2 == 1 or z % 2 == 1):
    ret += 1
    x, y, z = y // 2 + z // 2, z // 2 + x // 2, x // 2 + y // 2
    if ret > 10000:
        ret = -1
        break
print(ret)

-# -*- coding: utf-8 -*- -import math -import sys -import itertools -import numpy as np -import functools -import collections - -mo = 1000000007 -r = range