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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.p: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.p: E = None
        self.r: F = None
        self.txt = txt

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

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