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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: E = None
        self.o: E = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
n = C("n")
j = D("j")
b = E("b")
m = C("m")
a = B("a")
h = D("h")

l.p = a
l.q = b
l.s = n
l.y = n
l.r = h
i.s = n
i.u = b
i.o = b
i.y = h
i.z = l
n.p = l
n.t = l
n.z = b
j.x = m
j.s = m
b.s = j
b.w = h
m.p = l
m.t = l
m.z = b
a.s = m
a.u = b
a.o = b
a.y = h
a.z = l
h.x = n
h.s = n
assert j.s.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: E = None
        self.s: C = None
        self.r: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: E = None
        self.o: E = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
n = C("n")
j = D("j")
b = E("b")
m = C("m")
a = B("a")
h = D("h")

l.p = a
l.q = b
l.s = n
l.y = n
l.r = h
i.s = n
i.u = b
i.o = b
i.y = h
i.z = l
n.p = l
n.t = l
n.z = b
j.x = m
j.s = m
b.s = j
b.w = h
m.p = l
m.t = l
m.z = b
a.s = m
a.u = b
a.o = b
a.y = h
a.z = l
h.x = n
h.s = n
assert j.s.t.p.txt == "a"