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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

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

a.s = l
h.u = l
h.o = b
h.s = a
h.z = i
b.r = l
l.t = b
l.r = a
l.x = a
l.o = g
k.r = i
k.y = g
k.q = g
i.u = l
i.o = b
i.s = a
i.z = h
e.r = i
e.y = b
e.q = b
g.r = l
j.r = i
j.y = g
j.q = b
assert e.r.u.x.s.t.r.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

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

a.s = l
h.u = l
h.o = b
h.s = a
h.z = i
b.r = l
l.t = b
l.r = a
l.x = a
l.o = g
k.r = i
k.y = g
k.q = g
i.u = l
i.o = b
i.s = a
i.z = h
e.r = i
e.y = b
e.q = b
g.r = l
j.r = i
j.y = g
j.q = b
assert e.r.u.x.s.t.r.r.s.txt == "l"