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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.v: E = None
        self.p: C = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
c = C("c")
b = D("b")
j = E("j")
g = E("g")
m = A("m")
a = C("a")

l.p = i
i.o = b
i.y = g
i.v = j
i.p = a
c.v = a
c.w = j
c.u = l
c.q = l
b.u = l
b.x = i
b.s = j
j.z = g
g.z = j
m.p = i
a.v = c
a.w = g
a.u = m
a.q = l
assert m.p.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.v: E = None
        self.p: C = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
c = C("c")
b = D("b")
j = E("j")
g = E("g")
m = A("m")
a = C("a")

l.p = i
i.o = b
i.y = g
i.v = j
i.p = a
c.v = a
c.w = j
c.u = l
c.q = l
b.u = l
b.x = i
b.s = j
j.z = g
g.z = j
m.p = i
a.v = c
a.w = g
a.u = m
a.q = l
assert m.p.y.z.txt == "j"