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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

l.s = b
l.r = g
j.r = g
j.z = m
j.o = k
j.q = k
j.t = a
m.v = j
g.w = k
g.s = j
g.z = m
a.z = l
a.w = j
b.w = k
b.s = j
b.z = m
k.w = b
k.s = j
k.z = m
assert l.s.z.v.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

l.s = b
l.r = g
j.r = g
j.z = m
j.o = k
j.q = k
j.t = a
m.v = j
g.w = k
g.s = j
g.z = m
a.z = l
a.w = j
b.w = k
b.s = j
b.z = m
k.w = b
k.s = j
k.z = m
assert l.s.z.v.t.w.txt == "j"