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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: B = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

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

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

i = A("i")
j = B("j")
l = C("l")
g = D("g")
d = E("d")
a = E("a")

i.o = j
i.r = j
i.z = d
j.t = l
l.y = a
l.t = j
l.u = i
l.v = g
g.z = a
d.w = j
d.x = i
d.o = i
a.w = j
a.x = i
a.o = i
assert g.z.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: E = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: B = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

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

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

i = A("i")
j = B("j")
l = C("l")
g = D("g")
d = E("d")
a = E("a")

i.o = j
i.r = j
i.z = d
j.t = l
l.y = a
l.t = j
l.u = i
l.v = g
g.z = a
d.w = j
d.x = i
d.o = i
a.w = j
a.x = i
a.o = i
assert g.z.x.o.txt == "j"