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

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

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

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

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

b = A("b")
l = B("l")
n = C("n")
m = D("m")
j = E("j")
h = A("h")
k = C("k")
c = D("c")

b.z = h
b.t = j
l.z = k
l.x = m
n.x = h
n.y = k
n.s = m
n.t = m
m.p = l
m.y = b
m.s = c
j.p = k
h.z = b
h.t = j
k.x = h
k.y = n
k.s = m
k.t = c
c.p = l
c.y = h
c.s = m
assert h.t.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: E = None
        self.txt = txt

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

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

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

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

b = A("b")
l = B("l")
n = C("n")
m = D("m")
j = E("j")
h = A("h")
k = C("k")
c = D("c")

b.z = h
b.t = j
l.z = k
l.x = m
n.x = h
n.y = k
n.s = m
n.t = m
m.p = l
m.y = b
m.s = c
j.p = k
h.z = b
h.t = j
k.x = h
k.y = n
k.s = m
k.t = c
c.p = l
c.y = h
c.s = m
assert h.t.p.s.txt == "m"