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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: D = None
        self.s: D = None
        self.x: C = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

n = A("n")
h = B("h")
l = C("l")
m = D("m")
d = E("d")
e = A("e")
c = B("c")
j = C("j")

n.w = l
n.r = j
n.p = j
n.x = e
n.t = c
h.r = m
h.q = m
h.s = m
h.p = m
h.x = l
l.u = m
m.r = n
m.t = n
d.t = e
d.y = l
d.q = m
e.w = j
e.p = j
e.r = l
e.x = n
e.t = c
c.r = m
c.q = m
c.s = m
c.p = m
c.x = j
j.u = m
assert c.s.t.p.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.p: C = None
        self.x: A = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: D = None
        self.s: D = None
        self.x: C = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

n = A("n")
h = B("h")
l = C("l")
m = D("m")
d = E("d")
e = A("e")
c = B("c")
j = C("j")

n.w = l
n.r = j
n.p = j
n.x = e
n.t = c
h.r = m
h.q = m
h.s = m
h.p = m
h.x = l
l.u = m
m.r = n
m.t = n
d.t = e
d.y = l
d.q = m
e.w = j
e.p = j
e.r = l
e.x = n
e.t = c
c.r = m
c.q = m
c.s = m
c.p = m
c.x = j
j.u = m
assert c.s.t.p.u.t.txt == "n"