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

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

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

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

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

j = A("j")
i = B("i")
a = C("a")
e = D("e")
l = E("l")
g = D("g")

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

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

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

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

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

j = A("j")
i = B("i")
a = C("a")
e = D("e")
l = E("l")
g = D("g")

j.s = i
i.o = l
i.y = l
i.v = a
i.u = j
i.r = j
a.z = l
a.s = g
a.y = i
e.p = j
e.o = j
l.w = g
l.o = a
l.y = e
l.u = i
l.v = j
g.p = j
g.o = j
assert a.s.p.s.o.txt == "l"