class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: D = None
        self.o: E = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: A = None
        self.x: C = None
        self.p: B = None
        self.q: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.txt = txt

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

l = A("l")
b = B("b")
i = C("i")
k = D("k")
d = E("d")
c = B("c")

l.x = i
l.z = i
l.s = k
l.o = d
b.v = c
b.p = c
b.q = c
b.s = l
b.x = i
i.p = b
k.t = i
k.q = i
d.x = i
c.v = b
c.p = b
c.q = b
c.s = l
c.x = i
assert b.s.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: D = None
        self.o: E = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: A = None
        self.x: C = None
        self.p: B = None
        self.q: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.txt = txt

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

l = A("l")
b = B("b")
i = C("i")
k = D("k")
d = E("d")
c = B("c")

l.x = i
l.z = i
l.s = k
l.o = d
b.v = c
b.p = c
b.q = c
b.s = l
b.x = i
i.p = b
k.t = i
k.q = i
d.x = i
c.v = b
c.p = b
c.q = b
c.s = l
c.x = i
assert b.s.o.x.txt == "i"