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

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

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

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

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

j = A("j")
i = B("i")
c = C("c")
h = D("h")
a = E("a")
g = A("g")
k = E("k")

j.y = g
j.r = g
j.x = a
j.o = i
i.z = c
i.s = c
i.t = c
i.o = k
i.y = g
c.q = h
c.s = h
c.y = a
c.u = k
c.r = k
h.w = j
a.y = h
g.y = j
g.r = j
g.x = a
g.o = i
k.y = h
assert a.y.w.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.x: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

j = A("j")
i = B("i")
c = C("c")
h = D("h")
a = E("a")
g = A("g")
k = E("k")

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