class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: E = None
        self.t: D = 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.o: B = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
b = C("b")
f = D("f")
a = E("a")
d = A("d")

l.p = b
l.z = a
l.t = f
g.t = b
b.o = g
f.t = g
f.r = a
f.u = a
f.x = d
f.z = b
a.w = b
a.x = f
a.t = g
d.p = b
d.z = a
d.t = f
assert g.t.o.t.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: E = None
        self.t: D = 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.o: B = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
b = C("b")
f = D("f")
a = E("a")
d = A("d")

l.p = b
l.z = a
l.t = f
g.t = b
b.o = g
f.t = g
f.r = a
f.u = a
f.x = d
f.z = b
a.w = b
a.x = f
a.t = g
d.p = b
d.z = a
d.t = f
assert g.t.o.t.o.t.txt == "b"