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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: A = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: F = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: D = None
        self.x: C = None
        self.w: A = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: A = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: F = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: D = None
        self.x: C = None
        self.w: A = None
        self.q: G = None
        self.txt = txt

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

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