class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.s: E = None
        self.v: C = None
        self.z: G = None
        self.w: G = None
        self.r: D = None
        self.x: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.x: C = None
        self.v: A = None
        self.u: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.x: C = None
        self.v: A = None
        self.u: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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