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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: E = None
        self.w: A = None
        self.t: C = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: D = None
        self.y: A = None
        self.z: D = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: A = None
        self.o: B = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

h.x = l
l.o = h
l.w = h
l.p = i
l.x = i
l.t = c
k.p = h
k.y = h
k.s = h
k.r = b
k.z = a
a.u = i
a.v = i
a.z = i
a.x = h
a.o = l
i.z = h
c.p = h
c.y = h
c.s = h
c.r = b
c.z = a
b.u = i
b.v = i
b.z = i
b.x = h
b.o = l
assert c.r.x.x.o.x.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: E = None
        self.w: A = None
        self.t: C = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: D = None
        self.y: A = None
        self.z: D = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: A = None
        self.o: B = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

h.x = l
l.o = h
l.w = h
l.p = i
l.x = i
l.t = c
k.p = h
k.y = h
k.s = h
k.r = b
k.z = a
a.u = i
a.v = i
a.z = i
a.x = h
a.o = l
i.z = h
c.p = h
c.y = h
c.s = h
c.r = b
c.z = a
b.u = i
b.v = i
b.z = i
b.x = h
b.o = l
assert c.r.x.x.o.x.w.x.txt == "l"