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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: F = None
        self.v: A = None
        self.x: D = None
        self.p: C = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.r: C = None
        self.y: E = None
        self.q: H = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: F = None
        self.v: A = None
        self.x: D = None
        self.p: C = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.r: C = None
        self.y: E = None
        self.q: H = None
        self.z: C = None
        self.txt = txt

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

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

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

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