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

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

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

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

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

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

b.y = c
b.w = c
b.v = c
b.q = c
b.p = n
a.p = l
a.x = c
a.v = n
c.x = n
n.y = l
n.s = l
l.t = a
l.z = b
l.w = b
l.p = b
l.v = n
h.p = l
h.x = c
h.v = n
assert n.s.t.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: C = None
        self.p: D = None
        self.v: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

b.y = c
b.w = c
b.v = c
b.q = c
b.p = n
a.p = l
a.x = c
a.v = n
c.x = n
n.y = l
n.s = l
l.t = a
l.z = b
l.w = b
l.p = b
l.v = n
h.p = l
h.x = c
h.v = n
assert n.s.t.x.x.txt == "n"