class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.u: D = None
        self.y: B = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.o: D = None
        self.s: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

h.z = j
h.p = m
h.y = m
h.u = k
h.x = k
m.t = i
m.u = l
m.o = k
m.s = f
m.p = f
f.p = j
f.s = j
f.y = i
f.q = h
k.p = g
k.r = i
k.u = m
l.y = i
l.o = k
j.z = h
j.p = m
j.y = m
j.u = k
j.x = k
g.y = i
g.o = k
i.p = j
i.s = j
i.y = f
i.q = h
assert i.y.y.s.x.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.u: D = None
        self.y: B = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.o: D = None
        self.s: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

h.z = j
h.p = m
h.y = m
h.u = k
h.x = k
m.t = i
m.u = l
m.o = k
m.s = f
m.p = f
f.p = j
f.s = j
f.y = i
f.q = h
k.p = g
k.r = i
k.u = m
l.y = i
l.o = k
j.z = h
j.p = m
j.y = m
j.u = k
j.x = k
g.y = i
g.o = k
i.p = j
i.s = j
i.y = f
i.q = h
assert i.y.y.s.x.r.q.txt == "h"