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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: H = None
        self.x: A = None
        self.r: D = None
        self.t: D = None
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: F = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: B = None
        self.o: F = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: G = None
        self.q: E = None
        self.y: C = None
        self.txt = txt

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

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

c = A("c")
k = B("k")
l = C("l")
d = D("d")
n = E("n")
b = F("b")
f = G("f")
j = H("j")
m = A("m")
a = D("a")

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: H = None
        self.x: A = None
        self.r: D = None
        self.t: D = None
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: F = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: B = None
        self.o: F = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: G = None
        self.q: E = None
        self.y: C = None
        self.txt = txt

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

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

c = A("c")
k = B("k")
l = C("l")
d = D("d")
n = E("n")
b = F("b")
f = G("f")
j = H("j")
m = A("m")
a = D("a")

c.o = j
k.y = a
k.r = a
k.t = a
k.p = j
k.v = j
k.x = m
l.q = d
d.u = f
d.x = b
d.p = c
n.w = d
n.x = k
n.o = b
n.z = f
b.z = a
b.w = f
b.q = n
b.y = l
f.p = c
f.z = c
f.w = n
j.s = k
j.y = k
j.o = a
j.q = a
j.u = m
m.o = j
a.u = f
a.x = b
a.p = c
assert m.o.q.x.q.x.txt == "k"