class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: B = None
        self.u: G = None
        self.o: G = None
        self.s: G = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: H = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: H = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

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

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

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