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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: F = None
        self.p: D = None
        self.x: F = None
        self.y: E = None
        self.r: D = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

b = A("b")
f = B("f")
c = C("c")
i = D("i")
d = E("d")
a = F("a")
k = G("k")
n = H("n")

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: F = None
        self.p: D = None
        self.x: F = None
        self.y: E = None
        self.r: D = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

b = A("b")
f = B("f")
c = C("c")
i = D("i")
d = E("d")
a = F("a")
k = G("k")
n = H("n")

b.x = c
b.o = a
f.q = b
c.z = n
c.s = a
c.x = a
c.p = i
c.r = i
c.y = d
c.t = b
i.x = d
i.q = k
i.r = k
i.z = b
i.v = b
d.z = f
d.u = i
a.x = i
a.u = k
a.o = d
a.p = n
k.z = n
k.v = n
k.p = d
k.w = b
n.x = f
n.o = i
n.v = b
assert a.p.v.o.txt == "a"