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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: H = None
        self.q: G = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: B = None
        self.z: G = None
        self.t: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: G = None
        self.s: B = None
        self.p: D = None
        self.w: C = None
        self.r: A = None
        self.v: G = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: F = None
        self.txt = txt

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

c = A("c")
k = B("k")
a = C("a")
m = D("m")
e = E("e")
h = F("h")
l = G("l")
j = H("j")

c.o = m
c.u = j
k.x = c
k.u = j
k.q = l
k.v = h
a.o = m
m.r = l
m.z = l
m.u = k
m.t = j
e.t = m
e.q = m
h.u = m
h.p = m
h.z = l
h.v = l
h.s = k
h.w = a
h.r = c
h.x = c
l.x = e
l.y = h
j.t = c
j.u = k
assert m.z.y.s.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: H = None
        self.q: G = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: B = None
        self.z: G = None
        self.t: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: G = None
        self.s: B = None
        self.p: D = None
        self.w: C = None
        self.r: A = None
        self.v: G = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: F = None
        self.txt = txt

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

c = A("c")
k = B("k")
a = C("a")
m = D("m")
e = E("e")
h = F("h")
l = G("l")
j = H("j")

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