class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: C = None
        self.x: F = None
        self.q: E = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: H = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: F = None
        self.x: F = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: F = None
        self.z: F = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: H = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: F = None
        self.x: F = None
        self.u: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: F = None
        self.z: F = None
        self.s: D = None
        self.txt = txt

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

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

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

d.z = i
d.q = i
d.u = m
d.x = b
d.w = k
h.q = n
h.x = k
h.v = i
h.s = i
m.o = c
m.v = d
m.s = k
c.u = k
c.p = i
i.o = c
i.q = b
i.x = g
i.u = h
i.p = d
g.o = k
g.x = b
g.z = b
g.s = c
n.v = i
k.x = i
k.s = c
b.o = k
b.x = g
b.z = g
b.s = c
assert b.o.s.p.txt == "i"