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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: E = None
        self.y: H = None
        self.s: C = None
        self.r: A = None
        self.txt = txt

j = A("j")
i = B("i")
m = C("m")
d = D("d")
f = E("f")
h = F("h")
k = G("k")
g = H("g")
c = D("c")
n = H("n")

j.x = f
j.q = m
j.p = m
j.s = h
i.p = j
i.t = m
i.u = f
m.q = j
m.x = j
d.t = f
d.v = f
d.z = f
d.w = k
d.p = k
d.r = j
f.u = d
f.x = m
f.p = m
f.w = k
f.o = k
f.s = c
f.r = i
f.t = j
h.y = m
h.o = g
k.z = f
k.u = f
k.w = i
k.t = i
k.p = g
k.x = j
k.v = d
k.s = h
g.x = k
g.v = f
g.y = n
g.s = m
g.r = j
c.t = f
c.v = f
c.z = f
c.w = k
c.p = k
c.r = j
n.x = k
n.v = f
n.y = g
n.s = m
n.r = j
assert h.o.x.x.q.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: C = None
        self.s: F = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: E = None
        self.y: H = None
        self.s: C = None
        self.r: A = None
        self.txt = txt

j = A("j")
i = B("i")
m = C("m")
d = D("d")
f = E("f")
h = F("h")
k = G("k")
g = H("g")
c = D("c")
n = H("n")

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