class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: A = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.v: D = None
        self.t: C = None
        self.r: A = None
        self.txt = txt

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

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

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

j = A("j")
e = B("e")
b = C("b")
i = D("i")
m = E("m")
l = A("l")

j.y = m
j.o = m
j.p = l
e.o = j
e.p = i
e.v = i
e.t = b
e.r = l
b.u = m
i.v = m
i.t = m
i.z = l
i.s = l
i.p = e
m.o = i
m.t = b
l.y = m
l.o = m
l.p = j
assert l.p.p.y.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: A = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.v: D = None
        self.t: C = None
        self.r: A = None
        self.txt = txt

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

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

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

j = A("j")
e = B("e")
b = C("b")
i = D("i")
m = E("m")
l = A("l")

j.y = m
j.o = m
j.p = l
e.o = j
e.p = i
e.v = i
e.t = b
e.r = l
b.u = m
i.v = m
i.t = m
i.z = l
i.s = l
i.p = e
m.o = i
m.t = b
l.y = m
l.o = m
l.p = j
assert l.p.p.y.o.t.txt == "m"