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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: G = None
        self.z: G = None
        self.r: H = None
        self.p: C = None
        self.o: F = None
        self.y: H = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: D = None
        self.y: G = None
        self.o: E = None
        self.r: D = None
        self.txt = txt

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

h = A("h")
j = B("j")
d = C("d")
e = D("e")
f = E("f")
n = F("n")
l = G("l")
b = H("b")
m = G("m")

h.o = n
h.u = f
j.w = n
d.y = j
d.p = j
d.z = e
d.x = e
d.q = b
d.s = h
e.p = f
e.o = b
f.x = b
f.r = b
f.y = b
f.w = b
f.u = l
f.z = l
f.p = d
f.o = n
n.t = d
n.o = e
n.z = e
n.q = j
l.w = b
l.x = e
l.r = e
l.y = m
l.o = f
b.q = j
m.w = b
m.x = e
m.r = e
m.y = l
m.o = f
assert l.x.p.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: G = None
        self.z: G = None
        self.r: H = None
        self.p: C = None
        self.o: F = None
        self.y: H = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: D = None
        self.y: G = None
        self.o: E = None
        self.r: D = None
        self.txt = txt

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

h = A("h")
j = B("j")
d = C("d")
e = D("e")
f = E("f")
n = F("n")
l = G("l")
b = H("b")
m = G("m")

h.o = n
h.u = f
j.w = n
d.y = j
d.p = j
d.z = e
d.x = e
d.q = b
d.s = h
e.p = f
e.o = b
f.x = b
f.r = b
f.y = b
f.w = b
f.u = l
f.z = l
f.p = d
f.o = n
n.t = d
n.o = e
n.z = e
n.q = j
l.w = b
l.x = e
l.r = e
l.y = m
l.o = f
b.q = j
m.w = b
m.x = e
m.r = e
m.y = l
m.o = f
assert l.x.p.o.q.txt == "j"