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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.z: F = None
        self.q: G = None
        self.r: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: E = None
        self.r: G = None
        self.u: B = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: B = None
        self.o: F = None
        self.p: A = None
        self.txt = txt

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

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

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

g = A("g")
h = B("h")
l = C("l")
b = D("b")
n = E("n")
i = F("i")
m = G("m")
c = H("c")
f = A("f")

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.z: F = None
        self.q: G = None
        self.r: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: E = None
        self.r: G = None
        self.u: B = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: B = None
        self.o: F = None
        self.p: A = None
        self.txt = txt

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

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

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

g = A("g")
h = B("h")
l = C("l")
b = D("b")
n = E("n")
i = F("i")
m = G("m")
c = H("c")
f = A("f")

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