class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: B = None
        self.v: F = None
        self.z: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

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