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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

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

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