class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: B = None
        self.w: D = None
        self.y: E = None
        self.v: C = None
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: C = None
        self.o: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: F = None
        self.o: B = None
        self.txt = txt

j = A("j")
m = B("m")
e = C("e")
a = D("a")
h = E("h")
n = F("n")
c = G("c")
d = H("d")
b = C("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: C = None
        self.o: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: F = None
        self.o: B = None
        self.txt = txt

j = A("j")
m = B("m")
e = C("e")
a = D("a")
h = E("h")
n = F("n")
c = G("c")
d = H("d")
b = C("b")

j.t = b
j.v = b
j.s = m
j.w = a
j.z = a
j.y = h
m.x = h
m.y = h
m.u = a
e.s = b
e.t = b
e.v = h
e.y = d
e.z = d
e.q = a
a.r = n
a.s = e
a.o = e
h.x = j
n.o = d
c.y = n
d.w = j
d.r = n
d.o = m
b.s = e
b.t = e
b.v = h
b.y = d
b.z = d
b.q = a
assert h.x.s.u.r.txt == "n"