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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

n = A("n")
e = B("e")
m = C("m")
b = D("b")
i = E("i")
f = F("f")
l = G("l")
d = H("d")
j = G("j")

n.z = e
e.s = b
e.u = n
m.p = d
m.s = f
b.y = l
b.p = l
i.p = m
f.q = b
f.o = j
f.x = e
f.u = e
f.y = m
f.z = n
f.p = d
f.v = d
l.p = b
d.s = b
j.p = b
assert b.p.p.y.p.p.p.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

n = A("n")
e = B("e")
m = C("m")
b = D("b")
i = E("i")
f = F("f")
l = G("l")
d = H("d")
j = G("j")

n.z = e
e.s = b
e.u = n
m.p = d
m.s = f
b.y = l
b.p = l
i.p = m
f.q = b
f.o = j
f.x = e
f.u = e
f.y = m
f.z = n
f.p = d
f.v = d
l.p = b
d.s = b
j.p = b
assert b.p.p.y.p.p.p.p.p.txt == "b"