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

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

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

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

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

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

b.r = m
b.z = k
b.q = g
i.t = b
i.r = b
e.y = a
e.o = a
e.r = g
e.w = c
e.t = k
g.y = k
g.s = m
c.u = g
c.t = b
m.u = f
m.t = b
k.t = b
k.r = b
a.y = e
a.o = e
a.r = g
a.w = m
a.t = l
l.t = b
l.r = b
f.y = k
f.s = m
assert g.y.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: B = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

b.r = m
b.z = k
b.q = g
i.t = b
i.r = b
e.y = a
e.o = a
e.r = g
e.w = c
e.t = k
g.y = k
g.s = m
c.u = g
c.t = b
m.u = f
m.t = b
k.t = b
k.r = b
a.y = e
a.o = e
a.r = g
a.w = m
a.t = l
l.t = b
l.r = b
f.y = k
f.s = m
assert g.y.t.r.txt == "m"