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

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

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

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

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

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

g.s = a
g.t = m
g.y = h
g.z = e
a.t = m
a.r = j
e.p = a
e.r = g
e.w = c
l.z = g
l.y = c
l.o = m
m.s = e
m.u = a
m.r = g
c.t = m
c.r = j
j.z = g
j.y = a
j.o = m
h.p = c
h.w = c
h.r = g
assert c.t.r.y.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: E = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

g.s = a
g.t = m
g.y = h
g.z = e
a.t = m
a.r = j
e.p = a
e.r = g
e.w = c
l.z = g
l.y = c
l.o = m
m.s = e
m.u = a
m.r = g
c.t = m
c.r = j
j.z = g
j.y = a
j.o = m
h.p = c
h.w = c
h.r = g
assert c.t.r.y.r.z.txt == "e"