class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: B = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

l = A("l")
b = B("b")
d = C("d")
g = D("g")
f = A("f")
h = C("h")
j = B("j")
k = B("k")
c = C("c")
i = D("i")

l.v = i
l.q = f
l.y = b
b.v = k
d.w = h
d.x = k
g.p = d
g.s = k
g.w = b
g.u = h
f.v = g
f.q = l
f.y = b
h.w = c
h.x = b
j.v = k
k.v = b
c.w = d
c.x = j
i.p = h
i.s = k
i.w = k
i.u = d
assert b.v.v.v.v.v.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: B = None
        self.w: B = None
        self.u: C = None
        self.txt = txt

l = A("l")
b = B("b")
d = C("d")
g = D("g")
f = A("f")
h = C("h")
j = B("j")
k = B("k")
c = C("c")
i = D("i")

l.v = i
l.q = f
l.y = b
b.v = k
d.w = h
d.x = k
g.p = d
g.s = k
g.w = b
g.u = h
f.v = g
f.q = l
f.y = b
h.w = c
h.x = b
j.v = k
k.v = b
c.w = d
c.x = j
i.p = h
i.s = k
i.w = k
i.u = d
assert b.v.v.v.v.v.v.v.v.v.v.txt == "b"