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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: C = None
        self.x: D = None
        self.z: A = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.y: C = None
        self.z: B = None
        self.r: C = None
        self.txt = txt

l = A("l")
m = B("m")
c = C("c")
b = D("b")
j = E("j")
h = D("h")

l.x = c
l.s = j
m.y = b
m.x = b
m.r = c
m.t = c
m.z = l
c.o = l
c.q = j
c.y = j
c.v = h
b.x = h
b.o = m
j.x = c
j.y = c
j.r = c
j.t = h
j.z = m
h.x = b
h.o = m
assert c.v.o.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: C = None
        self.x: D = None
        self.z: A = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.y: C = None
        self.z: B = None
        self.r: C = None
        self.txt = txt

l = A("l")
m = B("m")
c = C("c")
b = D("b")
j = E("j")
h = D("h")

l.x = c
l.s = j
m.y = b
m.x = b
m.r = c
m.t = c
m.z = l
c.o = l
c.q = j
c.y = j
c.v = h
b.x = h
b.o = m
j.x = c
j.y = c
j.r = c
j.t = h
j.z = m
h.x = b
h.o = m
assert c.v.o.x.x.x.txt == "b"