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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

m.p = c
m.s = l
m.o = h
m.q = j
g.o = j
g.s = l
b.q = l
b.t = l
b.z = h
b.v = h
h.w = j
h.z = b
h.p = n
h.t = g
n.u = l
l.p = c
l.s = m
l.o = h
l.q = b
j.q = m
j.z = h
j.v = h
j.t = l
c.u = l
assert b.v.t.s.p.u.o.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: A = None
        self.o: D = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

m.p = c
m.s = l
m.o = h
m.q = j
g.o = j
g.s = l
b.q = l
b.t = l
b.z = h
b.v = h
h.w = j
h.z = b
h.p = n
h.t = g
n.u = l
l.p = c
l.s = m
l.o = h
l.q = b
j.q = m
j.z = h
j.v = h
j.t = l
c.u = l
assert b.v.t.s.p.u.o.t.s.txt == "l"