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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: F = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: H = None
        self.t: B = None
        self.o: D = None
        self.r: D = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: D = None
        self.w: D = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: G = None
        self.t: D = None
        self.x: F = None
        self.o: A = None
        self.v: C = None
        self.txt = txt

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

k.z = c
k.y = a
k.x = j
j.z = k
n.o = e
n.q = b
a.p = n
a.w = b
a.o = f
e.y = f
e.u = c
e.t = j
e.o = a
e.r = a
e.w = b
b.p = a
b.y = k
f.o = b
f.x = a
f.w = a
f.q = n
c.y = b
c.x = b
c.u = f
c.t = a
c.o = k
c.v = n
assert a.p.q.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: D = None
        self.x: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: F = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: H = None
        self.t: B = None
        self.o: D = None
        self.r: D = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: D = None
        self.w: D = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: G = None
        self.t: D = None
        self.x: F = None
        self.o: A = None
        self.v: C = None
        self.txt = txt

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

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