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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: D = None
        self.x: F = None
        self.t: C = None
        self.u: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: D = None
        self.x: F = None
        self.t: C = None
        self.u: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.txt = txt

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

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