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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: E = None
        self.txt = txt

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

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

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

m.y = a
m.p = a
c.s = h
c.q = b
g.z = e
g.u = a
b.z = e
b.q = e
b.o = k
b.r = k
b.y = h
k.o = h
k.p = m
k.x = a
a.o = c
a.p = m
a.x = k
e.z = g
e.u = k
h.s = c
h.q = b
assert h.s.s.q.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: E = None
        self.txt = txt

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

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

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

m.y = a
m.p = a
c.s = h
c.q = b
g.z = e
g.u = a
b.z = e
b.q = e
b.o = k
b.r = k
b.y = h
k.o = h
k.p = m
k.x = a
a.o = c
a.p = m
a.x = k
e.z = g
e.u = k
h.s = c
h.q = b
assert h.s.s.q.z.z.txt == "g"