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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: C = None
        self.v: C = None
        self.u: A = None
        self.s: A = None
        self.txt = txt

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

e = A("e")
f = B("f")
b = C("b")
g = D("g")
m = E("m")
l = E("l")

e.t = l
e.p = f
e.z = f
f.w = g
f.q = e
b.t = f
b.x = g
b.w = g
g.w = f
g.x = b
g.v = b
g.u = e
g.s = e
m.p = e
m.y = e
l.p = e
l.y = e
assert e.t.y.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: C = None
        self.v: C = None
        self.u: A = None
        self.s: A = None
        self.txt = txt

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

e = A("e")
f = B("f")
b = C("b")
g = D("g")
m = E("m")
l = E("l")

e.t = l
e.p = f
e.z = f
f.w = g
f.q = e
b.t = f
b.x = g
b.w = g
g.w = f
g.x = b
g.v = b
g.u = e
g.s = e
m.p = e
m.y = e
l.p = e
l.y = e
assert e.t.y.p.q.txt == "e"